/* Estilo para las miniaturas de video en la galería */
.wpvg-video-thumb {
    position: relative;
    cursor: pointer !important;
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
}

/* Asegurar que las imágenes de video tengan el mismo tamaño que las fotos */
.wpvg-video-thumb img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
}

/* Para listas de flexslider */
.flex-control-thumbs .wpvg-video-thumb,
.flex-control-nav .wpvg-video-thumb {
    float: left !important;
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    cursor: pointer !important;
}

.flex-control-thumbs .wpvg-video-thumb img,
.flex-control-nav .wpvg-video-thumb img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    opacity: 0.7;
    cursor: pointer;
    object-fit: cover !important;
}

.flex-control-thumbs .wpvg-video-thumb:hover img,
.flex-control-thumbs .wpvg-video-thumb.flex-active img,
.flex-control-nav .wpvg-video-thumb:hover img,
.flex-control-nav .wpvg-video-thumb.flex-active img {
    opacity: 1;
}

/* Para galerías tipo DIV */
.woocommerce-product-gallery__image.wpvg-video-thumb {
    float: left !important;
    width: auto !important;
}

.woocommerce-product-gallery__image.wpvg-video-thumb a {
    display: block;
    position: relative;
}

.woocommerce-product-gallery__image.wpvg-video-thumb img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Icono de play sobre la miniatura */
.wpvg-play-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
    pointer-events: none !important;
    padding-left: 3px !important;
    z-index: 2 !important;
}

.wpvg-video-thumb:hover .wpvg-play-icon {
    background: rgba(255, 0, 0, 0.9) !important;
    transform: translate(-50%, -50%) scale(1.15) !important;
}

/* Play icon en miniaturas pequeñas de flexslider */
.flex-control-thumbs .wpvg-play-icon,
.flex-control-nav .wpvg-play-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 14px !important;
}

/* Modal para videos */
.wpvg-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wpvg-modal-content {
    position: relative;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
}

.wpvg-video-container {
    background: #000;
    position: relative;
}

.wpvg-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

.wpvg-close:hover,
.wpvg-close:focus {
    color: #ff0000;
}

/* Prevenir scroll cuando el modal está abierto */
body.wpvg-modal-open {
    overflow: hidden;
}

/* Estilos deprecados pero mantenidos para compatibilidad */
.wpvg-video-slide {
    position: relative;
}

.wpvg-video-trigger {
    display: block;
    position: relative;
    cursor: pointer;
}

.wpvg-video-trigger img {
    display: block;
    width: 100%;
    height: auto;
}

.wpvg-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.wpvg-video-trigger:hover .wpvg-play-button {
    background: rgba(255, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .wpvg-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .wpvg-play-icon {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    .flex-control-thumbs .wpvg-play-icon,
    .flex-control-nav .wpvg-play-icon {
        width: 25px !important;
        height: 25px !important;
        font-size: 12px !important;
    }
    
    .wpvg-video-container iframe {
        height: 300px !important;
    }
}
