/* ==========================================================
 * BeljemiVideos - Estilos Front Office
 * ========================================================== */

/* Miniatura de vídeo (en la columna de thumbs del producto) */
.beljemi-video-slide.beljemi-video-thumb-wrap {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #000;
    display: block;
}

.beljemi-video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.beljemi-video-thumb-wrap:hover .beljemi-video-thumb-img {
    opacity: 0.85;
}

/* Icono de play sobre la miniatura */
.beljemi-video-thumb-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    pointer-events: none;
    transition: background 0.2s ease;
    z-index: 2;
}

.beljemi-video-thumb-wrap::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-35%, -50%);
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid #fff;
    z-index: 3;
    pointer-events: none;
}

.beljemi-video-thumb-wrap:hover::after {
    background: rgba(0, 0, 0, 0.85);
}

/* Etiqueta "VÍDEO" en la esquina */
.beljemi-video-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 4;
    pointer-events: none;
}

/* ==========================================================
 * Vídeo en el visor principal (lo grande de la derecha)
 * ========================================================== */
.beljemi-main-video {
    width: 100%;
    height: auto;
    max-height: 100%;
    background: #000;
    display: block;
    object-fit: contain;
    border-radius: inherit;
}

.product-cover .beljemi-main-video,
.images-container .beljemi-main-video {
    aspect-ratio: 1 / 1;
}

/* ==========================================================
 * Modal flotante (fallback si no se detecta visor)
 * ========================================================== */
.beljemi-video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: beljemiFadeIn 0.2s ease;
}

@keyframes beljemiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.beljemi-video-overlay-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
}

.beljemi-video-overlay-inner video {
    width: 100%;
    max-height: 90vh;
    display: block;
    background: #000;
}

.beljemi-video-overlay-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
}

.beljemi-video-overlay-close:hover {
    opacity: 0.7;
}

/* ==========================================================
 * Sección fallback (si no hay carrusel detectado)
 * ========================================================== */
.beljemi-videos-fallback {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.beljemi-videos-fallback h3 {
    margin-bottom: 16px;
}

.beljemi-videos-fallback-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.beljemi-videos-fallback-grid .beljemi-video-slide {
    border-radius: 4px;
    aspect-ratio: 1 / 1;
}

@media (max-width: 768px) {
    .beljemi-video-thumb-wrap::after {
        width: 28px;
        height: 28px;
    }
    .beljemi-video-thumb-wrap::before {
        border-top-width: 5px;
        border-bottom-width: 5px;
        border-left-width: 8px;
    }
}