/* 顶部导航 - 与 header.liquid 中的样式保持一致 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-item > a:hover {
    color: #111827;
    background: #f3f4f6;
}

.nav-item > a[style*="font-weight: bold"] {
    color: #3b82f6;
    background: #eff6ff;
}

/* 下拉菜单 */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    min-width: 200px;
    padding: 8px 0;
    margin-top: 4px;
    z-index: 100;
}

.nav-item:hover .dropdown {
    display: block;
}

/* 二级菜单项 */
.dropdown-item {
    position: relative;
}

.dropdown-item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
}

.dropdown-item > a:hover {
    background: #f9fafb;
    color: #111827;
}

.dropdown-item > a[style*="font-weight: bold"] {
    color: #3b82f6;
    background: #eff6ff;
}

/* 箭头指示器 */
.arrow {
    font-size: 16px;
    font-weight: bold;
    margin-left: 8px;
    color: #9ca3af;
}

/* 三级菜单 */
.submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    min-width: 180px;
    padding: 8px 0;
    margin-left: -4px;
    z-index: 101;
}

.dropdown-item:hover .submenu {
    display: block;
}

.submenu a {
    display: block;
    padding: 10px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
}

.submenu a:hover {
    background: #f9fafb;
    color: #111827;
}

.submenu a[style*="font-weight: bold"] {
    color: #3b82f6;
    background: #eff6ff;
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu a {
    padding: 8px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.user-menu a:hover {
    background: #f3f4f6;
    color: #111827;
}

/* 语言选择器 */
.language-selector select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    transition: all 0.2s;
}

.language-selector select:hover {
    border-color: #9ca3af;
}

.language-selector select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 购物车图标 */
.cart-icon-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px;
    color: #4b5563;
    transition: color 0.2s;
}

.cart-icon-link:hover {
    color: #667eea;
}

.cart-icon {
    width: 24px;
    height: 24px;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #f56c6c;
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    transform: translate(30%, -30%);
}

/* ==================== 顶部搜索入口 ==================== */
/* 搜索容器：承载图标按钮 + 下拉搜索框 */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

/* 搜索图标按钮：与购物车图标风格统一（24x24 与 .cart-icon 一致） */
.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #4b5563;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}
.nav-search-btn:hover {
    color: #667eea;
    background: #f3f4f6;
}
.nav-search-btn svg {
    width: 24px;
    height: 24px;
}

/* 下拉搜索框：点击图标后展开，绝对定位于图标下方右侧
   采用融入式设计：输入框无边框透明背景，与容器融为一体，仅提交按钮突出 */
.nav-search-box {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 8px 8px 8px 14px;
    min-width: 300px;
    z-index: 200;
    animation: navSearchSlideIn 0.2s ease;
}
@keyframes navSearchSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 搜索输入框：无边框透明背景，与下拉容器融为一体 */
.nav-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1a1a2e;
    background: transparent;
    padding: 6px 0;
    min-width: 0;
}
.nav-search-input::placeholder {
    color: #9ca3af;
}

/* 搜索提交按钮：渐变背景，突出可点击 */
.nav-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.nav-search-submit svg {
    width: 18px;
    height: 18px;
}

/* 响应式：移动端搜索框宽度自适应 */
@media (max-width: 768px) {
    .nav-search-box {
        min-width: 240px;
        right: -8px;
    }
    .nav-search-submit {
        padding: 8px 10px;
    }
}
