/* ==========================================================================
   POPUP CON VIDEO
   Se muestra sobre la página, centrado, y en móvil ocupa casi todo el ancho.
   ========================================================================== */

.popup-video {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.popup-video.is-visible {
    display: flex;
}

.popup-video__fondo {
    position: absolute;
    inset: 0;
    background: rgba(6, 20, 40, .78);
    backdrop-filter: blur(2px);
}

.popup-video__caja {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    animation: popup-entrada .25s ease-out;
}

@keyframes popup-entrada {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.popup-video__cerrar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s ease;
}

.popup-video__cerrar:hover {
    background: rgba(0, 0, 0, .8);
}

/* Área del video: 16/9 sin saltos de maquetación */
.popup-video__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0b1b30;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.popup-video__media:empty {
    display: none;
}

.popup-video__iframe,
.popup-video__archivo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.popup-video__cuerpo {
    padding: 24px;
}

.popup-video__titulo {
    margin: 0 0 10px;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.25;
    color: #0a4c98;
}

.popup-video__texto {
    margin: 0 0 18px;
    font-size: .98rem;
    line-height: 1.6;
    color: #444;
}

.popup-video__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

/* La página no debe moverse detrás del popup */
body.popup-video-abierto {
    overflow: hidden;
}

@media (max-width: 640px) {
    .popup-video {
        padding: 10px;
    }

    .popup-video__caja {
        max-height: calc(100vh - 20px);
        border-radius: 14px;
    }

    .popup-video__media {
        border-radius: 14px 14px 0 0;
    }

    .popup-video__cuerpo {
        padding: 18px 16px 22px;
    }

    .popup-video__titulo {
        font-size: 1.15rem;
    }

    .popup-video__cta {
        width: 100%;
    }
}

/* ---------- Botones del popup ---------- */
.popup-video__botones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.popup-video__cta--secundario {
    background: transparent;
}

/* ---------- Activar sonido ---------- */
/* El autoplay solo funciona en silencio, así que se ofrece la vuelta atrás. */
.popup-video__sonido {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 24, 44, .82);
    color: #fff;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .15s ease;
}

.popup-video__sonido:hover {
    background: rgba(10, 24, 44, .95);
}

.popup-video__sonido[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .popup-video__botones {
        flex-direction: column;
        align-items: stretch;
    }

    .popup-video__sonido {
        left: 10px;
        bottom: 10px;
        font-size: .78rem;
        padding: 8px 12px;
    }
}
