/* ==========================================================================
   POPUPS - Grael
   Se usa en todo el sitio y en el blog (html tiene font-size 62.5% => 1rem = 10px)
   ========================================================================== */

.popup {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.popup[hidden] {
    display: none;
}

.popup__fondo {
    position: absolute;
    inset: 0;
    background: rgba(8, 28, 48, .78);
    backdrop-filter: blur(2px);
}

.popup__caja {
    position: relative;
    background: var(--color-blanco, #fff);
    border-radius: 1.8rem;
    width: min(84rem, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem 3rem 3.4rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    animation: popup-entrada .28s ease;
}

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

.popup__cerrar {
    position: absolute;
    top: 1.2rem;
    right: 1.4rem;
    width: 3.6rem;
    height: 3.6rem;
    font-size: 2.6rem;
    line-height: 1;
    color: var(--color-parrafo, #515151);
    background: #f1f3f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.popup__cerrar:hover {
    background: var(--color-principal, #2B6AA8);
    color: #fff;
}

.popup__titulo {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--color-principal, #2B6AA8);
    line-height: 1.25;
    margin: 0 0 1.8rem;
    padding-right: 4rem;
}

/* --- Video responsivo 16:9 --- */
.popup__video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 1.2rem;
    overflow: hidden;
    background: #000;
}

.popup__player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.popup__imagen {
    width: 100%;
    border-radius: 1.2rem;
    display: block;
}

.popup__html {
    font-size: 1.6rem;
    line-height: 1.7;
    color: var(--color-parrafo, #515151);
}

.popup__texto {
    font-size: 1.6rem;
    line-height: 1.7;
    color: var(--color-parrafo, #515151);
    margin: 1.8rem 0 0;
}

.popup__boton {
    display: inline-block;
    margin-top: 2.2rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-principal, #2B6AA8);
    padding: 1.3rem 3.2rem;
    border-radius: 3rem;
    text-decoration: none;
    transition: background .2s, transform .2s;
}

.popup__boton:hover {
    background: var(--color-celeste, #45A6D1);
    color: #fff;
    transform: translateY(-2px);
}

/* Bloquea el scroll del fondo mientras hay un popup abierto */
body.popup-abierto {
    overflow: hidden;
}

@media (max-width: 600px) {
    .popup {
        padding: 1rem;
    }

    .popup__caja {
        padding: 2.4rem 1.8rem 2.8rem;
        border-radius: 1.4rem;
    }

    .popup__titulo {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .popup__caja {
        animation: none;
    }

    .popup__boton:hover {
        transform: none;
    }
}
