/* ============================================================
   顶部栏
   ============================================================ */
.site-topbar {
    height: 35px;
    background: rgba(248, 248, 248, 0.92);
    color: #555;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transform: translateY(0);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 1;
    max-height: none;
    overflow: visible;
}

.site-topbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    border-bottom: none;
}
.site-topbar__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 35px;
}
@media (max-width: 768px) {
    .site-topbar__inner {
        padding: 0 16px;
    }
}
.site-topbar__contact-group {
    display: flex;
    align-items: center;
    gap: 32px;
    font-style: normal;
}
.site-topbar__contact-link {
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.25s ease;
    white-space: nowrap;
}
.site-topbar__contact-link:hover {
    color: var(--primary-color);
}
.site-topbar__contact-link i {
    color: var(--primary-color);
}
.site-topbar__welcome-text {
    white-space: nowrap;
}
@media (max-width: 900px) and (min-width: 769px) {
    .site-topbar__contact-group { gap: 14px; }
    .site-topbar__contact-link { font-size: 12px; }
}
@media (max-width: 768px) {
    .site-topbar__welcome-text { display: none; }
    .site-topbar__inner { height: 32px; justify-content: center; }
    .site-topbar { height: 32px; max-height: 32px; }
    .site-topbar__contact-group { gap: 22px; }
    .site-topbar__contact-link { font-size: 12px; }
}


/* ============================================================
   导航栏
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    background: var(--primary-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.site-header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.18);
}

.site-header__wrap {
    padding: 12px 0;
    position: relative;
}

.site-header__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 20px;
}
@media (max-width: 768px) {
    .site-header__container {
        padding: 0 16px;
    }
}
.site-header__container > a:first-child {
    margin-right: auto;
}

.site-header__logo-link {
    color: #fff;
    flex-shrink: 0;
}
.site-header__logo-image {
    max-height: 38px;
    width: auto;
    transition: max-height 0.3s ease;
}
.site-header.scrolled .site-header__logo-image {
    max-height: 34px;
}


/* ============================================================
   PC 导航 (≥769px)
   ============================================================ */
@media (min-width: 769px) {
    .site-header__nav-list {
        display: flex;
        gap: 6px;
        list-style: none;
        align-items: center;
        margin: 0;
        padding: 0;
    }
    .site-header__nav-item {
        position: static;
        padding-bottom: 12px;
        margin-bottom: -12px;
    }
    .site-header__nav-item-link {
        font-size: 16px;
        letter-spacing: 0.2px;
        padding: 8px 14px;
        min-height: 40px;
        color: #fff;
        border-radius: 8px;
        transition: background 0.3s ease;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        position: relative;
        background: transparent;
        border: none;
        cursor: pointer;
        text-decoration: none;
        gap: 4px;
    }
    .site-header__nav-item-link::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -12px;
        height: 12px;
    }
    .site-header__nav-item-link:hover {
        background: rgba(255, 255, 255, 0.12);
    }
    .site-header__nav-item-link:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .site-header__nav-item-link .dropdown-arrow {
        font-size: 11px;
        transition: transform 0.3s ease;
        opacity: 0.7;
    }
    .site-header__nav-item:hover .site-header__nav-item-link .dropdown-arrow {
        transform: rotate(180deg);
        opacity: 1;
    }

    .site-header__nav-item.is-active .site-header__nav-item-link {
        font-weight: 600;
        color: #fff;
        background: transparent;
    }
    .site-header__nav-item.is-active .site-header__nav-item-link::before {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 4px;
        width: 42%;
        height: 2.5px;
        background: #ffffff;
        border-radius: 2px;
        box-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
        transform: translateX(-50%) scaleX(0);
        animation: underlineFade 0.45s ease forwards;
    }
    @keyframes underlineFade {
        0% { transform: translateX(-50%) scaleX(0); opacity: 0; }
        100% { transform: translateX(-50%) scaleX(1); opacity: 1; }
    }

    /* ============================================================
       全屏二级菜单
       ============================================================ */
    .nav-dropdown {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        width: 100%;
        padding: 15px 0px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        pointer-events: none;
        z-index: 100;
        background: #f5f5f5;
        box-shadow: 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    }
    .site-header__nav-item:hover > .nav-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-dropdown__inner {
        max-width: 1400px;
        margin: 0 auto;
        padding: 28px 20px 25px;
        max-height: 65vh;
        overflow-y: auto;
    }

    /* 外层滚动条 */
    .nav-dropdown__inner::-webkit-scrollbar {
        width: 3px;
    }
    .nav-dropdown__inner::-webkit-scrollbar-track {
        background: transparent;
    }
    .nav-dropdown__inner::-webkit-scrollbar-thumb {
        background: #d5dce6;
        border-radius: 3px;
    }
    .nav-dropdown__inner::-webkit-scrollbar-thumb:hover {
        background: var(--primary-color);
    }
    .nav-dropdown__inner {
        scrollbar-width: thin;
        scrollbar-color: #d5dce6 transparent;
    }

    /* ============================================================
       分类网格
       ============================================================ */
    .nav-dropdown__grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 50px 28px;
        align-items: start;
    }

    /* ============================================================
       每个分类块
       ============================================================ */
    .nav-dropdown__category {
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-width: 0;
    }

    .nav-dropdown__category-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--primary-color);
        text-decoration: none;
        padding-bottom: 8px;
        border-bottom: 2px solid var(--primary-color);
        transition: color 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: space-between;
        letter-spacing: 0.3px;
    }
    .nav-dropdown__category-title:hover {
        color: #002255;
    }
    .nav-dropdown__category-title .arrow {
        font-size: 12px;
        color: var(--primary-color);
        opacity: 0.25;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }
    .nav-dropdown__category-title:hover .arrow {
        transform: translateX(4px);
        opacity: 1;
    }

    /* ============================================================
       产品列表
       ============================================================ */
    .nav-dropdown__category-products {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .nav-dropdown__product-link {
        font-size: 14px;
        color: #222;
        text-decoration: none;
        padding: 4px 0 4px 5px;
        border-left: 2px solid transparent;
        transition: all 0.2s ease;
        line-height: 1.5;
        display: block;
        word-break: break-word;
        border-radius: 0 3px 3px 0;
    }
    .nav-dropdown__product-link:hover {
        color: var(--primary-color);
        border-left-color: var(--primary-color);
        padding-left: 10px;
        background: rgba(0, 48, 112, 0.04);
    }

    .nav-dropdown__product-link.hidden {
        display: none;
    }

    .nav-dropdown__empty-category {
        font-size: 13px;
        color: #bbb;
        padding: 4px 0 4px 10px;
        font-style: italic;
    }

    /* ============================================================
       展开按钮
       ============================================================ */
    .nav-dropdown__expand-btn {
        font-size: 12px;
        color: #666;
        background: transparent;
        border: none;
        border-top: 1px solid #f0f0f2;
        padding: 7px 0 3px 5px;
        cursor: pointer;
        transition: all 0.25s ease;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        margin-top: 4px;
    }
    .nav-dropdown__expand-btn:hover {
        color: var(--primary-color);
    }
    .nav-dropdown__expand-btn .expand-icon {
        font-size: 9px;
        display: inline-block;
    }

    /* ============================================================
       空状态
       ============================================================ */
    .nav-dropdown__empty {
        grid-column: 1 / -1;
        text-align: center;
        color: #bbb;
        padding: 40px 0;
        font-size: 14px;
    }

    /* ============================================================
       动画
       ============================================================ */
    @keyframes dropdownFadeIn {
        0% { opacity: 0; transform: translateY(-6px); }
        100% { opacity: 1; transform: translateY(0); }
    }
    .site-header__nav-item:hover .nav-dropdown .nav-dropdown__inner {
        animation: dropdownFadeIn 0.3s ease forwards;
    }

    /* ============================================================
       列数自适应
       ============================================================ */
    @media (min-width: 1200px) {
        .nav-dropdown__grid {
            grid-template-columns: repeat(5, 1fr);
            gap: 36px 58px;
        }
    }
    @media (min-width: 992px) and (max-width: 1199px) {
        .nav-dropdown__grid {
            grid-template-columns: repeat(4, 1fr);
            gap: 30px 24px;
        }
    }
    @media (min-width: 769px) and (max-width: 991px) {
        .nav-dropdown__grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 24px 20px;
        }
    }

    /* ============================================================
       WhatsApp 按钮
       ============================================================ */
    .header-whatsapp-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 34px;
        padding: 0 12px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        font-size: 14px;
        flex-shrink: 0;
        transition: all 0.28s ease;
        text-decoration: none;
        gap: 5px;
    }
    .header-whatsapp-btn:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 255, 255, 0.25);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
    .header-whatsapp-btn .btn-label {
        font-size: 12px;
        font-weight: 500;
    }
}


/* ============================================================
   移动端导航 (<769px)
   ============================================================ */
.site-header__hamburger {
    display: none;
}

@media (max-width: 768px) {
    .site-header__wrap {
        padding: 10px 0;
    }
    .site-header__logo-image {
        max-height: 30px;
    }
    .site-header.scrolled .site-header__logo-image {
        max-height: 28px;
    }

    .site-header__hamburger {
        display: block;
        border: none;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 6px;
        padding: 7px 9px;
        cursor: pointer;
        flex-shrink: 0;
        position: relative;
        z-index: 10001;
    }
    .site-header__hamburger .bar {
        display: block;
        width: 22px;
        height: 2px;
        margin: 5px auto;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 10px;
        transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .site-header__hamburger.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .site-header__hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .site-header__hamburger.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .site-header__main-nav {
        position: absolute;
        left: 0;
        top: 100%;
        width: 100%;
        background: #ffffff;
        z-index: 999;
        padding: 10px 12px 20px;
        box-sizing: border-box;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
        border-bottom: 3px solid var(--primary-color);
        overflow-y: auto;
        max-height: 70vh;
        display: none;
    }
    .site-header__main-nav.active-div {
        display: block;
    }

    .site-header__nav-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .site-header__nav-item {
        border-bottom: none;
        border-radius: 0;
        background: transparent;
    }

    .site-header__nav-item-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        font-size: 15px;
        font-weight: 500;
        color: #1e293b;
        text-decoration: none;
        border-left: 4px solid transparent;
        background: transparent;
        border-radius: 0;
        transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
        border: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
        gap: 8px;
    }
    .site-header__nav-item-link:hover,
    .site-header__nav-item-link:active {
        background: #f1f5f9;
        color: var(--primary-color);
        border-left-color: var(--primary-color);
    }
    .site-header__nav-item-link .dropdown-arrow {
        font-size: 12px;
        transition: transform 0.3s ease, color 0.3s ease;
        color: #bbb;
        flex-shrink: 0;
    }
    .site-header__nav-item-link .dropdown-arrow.rotated {
        transform: rotate(180deg);
        color: var(--primary-color);
    }

    .site-header__nav-item.is-active .site-header__nav-item-link {
        background: #f1f5f9;
        border-left: 4px solid var(--primary-color);
        color: var(--primary-color);
        font-weight: 600;
    }
    .site-header__nav-item.is-active .site-header__nav-item-link::before {
        display: none;
    }

    /* 移动端二级菜单 - 只显示分类 */
    .nav-dropdown {
        display: none;
        margin: 0;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        min-width: unset;
        border: none;
    }
    .nav-dropdown.nav-dropdown--open {
        display: block;
    }
    .nav-dropdown .nav-dropdown__inner {
        background: transparent;
        border-radius: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        position: static;
        max-width: 100%;
        margin: 0;
        max-height: none;
        overflow: visible;
    }

    .nav-dropdown__grid {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 4px 0;
    }

    .nav-dropdown__category {
        padding: 0;
        border-bottom: none;
    }
    .nav-dropdown__category:last-child {
        border-bottom: none;
    }

    .nav-dropdown__category-title {
        display: block;
        padding: 10px 16px 10px 28px;
        font-size: 14px;
        font-weight: 500;
        color: var(--primary-color);
        text-decoration: none;
        background: transparent;
        border-left: 3px solid transparent;
        transition: all 0.2s ease;
        border-bottom: none;
    }
    .nav-dropdown__category-title:hover {
        background: #f1f5f9;
        border-left-color: var(--primary-color);
    }
    .nav-dropdown__category-title .arrow {
        display: none;
    }

    .nav-dropdown__category-products {
        display: none;
    }

    .nav-dropdown__empty-category {
        display: none;
    }

    .header-whatsapp-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        height: 32px;
        padding: 0 10px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #fff;
        border-radius: 6px;
        font-size: 14px;
        flex-shrink: 0;
        text-decoration: none;
    }
    .header-whatsapp-btn .btn-label {
        display: none;
    }
}