/* ====== 产品中心两级 Mega Menu（CMS 驱动） ====== */
.nav-menu > li.nav-product-item {
    z-index: 1002;
}

.nav-product-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 7px 13px !important;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-product-item .nav-product-trigger::after {
    display: none;
}

.nav-product-item:hover .nav-product-trigger,
.nav-product-item:focus-within .nav-product-trigger,
.nav-product-item.menu-open .nav-product-trigger {
    color: var(--primary);
    background: #fff2f1;
}

.nav-product-caret {
    width: 7px;
    height: 7px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.25s ease;
    opacity: 0.72;
}

.nav-product-item:hover .nav-product-caret,
.nav-product-item:focus-within .nav-product-caret {
    transform: rotate(-135deg) translateY(-1px);
}

.nav-mega {
    position: absolute;
    top: 100%;
    left: 0;
    width: 0;
    padding: 10px 0 0;
    transform: translateY(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 1001;
}

/* 鼠标从“产品中心”移向浮层的透明桥接带：
   nav-mega 自身 width:0 无法承接 hover，没有这条命中带时
   指针穿过 10px 间隙会立刻丢失 :hover 导致浮层关闭。 */
.nav-mega::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -120px;
    width: 880px;
    height: 16px;
    background: transparent;
}

/* 系列卡 → 右侧产品面板的桥接（防止子像素渲染出现纵向缝隙） */
.nav-mega-products::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -8px;
    width: 8px;
    background: transparent;
}

.nav-product-item:hover .nav-mega,
.nav-product-item:focus-within .nav-mega,
.nav-product-item.menu-open .nav-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-mega-panel {
    position: relative;
    display: block;
    width: 0;
    height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.nav-mega-series {
    position: absolute;
    top: 0;
    left: var(--series-left, 0px);
    flex: none;
    width: var(--series-card-width, 210px);
    padding: 8px;
    background: #fff;
    border: 1px solid rgba(225, 229, 236, 0.96);
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(15, 35, 75, 0.14);
    max-height: calc(100vh - 86px);
    overflow-y: auto;
}

.nav-series-tab {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font: inherit;
}

.nav-series-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    opacity: 0;
}

.nav-series-tab:hover,
.nav-series-tab.active {
    background: #fff4f3;
    box-shadow: none;
}

.nav-series-tab.active {
    color: var(--primary);
    font-weight: 700;
}

.nav-series-tab.active::before {
    opacity: 1;
}

.nav-series-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.nav-series-desc {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-series-arrow {
    flex: 0 0 auto;
    color: currentColor;
    opacity: 0.55;
    font-size: 18px;
    line-height: 1;
}

.nav-mega-products {
    position: absolute;
    top: 0;
    left: calc(var(--series-card-width, 210px) + var(--flyout-gap, 0px));
    width: 520px;
    min-width: 0;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid rgba(225, 229, 236, 0.96);
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(15, 35, 75, 0.14);
    max-height: calc(100vh - 86px);
    overflow-y: auto;
}

.nav-mega-series-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 13px;
    margin-bottom: 12px;
    border-bottom: 1px solid #edf0f6;
}

.nav-mega-series-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    color: var(--text-primary);
}

.nav-mega-series-link {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.nav-mega-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.nav-product-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #edf0f6;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.nav-product-link:hover {
    border-color: rgba(209, 57, 49, 0.28);
    background: #fffafa;
    box-shadow: 0 8px 22px rgba(209, 57, 49, 0.08);
    transform: translateY(-1px);
}

.nav-product-thumb {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    padding: 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f9fbff, #f2f5fa);
    object-fit: contain;
}

.nav-product-thumb--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: linear-gradient(135deg, #fff4f3, #f4f7fc);
    border: 1px solid #edf0f6;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.nav-product-copy {
    min-width: 0;
    flex: 1;
}

.nav-product-model {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-product-name {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-mega-loading,
.nav-mega-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    color: var(--text-light);
    font-size: 14px;
}

@media (max-width: 900px) {
    .nav-menu > li.nav-product-item {
        z-index: auto;
    }

    .nav-product-trigger {
        justify-content: center !important;
    }

    .nav-product-caret {
        transform: rotate(45deg) translateY(-2px);
    }

    .nav-product-item.mobile-open .nav-product-caret {
        transform: rotate(-135deg) translateY(-1px);
    }

    .nav-mega {
        position: static;
        width: 100%;
        padding: 0;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        display: none;
        max-height: none;
        overflow: visible;
    }

    .nav-mega::before,
    .nav-mega-products::before {
        display: none;
    }

    .nav-product-item.mobile-open .nav-mega {
        display: block;
    }

    .nav-mega-panel {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .nav-mega-series {
        position: static;
        flex: none;
        width: 100%;
        padding: 8px 12px;
        border: 0;
        border-bottom: 1px solid var(--border-light);
        border-radius: 0;
        background: #fff;
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }

    .nav-series-tab {
        padding: 10px 8px;
    }

    .nav-series-tab:hover,
    .nav-series-tab.active {
        box-shadow: none;
        background: #fff7f6;
    }

    .nav-mega-products {
        position: static;
        width: 100%;
        padding: 12px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        /* 限高内部滚动：避免某系列产品过多时把其他系列入口挤出屏幕（手机上像“只能看到一个系列”） */
        max-height: 46vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-mega-series-head {
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .nav-mega-product-grid {
        grid-template-columns: 1fr;
    }
}
