/* Gallery Layout Fix - Horizontal Thumbnails */

/* Đảm bảo container chính có layout đúng */
.product-image-block {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-image-block .swiper-image {
    display: flex;
    flex-direction: column;
}

/* Gallery Top - Slide chính */
.gallery-top {
    order: 1;
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.gallery-top .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
}

.gallery-top .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Gallery Thumbs - Thumbnails ngang */
.gallery-thumbs {
    order: 2;
    width: 100%;
    height: 100px;
    padding: 10px 0;
    overflow: hidden;
}

.gallery-thumbs .swiper-wrapper {
    display: flex;
    align-items: center;
}

.gallery-thumbs .swiper-slide {
    width: auto !important;
    height: 80px;
    margin-right: 10px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumbs .swiper-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-thumbs .swiper-slide.swiper-slide-thumb-active {
    border-color: #22345d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.gallery-thumbs .swiper-slide img {
    width: auto;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Navigation buttons */
.gallery-top .swiper-button-next,
.gallery-top .swiper-button-prev {
    color: #007bff;
    background: rgb(127 116 116 / 90%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.gallery-top .swiper-button-next:hover,
.gallery-top .swiper-button-prev:hover {
    background: rgba(255,255,255,1);
    transform: scale(1.1);
}

.gallery-top .swiper-button-next::after,
.gallery-top .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Pagination */
.gallery-top .swiper-pagination {
    bottom: 15px;
}

.gallery-top .swiper-pagination-bullet {
    background: rgba(255,255,255,0.7);
    opacity: 1;
    transition: all 0.3s ease;
}

.gallery-top .swiper-pagination-bullet-active {
    background: #007bff;
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-top {
        height: 300px;
    }
    
    .gallery-thumbs {
        height: 80px;
    }
    
    .gallery-thumbs .swiper-slide {
        height: 60px;
        margin-right: 8px;
    }
    
    .gallery-top .swiper-button-next,
    .gallery-top .swiper-button-prev {
        width: 35px;
        height: 35px;
    }
    
    .gallery-top .swiper-button-next::after,
    .gallery-top .swiper-button-prev::after {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .product-image-block {
        padding: 10px;
    }
    
    .gallery-top {
        height: 216px;
    }
    
    .gallery-thumbs {
        height: 70px;
        padding: 5px 0;
    }
    
    .gallery-thumbs .swiper-slide {
        /* height: 50px; */
        margin-right: 6px;
    }

    .gallery-thumbs .swiper-slide img {
        padding: 0;
    }
}

/* Loading state */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #6c757d;
}

.gallery-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions */
.gallery-top .swiper-slide,
.gallery-thumbs .swiper-slide {
    transition: all 0.3s ease;
}

/* Fix for lightgallery integration */
#lightgallery .swiper-slide {
    cursor: zoom-in;
}

#lightgallery .swiper-slide:hover {
    opacity: 0.9;
}
