/* ===== 产品详情布局 ===== */
.product-detail-wrap {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 20px;
}
.product-gallery {
    flex: 0 0 45%;
}
.product-info {
    flex: 1;
}
.product-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}
.product-sub-title {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 15px;
}
.product-description {
    font-size: 1rem;
    color: #444;
    line-height: 1.8;
    margin-bottom: 20px;
}
.product-param {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}
.product-param-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}
.product-param-content {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.8;
}
.product-param-content a{
    text-decoration: none;
    color:var(--theme-color);
    font-weight: 500;
}
.product-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.btn-quote {
    padding: 10px 30px;
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}
.btn-quote:hover {
    opacity: 0.9;
}
.btn-back {
    padding: 10px 30px;
    background: #9ea5ab;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}
.btn-back:hover {
    background: #6c757d;
    color: #fff;
}
.btn-qrcode-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.btn-qrcode-wrap .qrcode-popup {
    position: absolute;
    bottom: 100%;              /* ★ 紧贴按钮顶部 */
    margin-bottom: 10px;       /* ★ 视觉间距用 margin */
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    z-index: 100;
    border: 1px solid #eee;
    min-width: 170px;
    text-align: center;
}
.btn-qrcode-wrap .qrcode-popup::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -14px;             /* 往下延伸 14px */
    height: 14px;
    background: transparent;
    pointer-events: auto;
}
.btn-qrcode-wrap .qrcode-popup img {
    max-width: 150px;
    max-height: 150px;
}
.btn-qrcode-wrap:hover .qrcode-popup {
    display: block;
}
.btn-outline-secondary{
    border-radius:20px;
    padding:10px 20px;
}
/* ===== 产品详情内容 ===== */
.product-detail-content {
    margin-top: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 20px;
}
.product-detail-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
}
.product-detail-content h2 i {
    padding-right: 10px;
}
.product-detail-content .detail-body {
    font-size: 1rem;
    color: #444;
    line-height: 1.9;
}
.product-detail-content .detail-body img {
    max-width: 100%;
    height: auto;
}
.product-detail-content .detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.product-detail-content .detail-body table td,
.product-detail-content .detail-body table th {
    border: 1px solid #ddd;
    padding: 8px 12px;
}

/* ===== 主图画廊 ===== */
.gallery-wrapper {
    position: relative;
    width: 100%;
}
.gallery-main {
    position: relative;
    width: 100%;
    /* 固定纵横比，保证推拉时高度不跳 */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: #f8f8f8;
    border: 1px solid #f0f0f0;
}

/* 主图/视频：填满容器 */
.gallery-main > #mainMedia,
.gallery-main > img,
.gallery-main > video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== 滑动轨道（推拉切换） ===== */
.gallery-main .slide-track {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    width: 200%;
    height: 100%;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.gallery-main .slide {
    flex: 0 0 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    overflow: hidden;
}

.gallery-main .slide img,
.gallery-main .slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== 导航按钮 ===== */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    border: none;
    cursor: pointer;
    /* 关键：不要用 all，只过渡颜色和背景 */
    transition: background 0.3s ease, color 0.3s ease;
    z-index: 10;
    font-size: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-nav-btn:hover {
    background: var(--theme-color);
    color: #fff;
}
.gallery-nav-btn.prev-btn {
    left: 10px;
}
.gallery-nav-btn.next-btn {
    right: 10px;
}

/* ===== 指示器 ===== */
.media-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.4);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    border: 1px solid #fff;
    font-size: 0.8rem;
    z-index: 10;
    pointer-events: none;
}

/* ===== 缩略图区域（最多显示4个，超出显示箭头） ===== */
.gallery-thumbs-wrapper {
    position: relative;
    margin-top: 12px;
    overflow: hidden;
    padding: 0 30px;
}
.gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow: hidden;
    scroll-behavior: smooth;
    padding: 4px 0;
}
.gallery-thumbs .thumb-item {
    flex: 0 0 calc(25% - 7.5px);
    min-width: calc(25% - 7.5px);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
    background: #f8f8f8;
    position: relative;
}
.gallery-thumbs .thumb-item.active {
    border-color: var(--theme-color);
}
.gallery-thumbs .thumb-item:hover {
    border-color: var(--theme-color);
}
.gallery-thumbs .thumb-item img,
.gallery-thumbs .thumb-item video {
    width: 100%;
    height: auto;
    object-fit: cover;
}
.gallery-thumbs .thumb-item .thumb-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.4rem;
    text-shadow: 0 0 8px rgba(0,0,0,0.6);
    pointer-events: none;
}
.thumb-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.thumb-scroll-btn:hover {
    background: var(--theme-color);
    color: #fff;
    border-color: var(--theme-color);
}
.thumb-scroll-prev {
    left: 0;
}
.thumb-scroll-next {
    right: 0;
}
.thumb-scroll-btn.hidden {
    display: none !important;
}
/* ===== 响应式 ===== */
@media(max-width:1200px){

    .recommend-item {
        flex: 0 0 calc(25% - 12px);
        min-width: calc(25% - 12px);
    }
}
@media(max-width:992px){
    .product-detail-wrap {
        flex-direction: column;
    }
    .product-gallery {
        flex: 1;
    }
    .gallery-main {
        height: 320px;
    }
    .recommend-item {
        flex: 0 0 calc(33.33% - 11px);
        min-width: calc(33.33% - 11px);
    }
}
@media(max-width:768px){
    .main-container {
        width: 100% !important;
        padding: 0px !important;
    }
    .product-detail-wrap{
        margin-top: 0px;
        gap: 0px;
        padding: 0px;
        background:none;
    }
    .page-banner {
        height: 220px;
        display: none;
    }
    .product-info{
        padding: 15px;
        background: #fff;
    }
    .product-param {
        background: #f5f5f5;
    }
    .product-detail-content{
        margin-top: 15px;
        padding: 15px;
        background: fff;
        border-radius: 0px;
    }  
    .btn-outline-secondary{
        border-radius:20px;
        padding:10px 20px;
    }
    .product-title {
        font-size: 1.4rem;
    }
    .gallery-main {
        height: auto;
        position: relative;
        width: 100%;
        overflow: hidden;
        border-radius: 0px;
        background: #f8f8f8;
        border: 1px solid #f0f0f0;
    }
    .product-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-quote, .btn-back {
        text-align: center;
    }
    /* 二维码不占整行 */
    .btn-qrcode-wrap {
        align-self: flex-start;
        width: auto;
        display: inline-block;
    }
    .btn-qrcode-wrap .qrcode-popup {
        left: 0;
        transform: translateX(0);
    }
    .gallery-thumbs-wrapper {
        padding: 0 20px;
    }
    .gallery-thumbs .thumb-item {
        flex: 0 0 calc(25% - 7.5px);
        min-width: calc(25% - 7.5px);
    }
}