/**
 * Baro Product Gallery - Optimized CSS
 * Version: 2.0 (Performance Optimized)
 */

.baro-product-gallery {
    max-width: 100%;
    margin: 0 auto;
}

.baro-gallery-main {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.baro-gallery-item {
    display: none;
}

.baro-gallery-item.slick-active {
    display: block;
}

.baro-main-image {
    width: 100%;
    height: auto;
    display: block;
}

.baro-video-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.baro-video-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
}

.baro-video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.baro-gallery-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.baro-thumbnail-item {
    width: 123px;
    height: 100px;
    margin: 0 7px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    padding: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.baro-thumbnail-item:hover {
    border-color: #ddd;
    border-radius: 10px;
}

.baro-thumbnail-item.active {
    border: 1px solid #dcdcdc;
    border-radius: 10px;
}

.baro-thumbnail-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.baro-thumbnail-img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
    border-radius: 5px;
}

.baro-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
    font-weight: bold;
}

.baro-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.baro-video-thumbnail:hover .baro-play-overlay {
    opacity: 1;
}

.baro-play-icon {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

/* Ensure Elementor lightbox doesn't interfere */
.baro-product-gallery a[data-fancybox] {
    pointer-events: auto !important;
}

/* Fancybox - Ensure images display at full size */
.fancybox__content {
    max-width: 90vw !important;
    max-height: 90vh !important;
    padding: 0 !important;
}

.fancybox__content img {
    max-width: 100% !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.fancybox__image {
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Responsive */
@media (max-width: 768px) {
    .baro-thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .baro-video-wrapper {
        height: 300px;
    }
    
    .baro-gallery-thumbnails {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .baro-thumbnail-item {
        width: 50px;
        height: 50px;
    }
    
    .baro-video-wrapper {
        height: 250px;
    }
    
    .baro-gallery-thumbnails {
        gap: 5px;
    }
}
