/* 
===========================
自定义页头样式
===========================
*/
body .custom-header,
body .custom-header * {
    box-sizing: border-box;
}

/* 覆盖主主题的.site-header样式 - 使用更高优先级选择器 */
body .site-header.custom-header {
    display: block;
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
}

/* 确保自定义页头不受主题默认宽度限制 - 使用更高优先级选择器 */
body .custom-header .header-inner {
    max-width: none;
    width: 100%;
    display: block;
    flex-wrap: unset;
    justify-content: unset;
    padding: 0;
    margin: 0;
}

/* 确保容器不受任何外部样式影响 */
body .site-header.custom-header .container,
body .custom-header .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    display: block;
}

/* 顶部栏样式 */
.top-bar {
    background-color: #212121;
    height: 65px;
    display: flex;
    align-items: center;
}

/* 新人折扣码公告样式（块级、静态定位） */

/* 公告栏：提升内边距并居中对齐内容 */
.newcomer-notice-banner {
    display: flex;               /* 让内部内容水平/垂直居中 */
    align-items: center;
    justify-content: center;
    position: static;            /* 明确不使用绝对定位 */
    width: 100%;
    box-sizing: border-box;
    padding: 14px 24px;          /* 增加整体内边距 */
    text-align: center;
}

.newcomer-notice-banner .container {
    width: 100%;
    max-width: 1200px;           /* 与页头内容宽度保持一致 */
    margin: 0 auto;              /* 居中容器 */
    padding: 0 12px;             /* 适当的左右内边距 */
}

.newcomer-notice-banner__text {
    font-size: 14px;
    line-height: 1.6;
}

/* 小屏优化：稍微减小内边距，保证空间舒适 */
@media (max-width: 480px) {
    .newcomer-notice-banner {
        padding: 12px 16px;
    }
    .newcomer-notice-banner .container {
        padding: 0 10px;
    }
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo样式 */
.site-logo {
    width: 52px;
    height: 50px;
    flex-shrink: 0;
}

.site-logo a {
    display: block;
    width: 100%;
    height: 100%;
}

.site-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 搜索区域样式 */
.header-search {
    width: 256px;
    flex-shrink: 0;
}

/* 通用过渡效果 */
.search-wrapper,
.search-field,
.nav-menu a,
.language-switcher,
.user-link,
.cart-link,
.cart-count,
.mobile-menu-toggle,
.search-field::placeholder,
.lang-text,
.language-icon svg,
.user-account svg,
.cart-icon svg,
.search-submit svg {
    transition: all 0.3s ease;
}

.search-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.search-wrapper.search-focused {
    box-shadow: 0 0 10px rgba(209, 167, 93, 0.3);
    border-radius: 4px;
}

.search-field {
    width: 100%;
    height: 100%;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    padding: 9px 50px 9px 14px;
    font-family: 'SF Pro Text', sans-serif;
    font-size: 14px;
    line-height: 1.193359375em;
    color: rgba(255, 255, 255, 0.5);
    outline: none;
}

.search-field:focus {
    background: none;
    color: #333333;
    border-color: var(--e-global-color-primary);
}

.search-field:focus::placeholder {
    color: #999999;
}

.search-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 屏幕阅读器文本 */
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
}

.search-submit,
.language-switcher,
.user-link,
.cart-link,
.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
}

/* 移动端菜单切换按钮 */
.mobile-menu-toggle {
    display: none;
    background: none !important;
    border: none;
    color: #fff !important;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--e-global-color-primary);
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--e-global-color-primary);
    outline-offset: 2px;
}

.mobile-menu-toggle.active {
    background-color: rgba(209, 167, 93, 0.2);
    color: var(--e-global-color-primary);
}

.search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: transform 0.3s ease;
}

.search-submit:hover,
.search-submit:focus,
.search-submit:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
}

.search-submit svg {
    width: 13.5px;
    height: 13.5px;
    margin: 2.25px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
    display: block;
}

.search-submit:hover svg {
    color: var(--e-global-color-primary);
}

/* 导航条样式 */
.navigation-bar {
    background-color: #000000;
    position: relative;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

/* 主导航菜单样式 */
.main-navigation {
    flex: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 60px;
}

.nav-menu li {
    margin: 0;
}

/* 字体样式统一 */
.nav-menu a,
.cart-count-number {
    font-family: 'Source Han Sans CN', sans-serif;
    font-weight: 400;
    font-size: 14px;
}

.nav-menu a {
    color: var(--e-global-color-text);
    text-decoration: none;
    line-height: 1.5em;
    text-transform: uppercase;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a,
.nav-menu .active a {
    color: var(--e-global-color-primary);
}

/* 导航菜单链接focus状态样式 */
.nav-menu a:focus {
    color: var(--e-global-color-primary);
}



/* 共享的Flex居中布局 */
.header-actions,
.language-switcher,
.user-account,
.header-cart,
.cart-count {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 右侧功能区样式 */
.header-actions {
    gap: 33px;
    height: 60px;
    padding: 0;
}

/* 语言切换样式 */
.language-switcher {
    width: 57px;
    height: 24px;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.language-current {
    position: absolute;
    right: 0;
    width: 29px;
}

.lang-text {
    color: var(--e-global-color-text);
    font-family: 'SF Pro Text', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.193359375em;
    transition: color 0.3s ease;
}

.language-switcher:hover .lang-text {
    color: var(--e-global-color-primary);
}

.language-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
}

.language-icon svg,
.user-account svg,
.cart-icon svg {
    color: var(--e-global-color-text);
    transition: color 0.3s ease;
}

.language-switcher:hover .language-icon svg,
.user-account:hover svg,
.cart-trigger:hover .cart-icon svg {
    color: var(--e-global-color-primary);
}

/* 个人中心样式 */
/* 统一尺寸样式 */
.user-account,
.language-icon,
.cart-icon {
    width: 24px;
    height: 24px;
}

.user-account {
    padding: 0;
    background: none;
}

.user-link {
    display: block;
    width: 24px;
    height: 24px;
    padding: 0;
}

/* 购物车样式 */
.header-cart {
    position: relative;
    width: 46px;
    height: 24px;
    padding: 0;
    background: none;
}

.cart-link {
    display: block;
    width: 46px;
    height: 24px;
    position: relative;
    transition: transform 0.3s ease;
    background: none;
    border: none;
    padding: 0;
}

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

.cart-icon svg {
    width: 100%;
    height: 100%;
    color: var(--e-global-color-text);
    transition: color 0.3s ease;
}

.cart-trigger:hover .cart-icon svg {
    color: var(--e-global-color-primary);
}

.cart-count {
    position: absolute;
    right: -8px;
    top: -8px;
    width: 18px;
    height: 18px;
    background-color: var(--e-global-color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-count.cart-updated {
    animation: cartBounce 0.3s ease;
}

.cart-count-number {
    color: #482906;
    font-family: 'Source Han Sans CN', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    text-align: center;
}

/* 桌面端隐藏搜索容器 */
@media (min-width: 769px) {
    .search-container,
    .search-container.active {
        display: none !important;
    }
}

/* 购物车更新动画 */
@keyframes cartBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* 页头滚动效果 */
.custom-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

/* 可访问性改进 */
.custom-header a:focus,
.custom-header button:focus {
    outline: 2px solid var(--e-global-color-primary);
    outline-offset: 2px;
}

/* 打印样式 */


/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .nav-menu a {
        color: var(--e-global-color-text);
        background-color: #000000;
    }

    .search-field {
        border: 2px solid var(--e-global-color-text);
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {

    .custom-header *,
    .custom-header *::before,
    .custom-header *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 响应式设计 */
@media (max-width: 1920px) {
    /* 使用 flex 布局，不需要定位样式 */
}

/* 响应式布局公共变量 */
:root {
    --header-height-xl: 65px;
    --header-height-lg: 60px;
    --header-height-md: 50px;
    --header-height-sm: 45px;
    --header-height-xs: 40px;

    --logo-height-xl: 50px;
    --logo-height-lg: 35px;
    --logo-height-md: 30px;
    --logo-height-sm: 28px;
    --logo-height-xs: 25px;

    --menu-gap-xl: 60px;
    --menu-gap-lg: 20px;
    --menu-gap-md: 15px;
}

@media (max-width: 1200px) {

    .top-bar,
    .nav-bar {
        height: var(--header-height-lg);
    }

    .site-logo img {
        max-height: var(--logo-height-lg);
    }

    .nav-menu {
        gap: var(--menu-gap-lg);
    }
}

@media (max-width: 992px) {

    .top-bar,
    .nav-bar {
        height: var(--header-height-md);
    }

    .site-logo img {
        max-height: var(--logo-height-md);
    }

    .header-search {
        width: 200px;
    }

    .search-field {
        font-size: 13px;
    }

    .nav-menu {
        gap: 8px;
    }

    .nav-menu a {
        font-size: 13px;
    }

    .header-actions {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .custom-header {
        position: relative;
    }

    .top-bar {
        height: 45px;
    }

    .nav-bar {
        height: auto;
        min-height: 50px;
        flex-wrap: wrap;
    }

    .nav-content {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 0 10px;
    }

    .site-logo {
        position: static;
        order: 1;
        width: 40px;
        height: 40px;
    }

    .site-logo img {
        max-height: 40px;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* 移动端搜索区域样式 */
    .header-search {
        position: static;
        order: 3;
        width: auto;
        margin: 0;
        border-radius: 0;
        overflow: visible;
    }

    /* 隐藏搜索输入框，只在点击图标时显示 */
    .search-wrapper {
        position: relative;
    }

    /* 搜索框全宽容器 */
    .search-container {
        display: none;
        position: absolute;
        top: 45px;
        /* 与顶部栏高度一致 */
        left: 0;
        width: 100%;
        background-color: #212121;
        padding: 15px;
        z-index: 1000;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .search-container.active {
        display: block;
        animation: fadeIn 0.3s ease-out;
    }

    .search-field {
        display: block;
        position: relative;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        z-index: 1001;
        background-color: #333;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }

    .search-field.active {
        display: block;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* 搜索按钮样式调整 */
    .search-submit {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 36px;
        height: 36px;
        padding: 8px !important;
        background-color: transparent;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-submit svg {
        width: 20px;
        height: 20px;
        margin: 0;
    }

    .search-submit:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #1a1a1a;
        flex-direction: column;
        padding: 15px 20px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0 0 8px 8px;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* 确保移动菜单在点击切换按钮后显示 */
    .main-navigation.mobile-menu-open .nav-menu {
        display: flex;
    }

    .nav-menu.active,
    .main-navigation.mobile-menu-open .nav-menu {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 12px 15px;
        transition: all 0.2s ease;
    }

    .header-actions {
        order: 2;
        gap: 12px;
        margin-right: 5px;
        height: 45px;
        /* 调整为与顶部栏高度一致 */
        display: flex;
        align-items: center;
    }


    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 480px) {

    .top-bar-content,
    .nav-content {
        padding: 0 15px;
    }

    .top-bar {
        height: 40px;
    }

    .site-logo {
        width: 35px;
        height: 35px;
    }

    .site-logo img {
        max-height: 35px;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .header-search {
        margin: 0;
    }

    .search-container {
        top: 40px;
        /* 与小屏幕顶部栏高度一致 */
        padding: 10px;
    }

    .search-container .container {
        padding: 0 5px;
    }

    .search-field {
        font-size: 12px;
        padding: 8px 30px 8px 12px;
        border-radius: 6px;
    }

    .search-submit {
        width: 32px;
        height: 32px;
        padding: 6px !important;
    }

    .search-submit svg {
        width: 18px;
        height: 18px;
    }

    .header-actions {
        gap: 12px;
        margin-right: 5px;
        height: 40px;
        /* 调整为与小屏幕顶部栏高度一致 */
        display: flex;
        align-items: center;
    }

    .header-actions svg {
        width: 18px;
        height: 18px;
    }

    .cart-count {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        right: -5px;
        top: -5px;
    }

    /* 改善移动端菜单体验 */
    .nav-menu {
        padding: 20px 5px;
    }

    .nav-menu a {
        padding: 5px;
    }
}