/**
 * Product Videos - Frontend Styles
 * Transformer theme (St-themes) compatible
 */

/* ============================
   PLAY OVERLAY - GALERÍA PRINCIPAL
   ============================ */

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    transition: background 0.3s ease;
    cursor: pointer;
    z-index: 5;
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.35);
}

.play-btn {
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-btn svg {
    width: 36px;
    height: 36px;
    margin-left: 4px;
}

.video-play-overlay:hover .play-btn {
    background: rgba(47, 181, 210, 0.9);
    transform: scale(1.1);
}

/* ============================
   PLAY OVERLAY - MINIATURAS
   ============================ */

.video-play-overlay-thumb {
    background: rgba(0, 0, 0, 0.2);
}

.video-play-overlay-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

.play-btn-thumb {
    width: 28px;
    height: 28px;
}

.play-btn-thumb svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

/* Miniatura del video: mismas reglas que las fotos del producto */

/* Miniaturas: forzar mismo tamaño que las demás */
.product-video-thumb-slide img {
    width: 70px !important;
    height: 80px !important;
    object-fit: cover !important;
}

.product-video-thumb-slide .pro_gallery_thumb_box {
    position: relative;
    width: 70px;
    height: 80px;
    overflow: hidden;
}

/* ============================
   MODAL DE VIDEO
   ============================ */

.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.video-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-modal-content video {
    max-width: 90vw;
    max-height: 85vh;
    background: #000;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    pointer-events: auto;
}

.video-modal-content video::-webkit-media-controls-download-button {
    display: none !important;
}

.video-modal-content video::-webkit-media-controls-enclosure {
    overflow: hidden;
}

.video-modal-content video::-webkit-media-controls-overflow-button {
    display: none !important;
}

.video-modal-content video::-webkit-media-controls-picture-in-picture-button {
    display: none !important;
}

/* ============================
   MARCA DE AGUA
   ============================ */

.watermark-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px;
    pointer-events: none;
    z-index: 10;
    display: flex;
    overflow: hidden;
}

.watermark-layer .watermark-image {
    max-width: 40%;
    max-height: 30%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.watermark-layer.watermark-center { justify-content: center; align-items: center; }
.watermark-layer.watermark-top-left { justify-content: flex-start; align-items: flex-start; padding: 20px; }
.watermark-layer.watermark-top-right { justify-content: flex-end; align-items: flex-start; padding: 20px; }
.watermark-layer.watermark-bottom-left { justify-content: flex-start; align-items: flex-end; padding: 20px 20px 60px; }
.watermark-layer.watermark-bottom-right { justify-content: flex-end; align-items: flex-end; padding: 20px 20px 60px; }

.watermark-layer.watermark-tile {
    background-repeat: repeat;
    background-size: 150px auto;
    opacity: 0.15;
}

.watermark-layer.watermark-tile .watermark-image { display: none; }

/* ============================
   BOTÓN CERRAR
   ============================ */

.video-modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 20;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.video-modal-close svg {
    width: 22px;
    height: 22px;
    fill: white;
}

/* ============================
   LOADING
   ============================ */

.video-modal-overlay.loading .video-modal-content::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pv-spin 1s linear infinite;
    z-index: 5;
}

@keyframes pv-spin {
    to { transform: rotate(360deg); }
}

body.video-modal-open {
    overflow: hidden;
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
    .play-btn {
        width: 50px;
        height: 50px;
    }

    .play-btn svg {
        width: 26px;
        height: 26px;
    }

    .play-btn-thumb {
        width: 22px;
        height: 22px;
    }

    .play-btn-thumb svg {
        width: 12px;
        height: 12px;
    }

    .video-modal-content video {
        max-width: 95vw;
        max-height: 80vh;
    }

    .video-modal-close {
        top: -42px;
        right: 5px;
    }
}
