/* =========================================================================
   Fotos Colegio Epullay — "Montessori contemporáneo"
   Tipografía (3 niveles): Display 40/44 · Título 24/32 · Cuerpo 16/24
   Espaciado: múltiplos de 4/8 · Radios: 24 tarjetas, 16 campos, 999 botones
   Movimiento: 150–300 ms, ease-out al entrar / ease-in al salir
   ========================================================================= */

@font-face {
    font-family: "Bricolage";
    src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}
@font-face {
    font-family: "Figtree";
    src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
    font-weight: 300 900;
    font-display: swap;
}

:root {
    --azul: #1A239E;
    --azul-osc: #0F1664;
    --azul-hover: #141B7D;
    --lima: #76C81E;
    --lima-tinte: #EAF6D8;
    --sol: #FFC83D;
    --coral: #FF6B4A;
    --fondo: #F3F5FF;
    --superficie: #FFFFFF;
    --tinta: #12163A;
    --tinta-2: #4B5275;
    --relleno: #EEF0FC;
    --borde: #DCE0F5;
    --error: #B3261E;
    --error-fondo: #FDECEA;
    --sombra: 0 1px 2px rgba(18, 22, 58, .06), 0 12px 32px rgba(18, 22, 58, .08);
    --sale: cubic-bezier(.4, 0, 1, 1);
    --entra: cubic-bezier(0, 0, .2, 1);
    --rebote: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--fondo);
    color: var(--tinta);
    font: 400 16px/24px "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.con-barra { padding-bottom: 88px; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: var(--azul); }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; border-radius: 8px; }
.banda :focus-visible { outline-color: #fff; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap.estrecho { max-width: 768px; }
.suave { color: var(--tinta-2); }
.num-tab { font-variant-numeric: tabular-nums; }

/* -------- Tipografía: Display / Título / Cuerpo -------- */
h1 { font: 800 40px/44px "Bricolage", "Figtree", sans-serif; letter-spacing: -.02em; }
h2, .h2 { font: 700 24px/32px "Bricolage", "Figtree", sans-serif; letter-spacing: -.01em; }
h3 { font: 700 16px/24px "Figtree", sans-serif; }

/* =========================== BANDA AZUL =========================== */
.banda {
    position: relative;
    overflow: hidden;
    background: var(--azul);
    color: #fff;
    border-radius: 0 0 40px 40px;
    padding-top: 40px;
    padding-bottom: 104px;
}
body.en-checkout .banda { padding-bottom: 88px; }
body.en-checkout .hero { display: none; }
body.en-checkout .f-anillo, body.en-checkout .f-coral, body.en-checkout .f-sol { display: none; }

.forma { position: absolute; display: block; pointer-events: none; }
.f-lima   { width: 160px; height: 160px; border-radius: 50%; background: var(--lima); right: -96px; top: -80px; }
.f-sol    { width: 144px; height: 72px; border-radius: 72px 72px 0 0; background: var(--sol); right: 192px; top: 190px; }
.f-coral  { width: 24px; height: 24px; border-radius: 50%; background: var(--coral); right: 112px; top: 104px; }
.f-anillo { width: 96px; height: 96px; border-radius: 50%; border: 16px solid rgba(255, 255, 255, .16); right: 376px; top: 88px; }

/* -------- Huincha superior (blanca) -------- */
.cabecera { background: #fff; border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 50; }
.cabecera-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; }
.marca { display: flex; align-items: center; gap: 12px; color: var(--azul); text-decoration: none; }
.marca-logo { width: 48px; height: 48px; flex: none; display: grid; place-items: center; }
.marca-logo img { width: 48px; height: 48px; object-fit: contain; }
.marca-texto { font: 700 16px/24px "Bricolage", sans-serif; display: flex; flex-direction: column; }
.marca-texto small { font: 400 16px/24px "Figtree", sans-serif; color: var(--tinta-2); }
.progreso { display: flex; align-items: center; gap: 12px; color: var(--tinta); }
.progreso-texto { font-weight: 600; }
.progreso-barra { display: flex; gap: 4px; }
.seg { display: block; width: 32px; height: 8px; border-radius: 4px; background: var(--borde); transition: background-color 200ms var(--entra); }
.seg.on { background: var(--azul); }

.hero { position: relative; z-index: 1; max-width: 1120px; }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 16px; max-width: 44ch; color: rgba(255, 255, 255, .9); }

.precios { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 248px)); gap: 16px; }
.precio { display: grid; grid-template-columns: 32px 1fr auto; column-gap: 8px; align-items: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .24); border-radius: 16px; padding: 12px; cursor: default; }
.precio-ico { width: 32px; height: 32px; border-radius: 8px; background: #fff; color: var(--azul); display: grid; place-items: center; }
.precio-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.precio-nombre { font-weight: 700; }
.precio-valor { font-weight: 700; color: var(--lima); margin-left: 0; }
.precio-nota { grid-column: 1 / -1; margin-top: 8px; color: rgba(255, 255, 255, .88); }

/* =========================== CONTENIDO =========================== */
.principal { position: relative; z-index: 2; margin-top: -64px; flex: 1; padding-bottom: 64px; }
body.en-checkout .principal { margin-top: -56px; }

.cuadricula { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.columna { display: grid; gap: 24px; }

.tarjeta {
    background: var(--superficie);
    border-radius: 24px;
    box-shadow: var(--sombra);
    padding: 32px;
}
.tarjeta-cabeza { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.tarjeta-cabeza p { margin-top: 4px; }
.num {
    flex: none;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--lima); color: var(--tinta);
    display: grid; place-items: center;
    font: 800 16px/24px "Bricolage", sans-serif;
}
.bajada { margin: -8px 0 24px 56px; }

/* ---- Formularios ---- */
.fila-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.campo { margin-bottom: 16px; }
.campo label { display: block; font-weight: 600; margin-bottom: 8px; }
input[type="text"], input[type="email"], input[type="tel"], select {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: var(--relleno);
    color: var(--tinta);
    font: 400 16px/24px "Figtree", sans-serif;
    transition: background-color 150ms var(--entra), border-color 150ms var(--entra);
    appearance: none;
    -webkit-appearance: none;
}
select {
    padding-right: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231A239E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
input::placeholder { color: #6B7194; }
input:hover, select:hover { border-color: var(--borde); }
input:focus, select:focus { outline: none; background-color: #fff; border-color: var(--azul); }
input[aria-invalid="true"] { border-color: var(--error); background-color: var(--error-fondo); }

/* ---- Botones ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 56px; padding: 0 32px;
    border: 2px solid transparent; border-radius: 999px;
    font: 700 16px/24px "Figtree", sans-serif;
    text-decoration: none; cursor: pointer;
    transition: transform 150ms var(--entra), background-color 150ms var(--entra), box-shadow 150ms var(--entra);
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn-bloque { width: 100%; }
.btn-primario { background: var(--azul); color: #fff; box-shadow: 0 4px 12px rgba(26, 35, 158, .24); }
.btn-primario:hover { background: var(--azul-hover); box-shadow: 0 6px 16px rgba(26, 35, 158, .32); }
.btn-secundario { background: #fff; color: var(--azul); border-color: var(--azul); }
.btn-secundario:hover { background: var(--relleno); }
.btn:disabled { background: var(--relleno); color: #6B7194; box-shadow: none; cursor: not-allowed; transform: none; }
#btn_validar { margin-top: 8px; }

/* ---- Mensajes ---- */
.msg { border-radius: 16px; padding: 12px 16px; margin: 0 0 16px; }
.msg-error { background: var(--error-fondo); color: var(--error); font-weight: 600; }
.msg-ok { background: var(--lima-tinte); color: #1F4A00; font-weight: 600; margin: 16px 0 0; animation: sube 250ms var(--entra); }

/* ---- Producto ---- */
.producto { border: 2px solid var(--borde); border-radius: 20px; padding: 24px; margin-bottom: 16px; }
.producto-cabeza { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.burbuja { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: var(--tinta); }
.burbuja svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.burbuja-individual { background: var(--sol); }
.burbuja-grupal { background: #FFC9BC; }

.formatos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.formato { position: relative; display: block; cursor: pointer; }
.formato input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.formato-caja {
    display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: center;
    height: 100%;
    padding: 16px;
    border: 2px solid var(--borde);
    border-radius: 16px;
    background: #fff;
    transition: border-color 150ms var(--entra), background-color 150ms var(--entra), transform 150ms var(--entra);
}
.formato:hover .formato-caja { border-color: #B7BEEA; }
.formato:active .formato-caja { transform: scale(.98); }
.formato input:focus-visible + .formato-caja { outline: 3px solid var(--azul); outline-offset: 3px; }
.formato input:checked + .formato-caja { border-color: var(--azul); background: var(--relleno); }
.formato-ico { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 12px; background: var(--relleno); color: var(--azul); display: grid; place-items: center; }
.formato input:checked + .formato-caja .formato-ico { background: #fff; }
.formato-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.formato-nombre { font-weight: 700; }
.formato-detalle { grid-column: 2; color: var(--tinta-2); }
.formato-precio { grid-column: 1 / -1; margin-top: 12px; font: 800 24px/32px "Bricolage", sans-serif; color: var(--azul); }
.formato-check {
    position: absolute; top: -10px; right: -10px; z-index: 1;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--lima); color: var(--tinta);
    display: grid; place-items: center;
    transform: scale(0); opacity: 0;
    transition: transform 200ms var(--rebote), opacity 150ms var(--entra);
}
.formato-check svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.formato input:checked + .formato-caja .formato-check { transform: scale(1); opacity: 1; }

.cantidad { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--relleno); border-radius: 16px; font-weight: 600; animation: sube 250ms var(--entra); }
.stepper { display: inline-flex; align-items: center; background: #fff; border-radius: 999px; padding: 4px; }
.stepper button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: var(--azul); font: 700 24px/24px "Figtree", sans-serif; cursor: pointer; transition: background-color 150ms var(--entra), transform 150ms var(--entra); }
.stepper button:hover { background: var(--relleno); }
.stepper button:active { transform: scale(.94); }
.stepper output { min-width: 40px; text-align: center; font: 700 16px/24px "Figtree", sans-serif; }

.acciones-producto { display: grid; gap: 16px; margin-top: 24px; }
.botones { display: flex; justify-content: flex-end; gap: 12px; }
.botones .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.otro-alumno { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; background: var(--lima-tinte); border-radius: 20px; animation: sube 250ms var(--entra); }
.otro-alumno strong { display: block; }

/* ---- Resumen ---- */
.resumen { padding: 24px; }
.resumen-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.insignia { background: var(--relleno); color: var(--azul); font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.resumen-lista { display: grid; }
.resumen-vacio { padding: 16px; background: var(--relleno); border-radius: 16px; }
.linea { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--borde); }
.linea:first-child { padding-top: 0; }
.linea-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.linea-info strong { overflow-wrap: anywhere; }
.linea-precio { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.linea.nuevo { animation: resalta 900ms var(--entra); }
.linea.sale { opacity: 0; transform: translateX(8px); transition: opacity 150ms var(--sale), transform 150ms var(--sale); }
.quitar { margin-top: 4px; padding: 8px 0; min-height: 40px; border: 0; background: none; color: var(--azul); font: 600 16px/24px "Figtree", sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.resumen-total { display: flex; align-items: baseline; justify-content: space-between; padding: 24px 0 16px; font-weight: 600; }
.monto { font: 800 24px/32px "Bricolage", sans-serif; color: var(--azul); font-variant-numeric: tabular-nums; }
.aviso-pago { margin-top: 24px; display: grid; gap: 8px; }

/* ---- Checkout ---- */
.volver { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 16px; color: #fff; font-weight: 600; text-decoration: none; }
.volver svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.volver:hover { text-decoration: underline; text-underline-offset: 3px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.vista-entra { animation: sube 300ms var(--entra); }

/* ---- Pie, WhatsApp, barra móvil ---- */
.pie { margin-top: auto; background: var(--azul-osc); color: #fff; text-align: center; padding: 20px 24px; border-top: 4px solid var(--lima); }
.wa {
    position: fixed; right: 24px; bottom: 24px; z-index: 30;
    width: 56px; height: 56px; border-radius: 50%;
    background: #1FA855; display: grid; place-items: center;
    box-shadow: 0 8px 20px rgba(18, 22, 58, .24);
    transition: transform 150ms var(--entra);
}
.wa:hover { transform: scale(1.05); }
.wa:active { transform: scale(.96); }
.wa svg { width: 28px; height: 28px; fill: #fff; }

.barra-movil {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 24px rgba(18, 22, 58, .12);
    transform: translateY(110%);
    transition: transform 250ms var(--entra);
}
.barra-movil.visible { transform: translateY(0); }
.barra-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.barra-total { display: flex; flex-direction: column; }
.barra-movil .btn { min-height: 56px; }
body.con-barra .wa { bottom: 104px; }

/* =========================== PÁGINAS DE RESULTADO =========================== */
.pagina-resultado { background: var(--fondo); }
.banda-mini { background: var(--azul); height: 152px; border-radius: 0 0 40px 40px; position: relative; overflow: hidden; }
.banda-mini::before { content: ""; position: absolute; right: -40px; top: -56px; width: 144px; height: 144px; border-radius: 50%; background: var(--lima); }
.banda-mini::after { content: ""; position: absolute; left: 24px; bottom: 0; width: 96px; height: 48px; border-radius: 48px 48px 0 0; background: var(--sol); }

.tarjeta-resultado {
    position: relative; z-index: 2;
    width: calc(100% - 32px); max-width: 560px;
    margin: -72px auto 64px;
    background: #fff; border-radius: 24px; box-shadow: var(--sombra);
    padding: 40px 32px 32px;
    text-align: center;
    display: grid; gap: 16px; justify-items: center;
}
.tarjeta-resultado h1 { font: 800 32px/36px "Bricolage", sans-serif; }
.tarjeta-resultado p { max-width: 44ch; }
.icono-estado { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; margin-top: -80px; border: 6px solid #fff; box-shadow: var(--sombra); }
.icono-estado.ok { background: var(--lima); color: var(--tinta); }
.icono-estado.espera { background: var(--sol); color: var(--tinta); }
.icono-estado.espera svg { animation: gira 2.4s linear infinite; transform-origin: 50% 50%; }
.icono-estado.mal { background: var(--coral); color: var(--tinta); }
.destacado { font-weight: 700; padding: 8px 16px; background: var(--relleno); border-radius: 999px; }
.descargas { width: 100%; margin-top: 8px; text-align: left; display: grid; gap: 8px; }
.lista-descargas { display: grid; gap: 12px; margin-top: 8px; }
.lista-descargas li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--relleno); border-radius: 16px; }
.lista-descargas .btn { min-height: 48px; padding: 0 24px; flex: none; }
.acciones { width: 100%; display: grid; gap: 8px; justify-items: center; margin-top: 8px; }
.enlace { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; }

/* =========================== MOVIMIENTO =========================== */
.anim-entra { animation: sube 300ms var(--entra); }
@keyframes sube { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes resalta { 0% { background: var(--lima-tinte); } 100% { background: transparent; } }
@keyframes gira { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* =========================== RESPONSIVE =========================== */
@media (max-width: 1023px) {
    .f-anillo, .f-coral { display: none; }
    .f-sol { top: auto; bottom: 0; right: 96px; }
}

@media (max-width: 639px) {
    h1 { font-size: 32px; line-height: 36px; }
    .wrap { padding: 0 16px; }
    .banda { border-radius: 0 0 32px 32px; padding-top: 32px; padding-bottom: 96px; }
    .cabecera-in { min-height: 72px; }
    .progreso-texto { display: none; }
    .precios { grid-template-columns: minmax(0, 1fr); }
    .f-lima { width: 96px; height: 96px; right: -32px; top: auto; bottom: -8px; }
    .f-sol { width: 96px; height: 48px; right: 16px; top: auto; bottom: 0; }
    .tarjeta { padding: 24px 16px; border-radius: 24px; }
    .tarjeta-cabeza { margin-bottom: 16px; }
    .bajada { margin-left: 0; }
    .fila-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .producto { padding: 16px; }
    .acciones-producto { text-align: center; }
    .botones { flex-direction: column-reverse; }
    .botones .btn { width: 100%; }
    .otro-alumno { flex-direction: column; align-items: stretch; text-align: center; padding: 16px; }
    .wa { right: 16px; bottom: 16px; }
    .lista-descargas li { flex-direction: column; align-items: stretch; text-align: center; }
    .tarjeta-resultado { padding: 40px 24px 24px; }
}

@media (max-width: 419px) {
    .formatos { grid-template-columns: minmax(0, 1fr); }
}
