/* ============================================================
   /navidad — Eleccion del regalo de Navidad.
   Se carga desde functions/templates/web/navidad_regalo.html.

   Convencion: todo prefijado con .nv-* para no chocar con el sitio
   ni con el tema de Navidad de la portada (navidad.css).
   ============================================================ */

:root {
    --nv-rojo: #b91c1c;
    --nv-rojo-oscuro: #7f1d1d;
    --nv-verde: #166534;
    --nv-verde-claro: #dcfce7;
    --nv-dorado: #d4a017;
    --nv-crema: #fdf8f3;
    --nv-texto: #1f2937;
    --nv-gris: #5b6472;
    --nv-borde: #eadfd3;
    --nv-error: #b42318;
    --nv-radio: 16px;
    --nv-foco: 0 0 0 3px rgba(185, 28, 28, .28);
}

/* El JS esconde pantallas con `hidden`; que ningun display le gane. */
#nvApp [hidden], .nv-modal[hidden], .nv-musica[hidden], .nv-preview[hidden] {
    display: none !important;
}

/* ===== MODO PRUEBA ===== */
.nv-preview {
    background: #fef3c7;
    color: #78350f;
    border-bottom: 1px solid #fcd34d;
    text-align: center;
    font-size: .9rem;
    padding: 10px 16px;
    position: relative;
    z-index: 5;
}

/* ===== HERO ===== */
.nv-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .10), transparent 45%),
        radial-gradient(circle at 85% 0%, rgba(212, 160, 23, .22), transparent 40%),
        linear-gradient(160deg, var(--nv-rojo-oscuro) 0%, var(--nv-rojo) 55%, #991b1b 100%);
    color: #fff;
    padding: 90px 20px 84px;
    text-align: center;
}

/* En computador la barra de navegacion es una pildora fija arriba: con
   90 px tapaba el titulo (mismo arreglo que .fm-hero). */
@media (min-width: 992px) {
    .nv-hero { padding-top: 150px; }
}

.nv-nieve {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nv-hero-contenido {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.nv-escudo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .3px;
    margin-bottom: 18px;
}

.nv-hero h1 {
    font-size: clamp(1.7rem, 5vw, 2.7rem);
    font-weight: 800;
    margin: 0 auto 12px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.nv-descripcion {
    max-width: 620px;
    margin: 0 auto;
    opacity: .95;
    font-size: 1.04rem;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Guirnalda de luces al pie del hero */
.nv-luces {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    display: flex;
    justify-content: space-between;
    list-style: none;
    margin: 0;
    padding: 0 3%;
}
.nv-luces::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -6px;
    height: 14px;
    border-bottom: 2px solid rgba(255, 255, 255, .35);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.nv-luces li {
    width: 12px;
    height: 18px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: #fde68a;
    box-shadow: 0 0 10px 2px rgba(253, 230, 138, .75);
    animation: nv-titilar 1.8s ease-in-out infinite;
}
.nv-luces li:nth-child(3n+2) { background: #86efac; box-shadow: 0 0 10px 2px rgba(134, 239, 172, .7); animation-delay: .6s; }
.nv-luces li:nth-child(3n)   { background: #93c5fd; box-shadow: 0 0 10px 2px rgba(147, 197, 253, .7); animation-delay: 1.2s; }
@media (max-width: 575px) {
    .nv-luces li:nth-child(n+11) { display: none; }
}
@keyframes nv-titilar {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

/* ===== CONTENEDOR ===== */
.nv-seccion {
    background: var(--nv-crema);
    padding: 0 16px 96px;
}

.nv-contenedor {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    top: -40px;
}

.nv-tarjeta {
    background: #fff;
    border-radius: var(--nv-radio);
    box-shadow: 0 14px 36px rgba(127, 29, 29, .10);
    border: 1px solid var(--nv-borde);
    padding: clamp(20px, 4.5vw, 36px);
    margin: 0 auto 16px;
    max-width: 560px;
}

.nv-tarjeta h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--nv-rojo-oscuro);
    margin: 0 0 8px;
    line-height: 1.3;
}
.nv-tarjeta h2:focus { outline: none; }

.nv-centro { text-align: center; }

.nv-sub {
    color: var(--nv-gris);
    font-size: .97rem;
    line-height: 1.55;
    margin: 0 0 20px;
}
/* El texto encima de los regalos lo escribe el panel: respeta sus saltos de linea. */
.nv-texto-regalos { white-space: pre-line; }

.nv-cargando {
    text-align: center;
    color: var(--nv-gris);
    padding: 56px 0;
    margin: 0;
}

.nv-icono-grande {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
}

/* ===== PASOS ===== */
.nv-pasos {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    counter-reset: paso;
    font-size: .78rem;
    font-weight: 600;
    color: var(--nv-gris);
}
.nv-pasos li {
    counter-increment: paso;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.nv-pasos li::before {
    content: counter(paso);
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: #f3ece5;
    color: var(--nv-gris);
}
.nv-pasos li.activo { color: var(--nv-rojo); }
.nv-pasos li.activo::before { background: var(--nv-rojo); color: #fff; }
.nv-pasos li.hecho { color: var(--nv-verde); }
.nv-pasos li.hecho::before { content: "✓"; background: var(--nv-verde); color: #fff; }

/* ===== FORMULARIO ===== */
.nv-label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--nv-texto);
    margin-bottom: 6px;
}

.nv-input {
    width: 100%;
    font-size: 1.15rem;
    padding: 12px 14px;
    border: 1.5px solid var(--nv-borde);
    border-radius: 12px;
    background: #fff;
    color: var(--nv-texto);
    transition: border-color .15s, box-shadow .15s;
}
.nv-input:focus {
    outline: none;
    border-color: var(--nv-rojo);
    box-shadow: var(--nv-foco);
}
.nv-input[aria-invalid="true"] { border-color: var(--nv-error); }

.nv-codigo {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 1.7rem;
    letter-spacing: .5em;
    text-align: center;
    padding-left: calc(14px + .25em);
}

.nv-alerta {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef3f2;
    color: var(--nv-error);
    font-size: .92rem;
    line-height: 1.45;
}

/* ===== BOTONES ===== */
.nv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 22px;
    border-radius: 12px;
    border: 0;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, background-color .15s, opacity .15s;
}
.nv-btn:focus-visible { outline: none; box-shadow: var(--nv-foco); }
.nv-btn:disabled { opacity: .55; cursor: not-allowed; }
.nv-btn:not(:disabled):active { transform: translateY(1px); }

.nv-btn-primario {
    background: var(--nv-rojo);
    color: #fff;
    box-shadow: 0 6px 16px rgba(185, 28, 28, .25);
}
.nv-btn-primario:not(:disabled):hover { background: #991b1b; color: #fff; }

.nv-btn-secundario {
    background: #fff;
    color: var(--nv-rojo-oscuro);
    border: 1.5px solid var(--nv-borde);
}
.nv-btn-secundario:hover { border-color: var(--nv-rojo); color: var(--nv-rojo); }

.nv-btn-ancho { width: 100%; margin-top: 18px; }

.nv-acciones-sec {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.nv-link {
    background: none;
    border: 0;
    padding: 6px 0;
    color: var(--nv-rojo);
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
}
.nv-link:disabled { color: var(--nv-gris); cursor: default; }
.nv-link:not(:disabled):hover { text-decoration: underline; }

/* ===== REGALOS ===== */
.nv-saludo { max-width: none; }

.nv-regalos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.nv-regalo {
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: left;
    background: #fff;
    border: 2px solid var(--nv-borde);
    border-radius: var(--nv-radio);
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    color: var(--nv-texto);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.nv-regalo:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(127, 29, 29, .12); }
.nv-regalo:focus-visible { outline: none; box-shadow: var(--nv-foco); }
.nv-regalo[aria-checked="true"] {
    border-color: var(--nv-rojo);
    box-shadow: 0 10px 28px rgba(185, 28, 28, .22);
}

.nv-regalo-foto {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    background: linear-gradient(135deg, #fff1f2, #fefce8);
    display: grid;
    place-items: center;
    font-size: 3.4rem;
}
.nv-regalo-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nv-regalo-texto { padding: 14px 16px 16px; }
.nv-regalo-nombre {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}
.nv-regalo-desc {
    display: block;
    color: var(--nv-gris);
    font-size: .9rem;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.nv-regalo-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--nv-rojo);
    color: #fff;
    font-size: .95rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: scale(.6);
    transition: opacity .15s, transform .15s;
}
.nv-regalo[aria-checked="true"] .nv-regalo-check { opacity: 1; transform: scale(1); }

/* Pie de cada tarjeta: deja claro que tocarla es elegirla */
.nv-regalo-accion {
    margin-top: auto;
    padding: 0 16px 14px;
    color: var(--nv-rojo);
    font-weight: 700;
    font-size: .9rem;
}

/* Varias fotos: encimadas, y el JS le pasa `visible` a una cada 3,5 s */
.nv-regalo-foto--varias img {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .8s ease;
}
.nv-regalo-foto--varias img.visible { opacity: 1; }

/* Texto corto del panel sobre la foto ("Edicion especial FEUIS 2026") */
.nv-regalo-etiqueta {
    position: absolute;
    top: 10px;
    left: 10px;
    max-width: calc(100% - 60px);
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--nv-dorado);
    color: #3b2a00;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

/* ===== REGALO DESTACADO =====
   Tarjeta de todo el ancho, primera; los demas quedan debajo bajo
   "Otras opciones". En celular es la misma tarjeta, solo mas grande. */
.nv-regalo--destacado {
    grid-column: 1 / -1;
    border-color: var(--nv-dorado);
    box-shadow: 0 12px 30px rgba(212, 160, 23, .25);
}
.nv-regalo--destacado .nv-regalo-nombre { font-size: 1.45rem; color: var(--nv-rojo-oscuro); }
.nv-regalo--destacado .nv-regalo-desc { font-size: 1rem; }
.nv-regalo--destacado .nv-regalo-etiqueta { font-size: .9rem; padding: 6px 14px; }
.nv-regalo--destacado .nv-regalo-accion {
    align-self: flex-start;
    margin: 4px 16px 18px;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--nv-rojo);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(185, 28, 28, .3);
}
/* En computador: la foto entera a la izquierda y el texto al lado,
   centrado de arriba abajo.
   - Las fotos de los regalos son verticales (3:4): la caja tiene esa misma
     forma y la foto va con `contain`, asi que no se recorta nada. Una foto
     de otra forma queda completa, con el fondo crema a los lados.
   - La columna de la foto llega a 360 px: la tarjeta no pasa de 480 de alto.
   - Filas 1fr / texto / boton / 1fr: los dos 1fr reparten el espacio que
     sobra arriba y abajo, y el texto con su boton queda en el centro. */
@media (min-width: 768px) {
    .nv-regalo--destacado {
        display: grid;
        grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
        grid-template-rows: 1fr auto auto 1fr;
    }
    .nv-regalo--destacado .nv-regalo-foto {
        grid-column: 1;
        grid-row: 1 / -1;
        aspect-ratio: 3 / 4;
    }
    .nv-regalo--destacado .nv-regalo-foto img {
        position: absolute;
        inset: 0;
        object-fit: contain;
    }
    .nv-regalo--destacado .nv-regalo-texto { grid-column: 2; grid-row: 2; padding: 24px 36px 6px; }
    .nv-regalo--destacado .nv-regalo-nombre { font-size: 1.75rem; margin-bottom: 8px; }
    .nv-regalo--destacado .nv-regalo-accion { grid-column: 2; grid-row: 3; justify-self: start; margin: 12px 36px 24px; }
}

.nv-otras {
    grid-column: 1 / -1;
    margin: 10px 0 -4px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
}
.nv-otras h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--nv-rojo-oscuro);
}
.nv-otras span { font-size: .88rem; color: var(--nv-gris); }

/* Al tocar uno de abajo: el que sube y el que baja entran suave */
.nv-regalo--entra { animation: nv-entra .45s ease-out; }
@keyframes nv-entra {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* ===== LISTO ===== */
.nv-final-imagen {
    width: 160px;
    height: 160px;
    margin: 0 auto 18px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    font-size: 4.5rem;
    background: linear-gradient(135deg, #fff1f2, #fefce8);
    border: 4px solid #fff;
    box-shadow: 0 10px 28px rgba(127, 29, 29, .18);
    animation: nv-saltito .9s ease-out 1;
}
.nv-final-imagen img { width: 100%; height: 100%; object-fit: cover; }
@keyframes nv-saltito {
    0%   { transform: scale(.4) rotate(-8deg); opacity: 0; }
    60%  { transform: scale(1.08) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}

/* ===== MODAL ===== */
.nv-modal {
    position: fixed;
    inset: 0;
    /* Encima de la barra de navegacion fija y de los botones flotantes */
    z-index: 10050;
    background: rgba(17, 24, 39, .55);
    display: grid;
    place-items: center;
    padding: 16px;
}
.nv-modal-caja {
    background: #fff;
    border-radius: var(--nv-radio);
    max-width: 420px;
    width: 100%;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.nv-modal-caja h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--nv-rojo-oscuro);
    margin: 0 0 8px;
}
.nv-modal-caja p { color: var(--nv-gris); line-height: 1.55; margin: 0 0 20px; }
.nv-modal-caja strong { color: var(--nv-texto); }
.nv-modal-botones { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.nv-modal-botones .nv-btn { flex: 1 1 140px; }

/* ===== CANCION DE FONDO ===== */
.nv-musica {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 900;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--nv-borde);
    background: #fff;
    color: var(--nv-rojo);
    font-size: 1.05rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
    transition: transform .15s;
}
.nv-musica:hover { transform: translateY(-2px); }
.nv-musica:focus-visible { outline: none; box-shadow: var(--nv-foco); }
.nv-musica[aria-pressed="true"] {
    background: var(--nv-rojo);
    color: #fff;
    border-color: var(--nv-rojo);
    animation: nv-latido 2.4s ease-in-out infinite;
}
@keyframes nv-latido {
    0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .35); }
    50%      { box-shadow: 0 0 0 10px rgba(185, 28, 28, 0); }
}
@media (max-width: 575px) {
    .nv-musica { bottom: 88px; left: 16px; width: 44px; height: 44px; }
}

