/**
 * Estilos frontend para Product Video Gallery
 * Compatible con Essential Addons for Elementor
 */

/* Contenedor del botón de play - Fijo en la esquina superior izquierda */
.pvg-play-button-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 150;
    pointer-events: auto;
}

.pvg-play-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    pointer-events: all;
    opacity: 0.9;
    display: block;
}

.pvg-play-button:hover {
    opacity: 1;
    transform: scale(1.15);
}

.pvg-play-button:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.pvg-play-button svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    display: block;
}

/* Asegurar que el contenedor principal tenga posición relativa */
.product_image_slider__container {
    position: relative !important;
}

.woocommerce-product-gallery__wrapper {
    position: relative !important;
}

.elementor-widget-woocommerce-product-images {
    position: relative !important;
}

/* Modal de video */
.pvg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.pvg-modal.active {
    display: block;
}

.pvg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.pvg-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    z-index: 1000000;
}

.pvg-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000001;
    transition: transform 0.2s ease;
}

.pvg-modal-close:hover {
    transform: scale(1.1);
}

.pvg-modal-close:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.pvg-video-container {
    position: relative;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.pvg-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Prevenir scroll cuando el modal está abierto */
body.pvg-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .pvg-play-button-container {
        top: 15px;
        left: 15px;
    }
    
    .pvg-modal-content {
        width: 95%;
    }
    
    .pvg-modal-close {
        top: -45px;
        right: -10px;
    }
    
    .pvg-play-button svg {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .pvg-play-button-container {
        top: 10px;
        left: 10px;
    }
    
    .pvg-play-button svg {
        width: 40px;
        height: 40px;
    }
    
    .pvg-modal-close svg {
        width: 25px;
        height: 25px;
    }
}