/* 产品详情页自定义样式 */
.product-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 图片展示区域 */
.product-gallery {
    position: relative;
    margin-bottom: 20px;
}

.main-image-container {
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #e5e7eb;
    position: relative;
    cursor: zoom-in;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

/* 放大镜效果 */
.zoom-lens {
    position: absolute;
    border: 1px solid #d4d4d4;
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.3);
    display: none;
    pointer-events: none;
    z-index: 10;
}

.zoom-result {
    position: absolute;
    top: 0;
    left: calc(100% + 20px);
    width: 400px;
    height: 400px;
    border: 1px solid #e5e7eb;
    background-color: white;
    background-repeat: no-repeat;
    display: none;
    z-index: 10;
    overflow: hidden;
}

.thumbnail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.thumbnail-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding: 10px 0;
    margin: 0 auto;
    height: 100px;
    /* 固定高度防止抖动 */
    align-items: center;
    /* 垂直居中 */
}

.thumbnail-container::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 80px;
    height: 80px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
    flex-shrink: 0;
    box-sizing: border-box;
    /* 确保边框不影响尺寸 */
}

.thumbnail.active {
    border-color: #ef4444;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-arrow {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    color: #6b7280;
    z-index: 2;
}

.nav-arrow:hover {
    color: #111827;
}

/* 产品信息区域 */
.product-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

.product-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.5;
}

.price-section {
    background-color: #f3f4f6;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.price-label {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.variants-section {
    margin: 20px 0;
}

.variants-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #111827;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-option {
    position: relative;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.variant-option.selected {
    border-color: #ef4444;
}

.variant-option.selected::after {
    content: "✓";
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.contact-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background-color: #111827;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
    position: relative;
}

.contact-btn:hover {
    background-color: #1f2937;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-container {
        flex-direction: column;
    }

    .main-image-container {
        height: 350px;
    }

    .product-title {
        font-size: 20px;
    }

    .product-subtitle {
        font-size: 14px;
    }

    .price-label {
        font-size: 16px;
    }

    .variants-title {
        font-size: 16px;
    }

    .contact-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* 移动端隐藏放大镜效果 */
    .zoom-lens,
    .zoom-result {
        display: none !important;
    }

    /* 修改移动端缩略图显示为3张 */
    .thumbnail-container {
        width: 240px; /* 3张缩略图宽度 + 间距 */
        overflow: hidden;
        justify-content: flex-start;
        gap: 10px;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }

    /* 隐藏所有缩略图，只显示当前组 */
    .thumbnail {
        display: none;
    }

    /* 显示当前组的3张缩略图 */
    .thumbnail.current-group {
        display: block;
    }
}

/* 添加到您的CSS文件中 */
.main-image-container img {
    transition: opacity 0.3s ease-in-out;
}

.thumbnail-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    transition: border-color 0.3s ease;
}