/* 自定义头部样式 */
#custom-header {
    position: relative;
    background: #000;
    color: #fff;
}

/* 防止菜单打开时页面滚动 */
body.menu-open {
    overflow: hidden;
}

/* 顶部栏 */
.header-top {
    background: #000;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 左侧、中间、右侧布局 */
.header-left,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 0 0 auto;
    text-align: center;
}

/* Logo */
.site-logo img {
    height: 60px;
    width: auto;
    display: block;
}

/* 链接样式 */
.wishlist-link,
.compare-link,
.account-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

.wishlist-link:hover,
.compare-link:hover,
.account-link:hover {
    color: #c9a961;
}

.wishlist-link svg,
.compare-link svg,
.account-link svg {
    width: 16px;
    height: 16px;
}

/* 导航栏 */
.header-nav {
    background: #000;
    padding: 15px 0;
}

.header-nav .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 主导航 */
.main-navigation {
    flex: 1;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 40px;
    justify-content: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    transition: opacity 0.3s;
    display: block;
    padding: 5px 0;
}

.nav-menu a:hover {
    color: #c9a961;
}

/* 当前页面下划线 */
.nav-menu .current-menu-item a,
.nav-menu .current_page_item a {
    border-bottom: 2px solid #c9a961;
    color: #c9a961;
}

/* 右侧工具栏 */
.header-tools {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-toggle,
.cart-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    position: relative;
    transition: opacity 0.3s;
}

.search-toggle:hover,
.cart-toggle:hover {
    color: #c9a961;
}

.cart-toggle {
    text-decoration: none;
}

/* 购物车数量徽章 */
.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #c9a961;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索弹窗 */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-content {
    width: 100%;
    max-width: 600px;
    padding: 40px;
    position: relative;
}

.search-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    transition: opacity 0.3s;
}

.search-close:hover {
    color: #c9a961;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 4px;
}

.search-field {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    outline: none;
}

.search-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-submit {
    background: none;
    border: none;
    color: #c9a961;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
}

/* 移动端账号图标 */
.account-toggle.mobile-only {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s;
}

.account-toggle.mobile-only:hover {
    color: #c9a961;
}

/* 汉堡菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    height: 30px;
    justify-content: center;
    transition: all 0.3s;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all 0.3s;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 移动端菜单遮罩 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 隐藏顶部栏，只保留导航栏 */
    .header-top {
        display: none;
    }

    /* 导航栏变成唯一的头部 */
    .header-nav {
        padding: 15px 0;
    }

    .header-nav .header-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Logo移到导航栏左侧 */
    .header-nav .header-container::before {
        content: '';
        display: block;
        width: 120px;
        height: 40px;
        background-image: url('https://ageojewelry.com/wp-content/uploads/2025/11/logo-1.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: left center;
        margin-right: auto;
    }

    /* 隐藏桌面端的主导航 */
    .main-navigation {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: #000;
        z-index: 999;
        transition: left 0.3s;
        overflow-y: auto;
        padding: 60px 0 30px;
    }

    .main-navigation.active {
        left: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu a {
        padding: 15px 25px;
        display: block;
        font-size: 16px;
    }

    .nav-menu .current-menu-item a,
    .nav-menu .current_page_item a {
        border-bottom: none;
        background: rgba(201, 169, 97, 0.1);
    }

    /* 右侧工具栏 - 账号+搜索+购物车+汉堡菜单 */
    .header-tools {
        display: flex;
        align-items: center;
        gap: 1px;
        margin: 0 10px;
    }

    /* 显示移动端账号图标 */
    .account-toggle.mobile-only {
        display: flex;
    }

    /* 显示汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        order: 10;
    }

    /* 搜索和购物车图标大小调整 */
    .search-toggle,
    .cart-toggle,
    .account-toggle.mobile-only {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
