.product-gallery-section {
    padding: 6rem 2rem;
    background: #fff8f3;
}

.product-slider {
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

.product-slider-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-snap-type: x mandatory;
    padding: 0 2rem;
    margin: 1rem 0;
}

.product-slider-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.product-slide {
    scroll-snap-align: center;
    flex: 0 0 380px;
    transition: transform 0.3s ease;
}

.product-card {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    aspect-ratio: 1/1;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
    transition: all 0.3s ease;
}

.slider-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow.prev {
    left: 15px;
}

.slider-arrow.next {
    right: 15px;
}

.slider-arrow i {
    color: #8B4513;
    font-size: 1.2rem;
}

/* Lightbox Styles */
.product-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: calc(100% - 30px);
    max-width: 900px;
    margin: auto;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.product-lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: transform 0.3s ease;
}

.close-lightbox:hover {
    transform: scale(1.1);
}

.close-lightbox i {
    color: #333;
    font-size: 1.2rem;
}

/* Responsive Design */
@media screen and (min-width: 1600px) {
    .product-slider-container {
        margin: 1rem calc(50% - 630px);
        padding: 0 2rem;
    }
}

@media screen and (min-width: 1200px) and (max-width: 1599px) {
    .product-slider-container {
        margin: 1rem calc(50% - 630px); /* Center 3 slides: (380px * 3 + 24px * 2) / 2 ≈ 630px */
        padding: 0 2rem;
    }
}

@media screen and (min-width: 768px) and (max-width: 1199px) {
    .product-slider-container {
        margin: 1rem calc(50% - 400px); /* Center 2 slides */
        padding: 0 2rem;
    }
}

@media screen and (max-width: 480px) {
    .product-gallery-section {
        padding: 4rem 0;
    }
    
    .product-slider-container {
        margin: 1rem 15px;
        gap: 1rem;
    }
    
    .product-slide {
        flex: 0 0 calc(100vw - 60px);
    }
    
    .slider-arrow {
        width: 35px;
        height: 35px;
    }
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(139, 69, 19, 0.3);
    border-top-color: #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
