.flatsome-gallery {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.flatsome-gallery-main {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.main-swiper {
    position: relative;
}

.main-swiper .swiper-slide {
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.gallery-image {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    text-align: center;
}

.image-title {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.image-caption {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Swiper Navigation Buttons */
.main-swiper .swiper-button-next,
.main-swiper .swiper-button-prev {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.main-swiper .swiper-button-next:hover,
.main-swiper .swiper-button-prev:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.main-swiper .swiper-button-next::after,
.main-swiper .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

/* Thumbnails */
.flatsome-gallery-thumbnails {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.thumbnail-swiper {
    padding: 10px 0;
}

.thumbnail-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    opacity: 0.6;
}

.thumbnail-item:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.thumbnail-item.active {
    opacity: 1;
    border-color: #3b82f6;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ux-gallery {
        margin: 0 10px;
    }
    
    .main-swiper .swiper-slide {
        min-height: 300px;
    }
    
    .image-title {
        font-size: 1.25rem;
    }
    
    .image-caption {
        font-size: 0.9rem;
    }
    
    .main-swiper .swiper-button-next,
    .main-swiper .swiper-button-prev {
        width: 36px;
        height: 36px;
    }
    
    .main-swiper .swiper-button-next::after,
    .main-swiper .swiper-button-prev::after {
        font-size: 14px;
    }
    
    .thumbnail-item img {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .main-swiper .swiper-slide {
        min-height: 250px;
    }
    
    .image-info {
        padding: 15px;
    }
    
    .image-title {
        font-size: 1.1rem;
    }
    
    .image-caption {
        font-size: 0.85rem;
    }
    
    .ux-gallery-thumbnails {
        padding: 15px;
    }
}

/* Loading States */
.ux-gallery.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ux-gallery.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility */
.ux-gallery .swiper-button-next:focus,
.ux-gallery .swiper-button-prev:focus,
.ux-gallery .thumbnail-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ux-gallery {
        border: 2px solid #000;
    }
    
    .image-info {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .thumbnail-item.active {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ux-gallery * {
        transition: none !important;
        animation: none !important;
    }
    
    .thumbnail-item:hover {
        transform: none;
    }
}
