:root {
    --line: #e5ebf5;
}

body {
    background: #f6f8fc;
}

/* ========== 详情区 ========== */
.detail-section {
    padding: 20px 0 12px;
}

.detail-card {
    background: transparent;
    border: none;
    padding: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    gap: 22px;
}

/* ========== 画廊 ========== */
.gallery-stage {
    position: relative;
    overflow: visible;
}

.gallery-main {
    height: 490px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex: 1 1 auto;
}

    .gallery-main img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.zoom-lens {
    position: absolute;
    width: 130px;
    height: 130px;
    border: 1px solid rgba(255,255,255,.95);
    background: rgba(255,255,255,.28);
    box-shadow: 0 0 0 1px rgba(20,34,64,.2);
    pointer-events: none;
    display: none;
}

.zoom-pane {
    position: absolute;
    left: calc(100% + 22px);
    top: 0;
    width: 100%;
    height: 100%;
    border: 1px solid var(--line);
    background: #fff center/cover no-repeat;
    display: none;
    z-index: 5;
}

.thumbs-slider {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thumb-nav {
    width: 28px;
    height: 76px;
    border: 1px solid #d7dfed;
    background: #fff;
    color: #64748b;
    flex: 0 0 auto;
}

    .thumb-nav:hover {
        color: #ff4a2a;
        border-color: #ffb7aa;
        background: #fff7f5;
    }

.thumbs-viewport {
    overflow: hidden;
    flex: 1 1 auto;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

    .gallery-thumbs::-webkit-scrollbar {
        display: none;
    }

    .gallery-thumbs img {
        width: 76px;
        height: 76px;
        object-fit: cover;
        border: 1px solid #d7dfed;
        cursor: pointer;
        flex: 0 0 auto;
    }

        .gallery-thumbs img.active {
            border-color: #ff4a2a;
        }

/* ========== 视频项 ========== */
.gallery-thumbs .thumb-video {
    position: relative;
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border: 1px solid #d7dfed;
    background: #111;
    cursor: pointer;
    overflow: hidden;
}

    .gallery-thumbs .thumb-video.active {
        border-color: #ff4a2a;
    }

    .gallery-thumbs .thumb-video img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border: 0;
        cursor: pointer;
    }

    /* 向右播放三角图标（CSS border 实现） */
    .gallery-thumbs .thumb-video::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-left: 14px solid rgba(255, 255, 255, .92);
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        pointer-events: none;
    }

.video-player {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .video-player video,
    .video-player iframe {
        width: 100%;
        height: 100%;
        border: 0;
        object-fit: contain;
    }

/* 视频封面（主图区默认显示：封面图 + 居中播放三角） */
.video-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .video-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        pointer-events: none;
    }

.video-play-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, .45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

    .video-play-btn::after {
        content: '';
        width: 0;
        height: 0;
        margin-left: 4px;
        border-left: 22px solid rgba(255, 255, 255, .95);
        border-top: 13px solid transparent;
        border-bottom: 13px solid transparent;
    }

    .video-play-btn:hover {
        background: rgba(0, 0, 0, .6);
    }

/* ========== 产品信息 ========== */
.pd-title {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    color: #111827;
}

.pd-sub {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
    color: #e43f22;
}

.pd-price-head {
    background: var(--red-grad);
    color: #fff;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    white-space: normal;
    overflow-wrap: anywhere;
}

.pd-price-body {
    border: 1px solid var(--line);
    border-top: none;
    padding: 10px 12px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pd-price {
    font-size: 24px;
    color: #1c2746;
    font-weight: 800;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.pd-stock {
    color: #16a34a;
    font-weight: 700;
    font-size: 14px;
}

.pd-meta {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

    .pd-meta td {
        padding: 10px 4px;
        border-bottom: 1px solid #edf1f8;
        font-size: 14px;
    }

        .pd-meta td:first-child {
            width: 140px;
            color: #4b5563;
        }

        .pd-meta td:last-child {
            font-weight: 600;
            color: #111827;
        }

    .pd-meta .pd-group a {
        border: 1px solid #d8e0ee;
        background: #fff;
        color: #355e89;
        font-size: 13px;
        padding: 6px 12px;
        cursor: pointer;
        transition: all .2s ease;
        text-decoration: none;
        margin: 3px 15px 3px 0px;
        display: inline-grid;
    }

        .pd-meta .pd-group a:hover {
            background: #fff3ef;
            border-color: #ffc9bd;
            color: #e43f22;
        }

        .pd-meta .pd-group a.active {
            background: #198754;
            color: #fff;
            border-color: #198754;
        }

        .pd-meta .pd-group a.none {
            background: #f7f8fc;
            color: #c2c4cc;
            border-color: #d7dfed;
            cursor: default;
        }

.qty-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 16px;
}

.qty-label {
    width: 140px;
    color: #4b5563;
    font-size: 14px;
}

.qty-box {
    display: flex;
    border: 1px solid #d7dfed;
    height: 42px;
}

    .qty-box button {
        width: 38px;
        border: none;
        background: #f7f9fc;
        color: #374151;
    }

    .qty-box input {
        width: 68px;
        border: none;
        text-align: center;
        font-size: 16px;
    }

.pd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-buy, .btn-cart {
    height: 48px;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn-buy {
    background: #ff7a1a;
}

.btn-cart {
    background: #22b04b;
}

.btn-mini {
    width: 48px;
    height: 48px;
    border: 1px solid #d7dfed;
    background: #fff;
    color: #e43f22;
    font-size: 20px;
    transition: transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease;
}

.pd-actions .btn-buy:hover,
.pd-actions .btn-cart:hover {
    filter: brightness(1.20);
}

.pd-actions .btn-mini:hover {
    color: #ff4a2a;
    border-color: #ffb7aa;
    background: #fff7f5;
}

/* ========== 分享 ========== */
.share-wrap {
    position: relative;
    display: inline-block;
}

.share-dropdown {
    display: none;
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 0px;
    box-shadow: 0 6px 24px rgba(0,0,0,.15);
    padding: 15px;
    z-index: 100;
    white-space: nowrap;
}

.share-wrap:hover .share-dropdown {
    display: flex;
    gap: 15px;
}

.share-dropdown a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0px;
    font-size: 22px;
    color: #fff;
    text-decoration: none;
    transition: transform .18s ease, filter .18s ease;
}

    .share-dropdown a:hover {
        transform: scale(1.1);
        filter: brightness(1.15);
    }

.share-fb {
    background: #1877F2;
}

.share-tw {
    background: #000;
}

.share-wa {
    background: #25D366;
}

.share-em {
    background: #EA4335;
}

/* ========== 详情标签页 ========== */
.detail-tabs {
    margin-top: 16px;
    border: 1px solid #d7dfed;
    display: grid;
    grid-template-columns: repeat(4,1fr);
}

    .detail-tabs a {
        text-align: center;
        text-decoration: none;
        color: #374151;
        font-weight: 600;
        padding: 11px 8px;
        border-right: 1px solid #d7dfed;
    }

        .detail-tabs a:last-child {
            border-right: none;
        }

        .detail-tabs a.active {
            background: #1f2e57;
            color: #fff;
        }

.tab-panel {
    border: 1px solid #d7dfed;
    border-top: none;
    background: #fff;
    padding: 20px;
    display: none;
}

    .tab-panel.active {
        display: block;
    }

    .tab-panel img {
        max-width: 100%;
    }

    .tab-panel table {
        border: 1px solid #ddd;
        border-collapse: collapse;
    }

        .tab-panel table td, .tab-panel table th {
            border: 1px solid #ddd;
            padding: 5px 10px;
        }

.desc-panel {
    border: 1px solid #d7dfed;
    border-top: none;
    background: #fff;
    padding: 20px;
}

    .desc-panel h3 {
        margin: 0 0 10px;
        font-size: 24px;
    }

    .desc-panel p {
        margin: 0 0 8px;
        color: #374151;
        line-height: 1.7;
    }

/* ========== 相关产品 ========== */
.related-section {
    padding: 14px 0 26px;
}

.related-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

    .related-head h4 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
        color: #1c2746;
    }

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

    .related-products-grid .product-card {
        margin-bottom: 0;
    }

/* ========== 响应式 ========== */
/* ≥1200px */
@media (min-width: 1200px) { }

/* ≤991px (原 product.css max-width:992px 规则) */
@media (max-width: 991.98px) {
    .menu-bar .safe-container > ul {
        flex-wrap: wrap;
    }

    .menu-item > a {
        padding: 12px 12px;
    }

    .header-tools {
        display: none;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .gallery-stage {
        position: relative;
    }

    .gallery-main {
        height: 340px;
    }

    .zoom-pane, .zoom-lens {
        display: none !important;
    }

    .detail-tabs {
        grid-template-columns: repeat(2,1fr);
    }

    .allcat-dropdown {
        width: 100%;
    }

        .allcat-dropdown .category-flyout {
            position: static;
            width: 100%;
            box-shadow: none;
            display: none !important;
        }

    .related-products-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .pd-price-body {
        gap: 8px;
        flex-wrap: wrap;
    }

    .pd-price {
        font-size: 20px;
    }
}

/* ≥768px */
@media (min-width: 768px) { }

/* <768px */
@media (max-width: 767.98px) { }
