/* product-gallery.css - 优化图片渲染和动画性能 */
.product-gallery-section {
    width: 100%;
    padding: 50px 0;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    position: relative;
}

.product-gallery-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 0 60px;
}

.product-gallery-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 20px;
    padding: 10px 0;
    will-change: transform;
}

.product-gallery-item {
    flex: 0 0 auto;
    width: 200px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.product-gallery-item:hover {
    transform: translateY(-5px);
}

.product-gallery-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

@supports not (aspect-ratio: 1/1) {
    .product-gallery-image::before {
        content: '';
        display: block;
        padding-top: 100%;
    }
}

.product-gallery-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* 硬件加速，防止动画时模糊 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* 确保图片渲染质量 */
    image-rendering: auto;
}

.product-gallery-item:hover .product-gallery-image img {
    transform: scale(1.05) translateZ(0);
    -webkit-transform: scale(1.05) translateZ(0);
}

.product-overlay,
.product-quick-view,
.product-gallery-title {
    display: none !important;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #d1d5db;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-arrow:hover {
    background: #007cba;
    border-color: #007cba;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.gallery-arrow svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .product-gallery-container {
        padding: 0 50px;
    }
    
    .product-gallery-item {
        width: 150px;
    }
    
    .gallery-arrow {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .product-gallery-container {
        padding: 0 40px;
    }
    
    .product-gallery-item {
        width: 120px;
    }
    
    .gallery-arrow {
        width: 35px;
        height: 35px;
    }
}

.product-gallery-section.preview-mode {
    transition: all 0.3s ease;
}