/* ==========================================================================
   1. 整体两列布局（核心升级）
   ========================================================================== */
.single-product-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 默认移动端：单列垂直排列 */
.product-main-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 桌面端：当屏幕宽度大于 768px 时自动变为两列 */
@media (min-width: 768px) {
    .product-main-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 50px; /* 左右两列的间距 */
    }

    /* 左列：产品图占 45% 宽度 */
    .chanpintu {
        flex: 0 0 45%;
        position: sticky;
        top: 20px; /* 滚动时左侧图片固定，体验极佳 */
    }

    /* 右列：描述与属性占剩余空间 */
    .product-info-tabs {
        flex: 1;
        min-width: 0; /* 防止内容撑破布局 */
    }
}

/* ==========================================================================
   2. 右侧描述与属性选项卡（Tabs）样式
   ========================================================================== */
.tabs-nav {
    display: flex;
    gap: 20px;
    border-bottom: 2px solid #eaeaea;
    margin-bottom: 20px;
    padding: 0;
    list-style: none;
}

.tab-btn {
    font-size: 18px;
    font-weight: bold;
    color: #888;
    background: none;
    border: none;
    padding: 10px 5px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.tab-btn:hover {
    color: #333;
}

/* 激活状态的标签样式 */
.tab-btn.active {
    color: #000;
}

/* 激活状态下的下划线 */
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
}

/* 选项卡内容区域控制 */
.tab-content-item {
    display: none; /* 默认隐藏所有内容 */
    animation: fadeIn 0.3s ease; /* 切换时的淡入动画 */
}

.tab-content-item.active {
    display: block; /* 只显示被激活的内容 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   3. 你原本的轮播图原生 CSS（保持原样，完美保留）
   ========================================================================== */
.native-gallery-slider {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    user-select: none;
}
.slider-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f5f5f5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.slider-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}
.slider-item {
    min-width: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.slider-btn:hover { background: #fff; }
.slider-btn-prev { left: 10px; }
.slider-btn-next { right: 10px; }
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}
.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.2s;
}
.slider-dot.active { background: #333; }

/* 手机端吸附与滚动支持 */
.slider-viewport {
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.slider-viewport::-webkit-scrollbar { display: none; }
.slider-item {
    flex: 0 0 100%;
    scroll-snap-align: start;
}
