/* ============================================================
   Popup (.mp-popup) — ÚNICO popup del sitio Multiplex, componente
   independiente y reutilizable.

   El markup NO va en ninguna vista: lo crea y lo abre
   js/multiplex/popup-confirmacion.js (window.mpPopup.open), que lo
   cuelga directo de <body>. No depende del drawer de compra ni de
   su modal (#dcModal de _DrawerCompra.cshtml).

   Dos ejes independientes, ambos como modificador del raíz:

   · Tipo (color de la barra superior, del ícono y del botón principal)
       .mp-popup--warning  ámbar — Figma Multiplex-WEB node-id=1227-33033
       .mp-popup--error    rojo  — Figma Multiplex-WEB node-id=792-22794
       .mp-popup--success  verde — sin Figma: mismos tonos de la paleta
                                   del diseño, en verde

   · Layout
       .mp-popup--center   384px, todo centrado, ícono en disco
                           (node 1227-33033). Botón principal arriba.
       .mp-popup--side     448px, ícono cuadrado a la izquierda del
                           título, botón de cerrar (node 792-22794).
                           Botón principal abajo.

   Piezas opcionales: ícono, texto, ficha (póster + título de la
   película + filas de datos), aviso ámbar, nota y botón secundario.
   Preview: PreviewsHTML/multiplex-popup-confirmacion.html.
   ============================================================ */

.tema-multiplex .mp-popup {
    /* Tipo por defecto: warning (ámbar) */
    --mp-popup-bar: linear-gradient(to right, #e17100, #ffb900 50%, #e17100);
    --mp-popup-accent: #ffb900;
    --mp-popup-tint: rgba(254, 154, 0, 0.15);
    --mp-popup-tint-border: rgba(254, 154, 0, 0.3);
    --mp-popup-btn: #fe9a00;
    --mp-popup-btn-hover: #ffb900;
    --mp-popup-btn-border: #f91f2a;
    --mp-popup-btn-text: #000000;
    position: fixed;
    inset: 0;
    /* Por encima del header del sitio (1051) y de los modales del drawer (hasta 1611). */
    z-index: 1700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s ease;
}

.tema-multiplex .mp-popup--error {
    --mp-popup-bar: linear-gradient(to right, #e50611, #ff6467 50%, #e50611);
    --mp-popup-accent: #e50611;
    --mp-popup-tint: rgba(229, 6, 17, 0.15);
    --mp-popup-tint-border: rgba(229, 6, 17, 0.25);
    --mp-popup-btn: #e50611;
    --mp-popup-btn-hover: #c90510;
    --mp-popup-btn-border: #f91f2a;
    --mp-popup-btn-text: #ffffff;
}

.tema-multiplex .mp-popup--success {
    --mp-popup-bar: linear-gradient(to right, #00a63e, #05df72 50%, #00a63e);
    --mp-popup-accent: #05df72;
    --mp-popup-tint: rgba(0, 201, 80, 0.15);
    --mp-popup-tint-border: rgba(0, 201, 80, 0.25);
    --mp-popup-btn: #00a63e;
    --mp-popup-btn-hover: #008236;
    --mp-popup-btn-border: #00c950;
    --mp-popup-btn-text: #ffffff;
}

.tema-multiplex .mp-popup[hidden] {
    display: none;
}

.tema-multiplex .mp-popup.is-open {
    opacity: 1;
}

.tema-multiplex .mp-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(7px);
}

.tema-multiplex .mp-popup__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 384px;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    padding: 36px 32px 32px;
    font-family: 'Montserrat', sans-serif !important;
    text-align: center;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(.96);
    transition: transform .2s ease;
}

    .tema-multiplex .mp-popup__dialog > * {
        flex-shrink: 0;
    }

    /* Barra superior degradada */
    .tema-multiplex .mp-popup__dialog::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--mp-popup-bar);
    }

.tema-multiplex .mp-popup.is-open .mp-popup__dialog {
    transform: scale(1);
}

/* --- Botón de cerrar (opcional; por defecto solo en el layout "side") --- */
.tema-multiplex .mp-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6) !important;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

    .tema-multiplex .mp-popup__close:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff !important;
    }

    .tema-multiplex .mp-popup__close svg {
        display: block;
        width: 16px;
        height: 16px;
    }

/* --- Encabezado: ícono (opcional) + título + texto (opcional) --- */
.tema-multiplex .mp-popup__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 21px;
}

.tema-multiplex .mp-popup__head-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.tema-multiplex .mp-popup__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--mp-popup-tint);
    border: 1px solid var(--mp-popup-tint-border);
    color: var(--mp-popup-accent) !important;
}

    .tema-multiplex .mp-popup__icon svg {
        display: block;
        width: 32px;
        height: 32px;
    }

.tema-multiplex .mp-popup__title {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 400;
    font-size: 28px;
    line-height: 36.4px;
    letter-spacing: 0.7px;
    color: #ffffff !important;
    margin: 0;
    overflow-wrap: anywhere;
}

.tema-multiplex .mp-popup__text {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px;
    line-height: 26px;
    color: rgba(255, 255, 255, 0.5) !important;
    margin: 0;
}

/* Formato mínimo dentro de text / alert / note (links y énfasis). */
.tema-multiplex .mp-popup__text a,
.tema-multiplex .mp-popup__alert a,
.tema-multiplex .mp-popup__note a {
    font-family: inherit !important;
    color: #ffffff !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

    .tema-multiplex .mp-popup__text a:hover,
    .tema-multiplex .mp-popup__alert a:hover,
    .tema-multiplex .mp-popup__note a:hover {
        color: var(--mp-popup-accent) !important;
    }

.tema-multiplex .mp-popup__text strong,
.tema-multiplex .mp-popup__text b {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* --- Ficha (opcional): película + filas de datos --- */
.tema-multiplex .mp-popup__card {
    margin-top: 4px;
    padding: 0 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.tema-multiplex .mp-popup__movie {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
}

.tema-multiplex .mp-popup__poster {
    flex: 0 0 56px;
    width: 56px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.55);
}

.tema-multiplex .mp-popup__movie-title {
    min-width: 0;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: 0.45px;
    color: #ffffff !important;
    overflow-wrap: anywhere;
}

.tema-multiplex .mp-popup__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px;
    line-height: 22.5px;
}

    .tema-multiplex .mp-popup__movie + .mp-popup__row,
    .tema-multiplex .mp-popup__row + .mp-popup__row {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

.tema-multiplex .mp-popup__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5) !important;
}

    .tema-multiplex .mp-popup__label svg {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        color: var(--mp-popup-accent) !important;
    }

.tema-multiplex .mp-popup__value {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500;
    text-align: right;
    color: #ffffff !important;
}

/* --- Aviso (opcional): recuadro ámbar, igual en todos los tipos --- */
.tema-multiplex .mp-popup__alert {
    margin: 0;
    padding: 12px 16px;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px;
    line-height: 24.38px;
    text-align: left;
    color: rgba(255, 185, 0, 0.8) !important;
    background: rgba(254, 154, 0, 0.08);
    border: 1px solid rgba(254, 154, 0, 0.2);
    border-radius: 8px;
}

/* --- Nota (opcional): aclaración en gris --- */
.tema-multiplex .mp-popup__note {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px;
    line-height: 22.5px;
    color: rgba(255, 255, 255, 0.3) !important;
    margin: 0;
}

/* --- Botones: principal + secundario opcional --- */
.tema-multiplex .mp-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.tema-multiplex .mp-popup__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding: 0 20px;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

    .tema-multiplex .mp-popup__btn svg {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
    }

    .tema-multiplex .mp-popup__btn:focus-visible,
    .tema-multiplex .mp-popup__close:focus-visible {
        outline: 2px solid #ffffff;
        outline-offset: 2px;
    }

.tema-multiplex .mp-popup__btn--primary {
    height: 52px;
    background: var(--mp-popup-btn);
    border: 1px solid var(--mp-popup-btn-border);
    color: var(--mp-popup-btn-text) !important;
}

    .tema-multiplex .mp-popup__btn--primary:hover {
        background: var(--mp-popup-btn-hover);
    }

.tema-multiplex .mp-popup__btn--secondary {
    height: 44px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5) !important;
}

    .tema-multiplex .mp-popup__btn--secondary:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.3);
        color: #ffffff !important;
    }

/* ============================================================
   Layout "side" (Figma node-id=792-22794)
   ============================================================ */
.tema-multiplex .mp-popup--side .mp-popup__dialog {
    gap: 24px;
    width: 448px;
    padding: 32px 28px 28px;
    text-align: left;
}

.tema-multiplex .mp-popup--side .mp-popup__head {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
}

.tema-multiplex .mp-popup--side .mp-popup__head-body {
    flex: 1;
    gap: 10px;
    padding-top: 2px;
}

.tema-multiplex .mp-popup--side .mp-popup__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

    .tema-multiplex .mp-popup--side .mp-popup__icon svg {
        width: 24px;
        height: 24px;
    }

.tema-multiplex .mp-popup--side .mp-popup__title {
    font-size: 24px;
    line-height: 33.6px;
    letter-spacing: 0.6px;
}

/* Con botón de cerrar, el título no se le mete por debajo. */
.tema-multiplex .mp-popup--side .mp-popup__close ~ .mp-popup__head .mp-popup__title {
    padding-right: 28px;
}

.tema-multiplex .mp-popup--side .mp-popup__card {
    margin-top: 0;
}

/* Botón principal abajo, secundario arriba (el DOM no cambia). */
.tema-multiplex .mp-popup--side .mp-popup__actions {
    flex-direction: column-reverse;
    gap: 12px;
    margin-top: 0;
}

.tema-multiplex .mp-popup--side .mp-popup__btn {
    height: 48px;
}

.tema-multiplex .mp-popup--side .mp-popup__btn--secondary {
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .tema-multiplex .mp-popup__dialog {
        padding: 28px 20px 20px;
    }

    .tema-multiplex .mp-popup__head {
        gap: 16px;
    }

    .tema-multiplex .mp-popup__icon {
        width: 56px;
        height: 56px;
    }

        .tema-multiplex .mp-popup__icon svg {
            width: 28px;
            height: 28px;
        }

    .tema-multiplex .mp-popup__title {
        font-size: 24px;
        line-height: 31px;
        letter-spacing: 0.6px;
    }

    .tema-multiplex .mp-popup__movie-title {
        font-size: 17px;
    }

    .tema-multiplex .mp-popup__movie {
        padding: 14px 0;
    }

    .tema-multiplex .mp-popup__row {
        padding: 10px 0;
        font-size: 14px;
    }

    .tema-multiplex .mp-popup__actions {
        margin-top: 4px;
    }

    .tema-multiplex .mp-popup__btn {
        font-size: 15px;
        letter-spacing: 1.2px;
    }

    .tema-multiplex .mp-popup--side .mp-popup__dialog {
        gap: 20px;
        padding: 28px 20px 20px;
    }

    .tema-multiplex .mp-popup--side .mp-popup__head {
        gap: 14px;
    }

    .tema-multiplex .mp-popup--side .mp-popup__icon {
        width: 44px;
        height: 44px;
    }

        .tema-multiplex .mp-popup--side .mp-popup__icon svg {
            width: 22px;
            height: 22px;
        }

    .tema-multiplex .mp-popup--side .mp-popup__title {
        font-size: 21px;
        line-height: 29px;
    }

    .tema-multiplex .mp-popup--side .mp-popup__text {
        font-size: 15px;
        line-height: 24px;
    }

    .tema-multiplex .mp-popup--side .mp-popup__actions {
        margin-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tema-multiplex .mp-popup,
    .tema-multiplex .mp-popup__dialog {
        transition: none;
    }
}

/* --- Código de verificación (opción code: N de mpPopup.open) --- */
.tema-multiplex .mp-popup__code {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tema-multiplex .mp-popup__code-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tema-multiplex .mp-popup__code-box {
    width: 56px;
    height: 64px;
    padding: 0;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #ffffff !important;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    outline: none;
    caret-color: var(--mp-popup-accent);
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .tema-multiplex .mp-popup__code-box:focus {
        border-color: var(--mp-popup-accent);
        box-shadow: 0 0 0 3px var(--mp-popup-tint);
    }

    .tema-multiplex .mp-popup__code-box.is-invalid {
        border-color: #ff6b6b;
    }

    .tema-multiplex .mp-popup__code-box:disabled {
        opacity: .6;
    }

.tema-multiplex .mp-popup__code-err {
    min-height: 20px;
    margin: 0;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 13px;
    font-weight: 600;
    color: #ff6b6b !important;
}

    .tema-multiplex .mp-popup__code-err:empty {
        visibility: hidden;
    }

.tema-multiplex .mp-popup__btn:disabled {
    opacity: .6;
    cursor: wait;
}

@media (max-width: 380px) {
    .tema-multiplex .mp-popup__code-box {
        width: 48px;
        height: 56px;
        font-size: 24px;
    }
}

/* ------------------------------------------------------------
   Pantalla de carga (.mp-carga) — opción loading de mpPopup.open:
   al confirmar, cubre la página hasta que el navegador muestra la
   siguiente (ej. el carrito, que puede tardar si fallan los web
   services). Mismo look que "Procesando tu pago" (.mp-pago-carga
   de carrito.css), más el resumen de la función elegida.
   Preview: PreviewsHTML/multiplex-carga-carrito.html.
   ------------------------------------------------------------ */
.tema-multiplex .mp-carga {
    position: fixed;
    inset: 0;
    z-index: 1600;   /* sobre el header (1051); debajo del popup (1700) */
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 2, 12, 0.88);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    text-align: center;
    animation: mp-carga-fade .2s ease-out;
}

    .tema-multiplex .mp-carga[hidden] {
        display: none;
    }

html.mp-cargando {
    overflow: hidden;
}

.tema-multiplex .mp-carga__box {
    max-width: 360px;
}

.tema-multiplex .mp-carga__spin {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    border: 5px solid rgba(251, 190, 0, 0.2);
    border-top-color: #fbbe00;
    border-radius: 50%;
    animation: mp-carga-giro .9s linear infinite;
}

.tema-multiplex .mp-carga__title {
    margin: 0;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #ffffff !important;
}

    .tema-multiplex .mp-carga__title strong {
        color: #fbbe00 !important;
    }

.tema-multiplex .mp-carga__text {
    margin: 10px 0 0;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7) !important;
}

.tema-multiplex .mp-carga__funcion {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 320px;
    margin: 22px auto 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    text-align: left;
}

.tema-multiplex .mp-carga__poster {
    flex: none;
    width: 36px;
    height: 52px;
    border-radius: 4px;
    object-fit: cover;
}

.tema-multiplex .mp-carga__funcion-info {
    min-width: 0;
}

.tema-multiplex .mp-carga__funcion-title,
.tema-multiplex .mp-carga__funcion-meta {
    display: block;
    font-family: 'Montserrat', sans-serif !important;
}

.tema-multiplex .mp-carga__funcion-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff !important;
}

.tema-multiplex .mp-carga__funcion-meta {
    margin-top: 3px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7) !important;
}

@keyframes mp-carga-giro {
    to { transform: rotate(360deg); }
}

@keyframes mp-carga-fade {
    from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tema-multiplex .mp-carga__spin {
        animation-duration: 2.4s;
    }
}
