/* ======================================
   WooCommerce Variation Gallery Pro - Frontend CSS
   ====================================== */

/* Container Principal */
.wvgp-product-gallery {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Galeria Principal */
.wvgp-main-gallery {
    position: relative;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.wvgp-gallery-swiper {
    width: 100%;
    height: auto;
    min-height: 400px;
}

.wvgp-gallery-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    width: 100% !important;
    height: 100% !important;
}

/* Wrapper de Imagem */
.wvgp-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.wvgp-main-image {
    width: 100%;
    height: 100%;
    min-height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer;
}

/* Zoom habilitado */
.wvgp-zoom-enabled .wvgp-main-image:hover {
    transform: scale(1.2);
}

/* Ícone de Zoom */
.wvgp-zoom-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.wvgp-image-wrapper:hover .wvgp-zoom-icon {
    opacity: 1;
}

.wvgp-zoom-icon svg {
    width: 20px;
    height: 20px;
}

/* Paginação */
.wvgp-gallery-swiper .swiper-pagination {
    bottom: 10px;
}

.wvgp-gallery-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #fff;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.wvgp-gallery-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    width: 24px;
    border-radius: 4px;
}

/* Miniaturas */
.wvgp-thumbnails {
    margin-top: 15px;
}

.wvgp-thumbs-swiper {
    width: 100%;
    padding: 5px 0;
}

.wvgp-thumbs-swiper .swiper-slide {
    width: 25%;
    height: auto;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wvgp-thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
}

.wvgp-thumb-wrapper {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
}

.wvgp-thumbs-swiper .swiper-slide:hover .wvgp-thumb-wrapper {
    border-color: #ddd;
    transform: scale(1.05);
}

.wvgp-thumbs-swiper .swiper-slide-thumb-active .wvgp-thumb-wrapper {
    border-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wvgp-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Loading Overlay */
.wvgp-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.wvgp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: wvgp-spin 1s linear infinite;
}

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

/* Animação de Atualização */
.wvgp-updating {
    animation: wvgp-fade-pulse 0.3s ease;
}

@keyframes wvgp-fade-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* Responsivo */
@media screen and (max-width: 768px) {
    .wvgp-product-gallery {
        max-width: 100%;
        padding: 0;
    }
    
    .wvgp-main-gallery {
        border-radius: 12px;
    }
    
    /* Garante que imagem ocupe todo espaço no mobile */
    .wvgp-gallery-swiper {
        width: 100%;
        height: auto;
        min-height: 350px;
    }
    
    .wvgp-gallery-swiper .swiper-slide {
        width: 100% !important;
        height: 100% !important;
    }
    
    .wvgp-image-wrapper {
        width: 100%;
        height: 100%;
        min-height: 350px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #fff;
    }
    
    .wvgp-main-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 350px;
        object-fit: cover !important;
        display: block !important;
    }
    
    .wvgp-thumbnails {
        margin-top: 10px;
    }
}


/* Integração com WooCommerce */
.woocommerce div.product div.images {
    float: none;
    width: 100%;
    margin-bottom: 30px;
}

/* Esconde galeria padrão quando o plugin está ativo */
.wvgp-active .woocommerce-product-gallery {
    display: none;
}

/* Estilo para seletor de variações */
.variations_form .variations {
    margin-bottom: 20px;
}

.variations_form .variations select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.variations_form .variations select:focus {
    border-color: #333;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Slider de Tamanhos (Opcional) */
.wvgp-size-slider {
    margin: 20px 0;
}

.wvgp-size-slider .swiper-slide {
    width: auto !important;
}

.wvgp-size-option {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.wvgp-size-option:hover {
    border-color: #333;
    background: #f8f9fa;
}

.wvgp-size-option.active {
    border-color: #333;
    background: #333;
    color: #fff;
}

.wvgp-size-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Transições suaves */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wvgp-product-gallery * {
    box-sizing: border-box;
}

@media screen and (max-width: 480px) {
    .wvgp-product-gallery {
        padding: 0;
        margin: 0 auto;
    }
    
    .wvgp-main-gallery {
        border-radius: 12px;
    }
    
    .wvgp-gallery-swiper {
        width: 100%;
        min-height: 320px;
    }
    
    .wvgp-image-wrapper {
        min-height: 320px;
    }
    
    .wvgp-main-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 320px;
        object-fit: cover !important;
    }
    
    .wvgp-gallery-swiper .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
    }
    
    .wvgp-gallery-swiper .swiper-pagination-bullet-active {
        width: 20px;
    }
}

/* === LIGHTBOX SIMPLES === */
#wvgp-simple-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

#wvgp-simple-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

#wvgp-simple-lightbox .wvgp-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000000;
    transition: all 0.3s ease;
}

#wvgp-simple-lightbox .wvgp-close:hover {
    color: #ccc;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    #wvgp-simple-lightbox img {
        max-width: 95%;
        max-height: 85vh;
    }
    
    #wvgp-simple-lightbox .wvgp-close {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }
}
