/* Cartoncito — demo de "Cómo funciona". Solo se carga en como-funciona.html.
   Movimiento: solo transform y opacity; todo en 500 ms o menos; nada que se repita solo. */

[hidden] { display: none !important; }

:root {
  /* Local ficticio de la demo: --cafe y --crema viven en styles.css (excepción permitida) */
  --franja: color-mix(in srgb, var(--cafe) 88%, var(--crema));

  /* UI de iOS, Android y las Wallets (excepción permitida: imitan el sistema, no son de la marca) */
  --dev-body: #1a1a1c;
  --dev-edge: #3b3b3f;
  --dev-key: #2a2a2d;
  --dev-body-and: #222326;
  --dev-black: #000000;
  --ios-bg: #F2F2F7;
  --ios-chip: #E3E3E8;
  --ios-blue: #0A84FF;
  --and-bg: #F4F6FA;

  /* Fondos de pantalla de bloqueo (los mismos de la demo original) */
  --wp-i-0: #6f7fa8; --wp-i-1: #34405f; --wp-i-2: #6b5b7b; --wp-i-3: #c4876a;
  --wp-a-0: #5d7f73; --wp-a-1: #22313a; --wp-a-2: #3e5552; --wp-a-3: #b49373;
}

/* ---------- Layout ----------
   Mobile: encabezado, celular con sus botones, pieza de muestra y "¿Cómo cobrás?".
   Desktop (1040 px o más): encabezado y pieza a la izquierda, celular a la derecha. Todo pegado, sin aire de más. */
.demo { padding: 20px 0 36px; }
.demo-grid { display: grid; gap: 28px; }
.demo-grid > * { min-width: 0; }
.d-head h1 { margin-top: 10px; font-size: 28px; font-weight: 900; letter-spacing: -.025em; line-height: 1.1; }
.d-head h1 .ln { display: block; }
.d-head .lead { margin-top: 10px; font-size: 17px; max-width: 60ch; }
@media (min-width: 1040px) {
  .demo { padding: 14px 0 28px; }
  .demo-grid {
    grid-template-columns: minmax(0, 520px) 400px; justify-content: center; grid-template-rows: auto 1fr;
    grid-template-areas: "head device" "piece device";
    column-gap: 48px; row-gap: 20px;
  }
  .d-head { grid-area: head; }
  .d-device { grid-area: device; }
  .d-piece { grid-area: piece; align-self: start; }
  .d-head h1 { font-size: 36px; }
  .d-head .lead { font-size: 18px; }
}

/* El círculo rojo del título: el mismo trazo del inicio, se dibuja una sola vez al cargar */
.d-head h1 .mark { position: relative; white-space: nowrap; }
.d-head h1 .mark svg { position: absolute; left: -9%; top: -14%; width: 118%; height: 132%; overflow: visible; pointer-events: none; }
.d-head h1 .mark path {
  fill: none; stroke: var(--sello); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: markDraw var(--dur-slow) cubic-bezier(.65,0,.35,1) .3s forwards;
}
@keyframes markDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .d-head h1 .mark path { animation: none; stroke-dashoffset: 0; } }

/* ---------- Selectores ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--papel-2); border: 2px solid var(--linea); border-radius: 999px; }
.seg button { min-height: 44px; min-width: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--tinta-suave); font: 800 16px/1 "Nunito", system-ui, sans-serif; cursor: pointer; }
.seg button:hover { color: var(--tinta); }
.seg button[aria-pressed="true"] { background: var(--tinta); color: var(--papel); }
/* Más chico: sin marco, y la pastilla activa de 32 px (el botón sigue midiendo 44 px) */
.seg.sm { gap: 2px; padding: 0; background: none; border: 0; }
.seg.sm button { position: relative; isolation: isolate; padding: 0 14px; font-size: 14px; }
.seg.sm button::before { content: ""; position: absolute; inset: 6px 0; z-index: -1; border-radius: 999px; background: var(--tinta); opacity: 0; transition: opacity var(--dur-fast); }
.seg.sm button[aria-pressed="true"] { background: transparent; }
.seg.sm button[aria-pressed="true"]::before { opacity: 1; }

/* Arriba del celular. En pantallas chicas también va "¿Cómo cobrás?" acá, para no tener que bajar a buscarlo */
.d-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 14px; }
@media (min-width: 1040px) { .d-controls .seg-modo { display: none; } }
@media (max-width: 1039px) {
  .d-piece .how-pick { display: none; }
  .d-controls .seg-modo { padding: 3px; gap: 2px; background: var(--papel-2); border: 2px solid var(--linea); }
  .d-controls .seg-modo button { padding: 0 14px; }
}

/* ---------- "¿Cómo cobrás?": debajo del epígrafe de la pieza ---------- */
.how-pick { width: 100%; margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.how-q { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--tinta-suave); }
.how-pick .seg { display: flex; width: 100%; max-width: 420px; }
.how-pick .seg button { flex: 1; }
@media (min-width: 1040px) {
  .how-pick { align-items: flex-start; margin-top: 14px; }
  .how-pick .seg { display: inline-flex; width: auto; }
  .how-pick .seg button { flex: none; }
}

/* ---------- Pieza de muestra (solo se mira) ---------- */
/* --pw / --pm: el ancho de la pieza; demo.js lo ajusta en desktop para que entre en el primer pantallazo */
.d-piece { --pw: min(300px, 100%); --pm: min(100%, 340px); position: relative; display: flex; flex-direction: column; align-items: center; }
.piece-v { display: flex; flex-direction: column; align-items: center; width: 100%; }
.piece-art { width: 100%; }
.piece-art > * { margin-inline: auto; }
.cap { margin-top: 18px; max-width: 34ch; text-align: center; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--tinta-suave); }
.cap b { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 900; letter-spacing: .12em; line-height: 1.6; text-transform: uppercase; color: var(--pliegue-txt); }
.d-arrow { display: none; }
@media (min-width: 1040px) {
  .d-piece, .piece-v { align-items: flex-start; }
  .piece-art > * { margin-inline: 0; }
  .cap { text-align: left; }
  /* La pieza ocupa siempre el alto de la caja: al pasar a "En la mesa" el selector no se mueve de lugar */
  /* Reserva el alto de la caja (el selector no se mueve al cambiar de modo); la tarjeta del mozo va centrada en ese alto */
  .piece-v { min-height: calc(var(--pw) * 1.4935); justify-content: flex-end; }
  .piece-v[data-v="mesa"] { justify-content: center; }
  /* Flecha a mano de la pieza al celular: decorativa */
  .d-arrow { display: block; position: absolute; left: calc(var(--aw, 320px) + 14px); top: var(--at, calc(var(--pw) * .34)); width: max(150px, calc(617px - var(--aw, 320px) * 1.1)); aspect-ratio: 2 / 1; pointer-events: none; }
  .d-arrow svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--pliegue); stroke-linecap: round; stroke-linejoin: round; }
  .d-arrow .dots { stroke-width: 4; stroke-dasharray: .1 9; }
  .d-arrow .head { stroke-width: 3.4; }
  .d-arrow-t { position: absolute; left: 10px; top: -10px; font-size: 16px; font-weight: 800; color: var(--pliegue-txt); transform: rotate(-7deg); transform-origin: 0 100%; }
}

/* Display de mostrador: acrílico A6 vertical sobre una base de dos planos (manual 09, sin QR).
   Todo en cqw: la misma pieza sirve a cualquier tamaño, también adentro del celular. */
.disp-wrap { container-type: inline-size; width: var(--pw); }
.disp { position: relative; z-index: 1; color: var(--tinta); display: flex; flex-direction: column; aspect-ratio: 420 / 592; overflow: hidden; background: var(--papel); border-radius: 2.4cqw; box-shadow: 0 0 0 1px var(--linea), 1.6cqw 0 0 var(--carton); }
.d-band { display: flex; align-items: center; justify-content: center; gap: 2.8cqw; padding: 3cqw 5cqw; background: var(--cafe); color: var(--crema); font-size: 6.2cqw; font-weight: 900; letter-spacing: -.02em; }
.d-logo { width: 10.5cqw; height: 10.5cqw; border-radius: 50%; background: var(--crema); display: grid; place-items: center; flex: none; }
.d-logo svg { width: 60%; height: 60%; fill: none; stroke: var(--cafe); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.d-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; padding: 2cqw 6cqw 1cqw; text-align: center; }
.d-t { font-size: 8.2cqw; font-weight: 900; letter-spacing: -.04em; line-height: 1.04; }
.d-s { margin-top: 1.6cqw; font-size: max(12px, 4.3cqw); font-weight: 700; color: var(--tinta-suave); }
.d-tap { display: flex; flex-direction: column; align-items: center; gap: 2.2cqw; }
.d-target { position: relative; flex: none; width: 36cqw; height: 36cqw; border-radius: 50%; display: grid; place-items: center; }
.d-target .ring, .d-target .rip { position: absolute; border-radius: 50%; border: .8cqw solid var(--carton); }
.d-target .r1 { inset: 0; border-style: dashed; }
.d-target .r2 { inset: 13%; opacity: .6; }
.d-target .dot { width: 58%; height: 58%; border-radius: 50%; background: var(--tinta); color: var(--papel); display: grid; place-items: center; }
.d-target .dot svg { width: 54%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.d-h { font-size: 5.6cqw; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.d-fail { max-width: 82cqw; font-size: max(12px, 3.2cqw); font-weight: 700; line-height: 1.35; color: var(--pliegue-txt); } /* 5,1:1 sobre papel; nunca más grande que la bajada */
.d-foot { display: flex; justify-content: center; padding: 2.2cqw 5cqw 2.6cqw; border-top: 1px solid var(--linea); }
.d-foot .lockup { font-size: max(12px, 4.6cqw); color: var(--tinta-suave); }
/* Base: plano de arriba (pliegue) y frente (cartón), sin degradés */
.d-base { position: relative; z-index: 0; display: block; width: 82%; height: 9.4cqw; margin: -1cqw auto 0; }
.d-base i { position: absolute; left: 0; width: 100%; }
.d-base .b-top { top: 0; height: 4.4cqw; background: var(--pliegue); clip-path: polygon(3.5% 0, 96.5% 0, 100% 100%, 0 100%); }
.d-base .b-front { top: 4.4cqw; height: 5cqw; background: var(--carton); border-radius: 0 0 1.8cqw 1.8cqw; }

/* Tarjeta de mano del mozo: el diseño actual, igual que en el inicio (frente de un solo color, el del local) */
.mc-wrap { container-type: inline-size; width: var(--pm); max-width: 420px; }
.mc { display: flex; flex-direction: column; width: 100%; aspect-ratio: 856 / 540; overflow: hidden; border-radius: 5cqw; background: var(--cafe); color: var(--crema); box-shadow: var(--sombra-card), 0 0 0 1px rgb(var(--tinta-rgb) / .08); }
.mc-band { display: flex; align-items: center; gap: 2.6cqw; padding: 3.4cqw 5cqw 0; font-size: 5.2cqw; font-weight: 900; letter-spacing: -.02em; }
.mc-logo { width: 8.6cqw; height: 8.6cqw; border-radius: 50%; background: var(--crema); display: grid; place-items: center; flex: none; }
.mc-logo svg { width: 62%; height: 62%; fill: none; stroke: var(--cafe); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mc-body { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 4cqw; padding: 0 5cqw; }
.mc-h { font-size: 6.4cqw; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.mc-sub { margin-top: 1.4cqw; font-size: max(12px, 3.8cqw); font-weight: 700; color: color-mix(in srgb, var(--crema) 80%, transparent); }
.mc-nfc { position: relative; flex: none; width: 19cqw; aspect-ratio: 1; border: .7cqw dashed currentColor; border-radius: 50%; display: grid; place-items: center; }
.mc-nfc svg { width: 52%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mc-sig { padding: 0 5cqw 3.4cqw; }
.mc-sig .lockup { font-size: max(12px, 4.6cqw); color: var(--crema); --c-card: var(--papel); --c-fold: var(--linea); --c-ink: var(--tinta); }

/* ---------- Columna del celular ---------- */
.d-device { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.demo-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; }
.demo-btns .btn { font-size: 15px; padding: 0 18px; min-height: 44px; }
.rs-i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 1040px) { .rs-i { display: none; } .demo-btns { flex-wrap: nowrap; } .demo-btns .btn { padding: 0 16px; white-space: nowrap; } }
.demo-btns .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.demo-btns .btn[aria-disabled="true"]:hover { transform: none; }
.demo-btns .btn-dark[aria-disabled="true"]:hover { background: var(--tinta); }
.demo-btns .btn-ghost[aria-disabled="true"]:hover { background: transparent; }
/* Un solo botón principal por momento: "Acercar" y "Canjear premio" comparten lugar y se cruzan con un fade */
.btn-slot { display: grid; }
.btn-slot > .btn { grid-area: 1 / 1; transition: transform 160ms ease-out, background-color var(--dur-fast), box-shadow var(--dur-fast), opacity var(--dur-fast), visibility var(--dur-fast); }
.demo-btns .btn.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.estado { min-height: 3em; max-width: 52ch; text-align: center; font-size: 15px; font-weight: 400; line-height: 1.5; color: var(--tinta); }
.demo-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: 15px; font-weight: 700; color: var(--tinta); text-decoration: underline; text-decoration-color: var(--carton); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.demo-link:hover { text-decoration-color: var(--tinta); }
/* Al completarse el primer sello, el link se cruza (fade de 300 ms) con un botón secundario que va al mismo lugar */
.cta-slot { display: grid; justify-items: center; }
.cta-slot > * { grid-area: 1 / 1; transition: opacity 300ms ease-out, visibility 300ms; }
.cta-slot .is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.demo-cta { min-height: 44px; padding: 0 20px; font-size: 15px; }
.demo-note { max-width: 46ch; text-align: center; font-size: 14px; color: var(--tinta-suave); }
@media (min-width: 1040px) { .estado { min-height: 1.5em; } }
/* En el celu, el botón principal queda siempre a mano: barra pegada abajo mientras se ve la demo */
@media (max-width: 1039px) {
  .d-device .demo-btns { position: sticky; bottom: 0; z-index: 30; align-self: stretch; flex-wrap: nowrap; margin: 0 -20px; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--papel) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .d-device .demo-btns .btn-slot { flex: 1 1 auto; max-width: 300px; }
  .d-device .demo-btns .btn-slot > .btn { width: 100%; }
  /* Reiniciar: solo el ícono (el nombre sigue en aria-label), para que todo entre en un renglón */
  #btnReset { flex: none; width: 44px; padding: 0; justify-content: center; }
  #btnReset .rs-t { display: none; }
}

/* ---------- Celular ---------- */
/* --s la calcula demo.js solo en pantallas anchas, para que el celular entre en el primer pantallazo */
.phone-fit { --s: 1; position: relative; flex: none; min-height: 0; width: calc(min(320px, 100%) * var(--s)); aspect-ratio: 320 / 690; }
.phone { position: relative; width: calc(100% / var(--s)); aspect-ratio: 320 / 690; padding: 11px; border-radius: 52px; background: var(--dev-black); transform: scale(var(--s)); transform-origin: 0 0; box-shadow: inset 0 0 0 1.5px var(--dev-edge), inset 0 0 0 4px var(--dev-body), var(--sombra-card); }
.phone::before, .phone::after { content: ""; position: absolute; background: var(--dev-key); border-radius: 3px; }
.phone::before { right: -3px; top: 25%; width: 3px; height: 70px; }
.phone::after { left: -3px; top: 20%; width: 3px; height: 44px; box-shadow: 0 64px 0 var(--dev-key); }
.phone.android { padding: 9px; border-radius: 40px; box-shadow: inset 0 0 0 1.5px var(--dev-edge), inset 0 0 0 3.5px var(--dev-body-and), var(--sombra-card); }
/* La isla del iPhone y la cámara del Samsung flotan adentro de la pantalla, separadas del marco */
.island, .punch { position: absolute; z-index: 40; left: 50%; transform: translateX(-50%); background: var(--dev-black); pointer-events: none; }
.island { top: 20px; width: 96px; height: 28px; border-radius: 14px; }
.punch { top: 19px; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--dev-body); }
.phone.android .island, .phone.ios .punch { display: none; }
/* clip-path además de overflow: Safari no recorta las esquinas cuando adentro hay capas con transform (dejaba puntas blancas) */
.screen { --r: 41px; position: relative; isolation: isolate; width: 100%; height: 100%; overflow: hidden; border-radius: var(--r); clip-path: inset(0 round var(--r)); -webkit-mask-image: -webkit-radial-gradient(white, black); }
.android .screen { --r: 31px; }
.scr-apple { background: var(--ios-bg); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Nunito", sans-serif; }
.scr-google { background: var(--and-bg); font-family: "Roboto", "Google Sans", system-ui, "Nunito", sans-serif; }

.statusbar { display: flex; justify-content: space-between; align-items: center; color: var(--tinta); font-weight: 600; }
.statusbar svg { fill: currentColor; }
.scr-apple .statusbar { height: 48px; padding: 0 26px 4px 34px; font-size: 15px; } /* centrada con la isla */
.scr-google .statusbar { height: 34px; padding: 0 22px; font-size: 13px; font-weight: 500; } /* centrada con la cámara */
.sb-icons { display: flex; gap: 5px; align-items: center; }
.sb-icons svg { height: 11px; width: auto; }

.lg { border-radius: 50%; background: var(--crema); color: var(--cafe); display: grid; place-items: center; flex: none; }
.lg svg { width: 64%; height: 64%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Apple Wallet */
.ios-nav { display: flex; justify-content: space-between; align-items: center; padding: 2px 16px 10px; }
.ios-nav .dots { width: 30px; height: 30px; border-radius: 50%; background: var(--ios-chip); display: grid; place-items: center; color: var(--ios-blue); font-weight: 900; letter-spacing: 1px; font-size: 13px; }
.ios-nav .done { color: var(--ios-blue); font-weight: 600; font-size: 16px; }
.pass { margin: 0 12px; }
.face { overflow: hidden; border-radius: 14px; background: var(--cafe); color: var(--crema); box-shadow: 0 1px 2px rgb(var(--tinta-rgb) / .12), 0 14px 28px -12px rgb(var(--tinta-rgb) / .35); --lbl: color-mix(in srgb, var(--crema) 72%, transparent); --c-off: color-mix(in srgb, var(--crema) 55%, transparent); }
.pass-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px 9px; }
.pass-logo { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.pass-logo .iso { width: 28px; height: 22px; flex: none; }
.field { min-width: 0; }
.field .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lbl); }
.field .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 500; line-height: 1.2; }
.field.right { text-align: right; }
.field .val.big { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.strip { display: flex; align-items: center; gap: 10px; padding: 8px 12px; overflow: hidden; aspect-ratio: 375 / 144; background: var(--franja); }
.who { display: grid; justify-items: center; flex: 0 0 auto; gap: 4px; width: 58px; }
.who .lg { width: 36px; height: 36px; }
.who span:last-child { font-size: 10.5px; font-weight: 700; line-height: 1.1; text-align: center; }
.pass-fields { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px 14px; }
.wallet-stack { position: absolute; left: 12px; right: 12px; bottom: 0; height: 58px; }
.wallet-stack div { position: absolute; left: 0; right: 0; height: 60px; border-radius: 12px 12px 0 0; }
.wallet-stack div:nth-child(1) { bottom: 18px; background: var(--stack-1); }
.wallet-stack div:nth-child(2) { bottom: 0; background: var(--stack-2); }
.home-bar { position: absolute; bottom: 7px; left: 50%; z-index: 5; transform: translateX(-50%); width: 36%; height: 5px; border-radius: 3px; background: var(--tinta); opacity: .85; }

/* Google Wallet */
.g-appbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 12px; color: var(--tinta); }
.g-appbar svg { width: 22px; height: 22px; }
.gcard { position: relative; margin: 0 14px; overflow: hidden; border-radius: 22px; background: var(--cafe); color: var(--blanco); --c-off: color-mix(in srgb, var(--crema) 55%, transparent); box-shadow: 0 1px 3px rgb(var(--tinta-rgb) / .14), 0 10px 24px -12px rgb(var(--tinta-rgb) / .35); }
.g-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px 11px; border-bottom: 1px solid color-mix(in srgb, var(--blanco) 18%, transparent); }
.g-head .lg { width: 32px; height: 32px; }
.g-issuer { font-weight: 500; font-size: 15px; }
.g-title { padding: 11px 16px 2px; font-size: 21px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.g-rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 6px 16px 11px; }
.g-lbl { font-size: 11.5px; color: color-mix(in srgb, var(--blanco) 78%, transparent); }
.g-val { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.g-val.big { font-size: 16px; font-weight: 600; }
.hero { display: flex; align-items: center; aspect-ratio: 1032 / 336; padding: 8px 12px; background: var(--franja); }
.g-msg { padding: 9px 16px 14px; font-size: 12.5px; color: color-mix(in srgb, var(--blanco) 82%, transparent); }
.g-details { margin: 14px 14px 0; padding: 4px 14px; border-radius: 16px; background: var(--blanco); color: var(--tinta-2); font-size: 12.5px; }
.g-details div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; }
.g-details div + div { border-top: 1px solid var(--linea); }
.g-details span:last-child { color: var(--tinta-suave); text-align: right; }
.g-gesture { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 30%; height: 4px; border-radius: 2px; background: var(--tinta); opacity: .7; }

/* Sellos (compartido por las dos Wallets) */
.stamps { display: grid; flex: 1; min-width: 0; gap: 6px; justify-content: center; align-content: center; }
.slot { aspect-ratio: 1; display: grid; place-items: center; border: 1.5px dashed var(--c-off); border-radius: 50%; color: var(--cafe); }
.slot.filled { background: var(--crema); border: 1.5px solid var(--crema); }
.slot > svg { width: 64%; height: 64%; overflow: visible; }
.cup { opacity: 0; transition: opacity var(--dur-fast); }
.slot.filled .cup { opacity: 1; }
.cup .outline { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cup .liquid { fill: currentColor; transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform var(--dur-base) var(--ease-out) .1s; }
.slot.filled .liquid { transform: scaleY(1); }
.cup .steam path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; opacity: 0; transition: opacity var(--dur-fast) .3s; }
.slot.filled .steam path { opacity: .85; }
.slot.prize { border: 1.8px solid var(--crema); color: var(--crema); }
.slot.prize svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.slot.prize.filled { background: var(--sello); border-color: var(--sello); color: var(--blanco); }
.slot.pop { animation: pop var(--dur-base) var(--ease-pop); }
@keyframes pop { from { transform: scale(.55); } 60% { transform: scale(1.18); } to { transform: scale(1); } }
.bump { animation: bump var(--dur-fast) var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.018); } }
.enter { animation: passIn var(--dur-base) var(--ease-out) both; }
@keyframes passIn { from { opacity: 0; transform: translateY(40px) scale(.95); } }

/* Avisos en el celular */
.notif { position: absolute; z-index: 30; left: 8px; right: 8px; opacity: 0; transform: translateY(-150%); pointer-events: none; transition: transform var(--dur-base) var(--ease-pop), opacity var(--dur-fast); }
.notif.show { opacity: 1; transform: none; }
.ios-n { top: 50px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 20px; background: color-mix(in srgb, var(--blanco) 90%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 10px 30px -8px rgb(var(--tinta-rgb) / .35); color: var(--tinta); font-size: 13.5px; line-height: 1.3; }
.ios-n .n-icon { width: 36px; height: 36px; border-radius: 9px; }
.ios-n .n-title { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.ios-n .n-title small { font-weight: 400; color: var(--tinta-suave); }
.and-n { top: 38px; padding: 12px 14px; border-radius: 22px; background: var(--blanco); color: var(--tinta); box-shadow: 0 8px 24px -6px rgb(var(--tinta-rgb) / .3); font-size: 13.5px; line-height: 1.3; }
.and-n .n-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; color: var(--tinta-suave); }
.and-n .n-icon { width: 18px; height: 18px; border-radius: 50%; }
.and-n .n-body b { display: block; font-size: 14px; font-weight: 600; }
.n-icon { display: grid; place-items: center; flex: none; background: var(--cafe); color: var(--crema); }
.n-icon svg { width: 72%; height: 72%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.n-msg { display: block; }

/* Aviso de Cartoncito en la pantalla de bloqueo: se toca para abrir la tarjeta */
button.notif { width: calc(100% - 16px); border: 0; font-family: inherit; text-align: left; cursor: pointer; visibility: hidden; transition: transform var(--dur-base) var(--ease-pop), opacity var(--dur-fast), visibility var(--dur-fast); }
button.notif.show { visibility: visible; pointer-events: auto; }
.n-ct { background: var(--papel); }
.n-ct svg { width: 78%; height: 78%; stroke: none; }
.n-ct .iso { height: auto; }
.n-text { display: block; min-width: 0; }

/* Celebración con sellos */
.burst { position: absolute; z-index: 25; left: 50%; top: 40%; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; animation: burst 480ms var(--ease-out) var(--d) both; }
.burst svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.burst.b1 { color: var(--crema); }
.burst.b2 { color: var(--carton); }
.burst.b3 { color: var(--sello); }
@keyframes burst { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.15) rotate(var(--r)); } }

/* El toque: la pieza sube desde abajo y llega la página del sello */
.gesture { position: absolute; inset: 0; z-index: 26; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 0 30px; background: rgb(var(--tinta-rgb) / .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: var(--papel); font-family: "Nunito", system-ui, sans-serif; perspective: 700px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur-fast), visibility var(--dur-fast); }
.gesture.show { opacity: 1; visibility: visible; }
.g-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 88%; min-height: 32px; padding: 6px 14px; border-radius: 999px; background: rgb(var(--tinta-rgb) / .8); text-align: center; font-weight: 800; font-size: 13px; line-height: 1.3; }
.g-pill svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gesture.hit .g-pill { background: var(--papel); color: var(--tinta); }
/* Se acerca: sube inclinada, como si el celu bajara sobre la pieza, y se apoya con un rebote corto */
.g-obj { position: relative; transform-origin: 50% 100%; animation: approach 480ms cubic-bezier(.2,.9,.3,1.15) both; }
.gesture.hit .g-obj { animation: approach 480ms cubic-bezier(.2,.9,.3,1.15) both, press 260ms var(--ease-out); }
@keyframes approach { from { opacity: 0; transform: translateY(70%) rotateX(38deg) scale(.82); } 60% { opacity: 1; } }
@keyframes press { 40% { transform: scale(.96); } }
/* Ondas que salen del círculo al contacto (las agrega demo.js) */
.rip { position: absolute; inset: -.5cqw; border-radius: 50%; border: .9cqw solid currentColor; pointer-events: none; animation: rip 700ms var(--ease-out) var(--d, 0ms) both; }
.d-target .rip { border-color: var(--sello); }
@keyframes rip { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.3); } }
/* Vibración al sumar: el celular entero, corto y chiquito */
.phone.buzz { animation: buzz 260ms linear; }
@keyframes buzz { 20% { translate: -1.5px 0; } 40% { translate: 1.5px 0; } 60% { translate: -1px 0; } 80% { translate: 1px 0; } }

/* Páginas del celular: sello y canje */
.tap-page { position: absolute; inset: 0; z-index: 27; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 20px 24px; text-align: center; background: var(--cafe); color: var(--crema); font-family: "Nunito", system-ui, sans-serif; opacity: 0; transform: translateY(40px); pointer-events: none; transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast); }
.tap-page.show { opacity: 1; transform: none; }
.tap-page.canje.show { pointer-events: auto; cursor: pointer; }
.tp-check { width: 104px; height: 104px; margin-bottom: 10px; border-radius: 50%; background: var(--crema); color: var(--cafe); display: grid; place-items: center; }
.tp-check svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tp-check.gift { background: var(--sello); color: var(--blanco); }
.tp-big { font-size: 28px; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; }
.tp-count { font-size: 44px; font-weight: 900; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tp-count small { font-size: 26px; color: color-mix(in srgb, var(--crema) 75%, transparent); }
.tp-name { margin-top: 8px; font-size: 20px; font-weight: 800; }
.tp-time { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tp-sub, .tp-hint { max-width: 230px; font-size: 14px; color: color-mix(in srgb, var(--crema) 80%, transparent); }
.tp-hint { margin-top: 10px; font-size: 12px; }

/* La pieza del local dentro del celular: la misma de la izquierda, armada a 320 px y escalada (--k) */
.stand-fit { position: relative; flex: none; }
.stand-scale { width: 320px; transform: scale(var(--k)); transform-origin: 0 0; }
.stand-scale .disp-wrap, .stand-scale .mc-wrap { width: 320px; max-width: none; }
/* En el celular la pieza va sin los textos chicos; el título, el círculo y la firma crecen (al escalar con --k siguen arriba de 12 px) */
.stand-scale .d-s, .stand-scale .d-fail, .stand-scale .mc-sub { display: none; }
.stand-scale .d-band { font-size: 6.8cqw; }
.stand-scale .d-t { font-size: 10.6cqw; }
.stand-scale .d-target { width: 46cqw; height: 46cqw; }
.stand-scale .d-h { font-size: 6.8cqw; }
.stand-scale .d-foot .lockup, .stand-scale .mc-sig .lockup { font-size: 6cqw; }
.stand-scale .mc-h { font-size: 7.6cqw; }
.stand-scale .mc-nfc { width: 23cqw; }
.stand-fit.m-caja { --k: .76; width: calc(320px * var(--k)); height: calc(478px * var(--k)); }
.stand-fit.m-mesa { --k: .9; width: calc(320px * var(--k)); height: calc(202px * var(--k)); }
.lock-stand { display: block; flex: none; margin: auto 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform var(--dur-base) var(--ease-pop), opacity var(--dur-base); }
.lock-stand.tapped { transform: scale(.88); opacity: .3; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .rip { display: none; }
  .phone.buzz, .g-obj, .gesture.hit .g-obj { animation: none; }
}

/* ---------- Alta dentro del celular ---------- */
.flow { position: absolute; inset: 0; z-index: 20; transition: transform var(--dur-base) var(--ease-out), visibility var(--dur-base); }
.flow.done { transform: translateY(-100%); visibility: hidden; pointer-events: none; }
.flow.instant, .flow.instant * { transition: none !important; }
.fs { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateX(28px); transition: opacity var(--dur-fast), transform var(--dur-base) var(--ease-out), visibility var(--dur-fast); }
.fs.active { opacity: 1; visibility: visible; transform: none; }
.fs.back { transform: translateX(-28px); }

.fs-lock {
  align-items: center; color: var(--blanco);
  background:
    radial-gradient(120% 70% at 20% 0%, var(--wp-i-0) 0%, transparent 60%),
    linear-gradient(175deg, var(--wp-i-1) 0%, var(--wp-i-2) 48%, var(--wp-i-3) 100%);
}
.android .fs-lock {
  background:
    radial-gradient(100% 60% at 80% 10%, var(--wp-a-0) 0%, transparent 60%),
    linear-gradient(170deg, var(--wp-a-1) 0%, var(--wp-a-2) 50%, var(--wp-a-3) 100%);
}
.fs-lock .statusbar { width: 100%; color: var(--blanco); }
/* Un velo apenas más oscuro arriba, para que la hora llegue a 4,5:1 sobre el brillo del fondo del iPhone */
.scr-apple .fs-lock .statusbar { background: linear-gradient(rgb(var(--tinta-rgb) / .3), rgb(var(--tinta-rgb) / 0)); }
.lock-date { margin-top: 10px; font-size: 15px; font-weight: 600; text-align: center; }
.lock-time { margin-top: 0; font-size: 74px; font-weight: 700; letter-spacing: -2px; line-height: 1; text-align: center; }
.android .lock-time { margin-top: 12px; font-size: 64px; font-weight: 400; letter-spacing: -1px; line-height: .95; }
.android .lock-date { margin-top: 8px; font-size: 14px; font-weight: 500; }
.flow-hint { margin: 12px 0 30px; max-width: 88%; padding: 8px 14px; border-radius: 999px; background: rgb(var(--tinta-rgb) / .7); color: var(--papel); font: 700 13px/1.3 "Nunito", sans-serif; text-align: center; }

.fs-web { background: var(--blanco); color: var(--tinta); }
.web-page { flex: 1; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; font-family: "Nunito", sans-serif; }
.web-page::-webkit-scrollbar { display: none; }
.web-hero { padding: 12px 18px 16px; border-radius: 0 0 24px 24px; background: var(--cafe); color: var(--crema); text-align: center; }
.web-hero .lg { width: 46px; height: 46px; margin: 0 auto; }
.web-hero h3 { margin-top: 6px; font-size: 18.5px; font-weight: 900; line-height: 1.15; letter-spacing: -.01em; }
.web-hero p { margin-top: 4px; font-size: 13px; opacity: .9; }
.autofill { min-height: 44px; margin-top: 8px; padding: 0 16px; border: 1.5px dashed color-mix(in srgb, var(--crema) 70%, transparent); border-radius: 999px; background: transparent; color: var(--crema); font: 800 13px/1 "Nunito", sans-serif; cursor: pointer; }
.autofill:hover { background: color-mix(in srgb, var(--crema) 15%, transparent); }
.reg { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 18px; }
.reg-field { display: flex; flex-direction: column; gap: 5px; }
.reg-label { font-size: 12.5px; font-weight: 800; color: var(--tinta-2); }
.inp { width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 1.5px solid var(--linea); border-radius: 12px; background: var(--papel); color: var(--tinta); font: 600 16px "Nunito", sans-serif; -webkit-appearance: none; appearance: none; }
.inp::placeholder { color: var(--tinta-suave); font-weight: 500; }
.inp:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; }
.wa-wrap { display: flex; overflow: hidden; border: 1.5px solid var(--linea); border-radius: 12px; background: var(--papel); }
.wa-wrap:focus-within { outline: 3px solid var(--tinta); outline-offset: 2px; }
.wa-wrap .inp { border: 0; border-radius: 0; background: transparent; }
.wa-wrap .inp:focus-visible { outline: 0; }
.wa-pre { display: grid; place-items: center; padding: 0 10px; border-right: 1.5px solid var(--linea); background: var(--papel-2); color: var(--tinta-2); font-weight: 800; font-size: 15px; white-space: nowrap; }
.reg-err { display: none; padding-left: 10px; border-left: 4px solid var(--sello); color: var(--tinta); font-size: 12px; font-weight: 800; }
.invalid .reg-err { display: block; }
.invalid .inp, .invalid .wa-wrap { border-color: var(--sello); }
.reg-check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--tinta-2); font-size: 12.5px; line-height: 1.35; cursor: pointer; }
.reg-check input { flex: none; width: 22px; height: 22px; accent-color: var(--cafe); cursor: pointer; }
.perm-hint { margin-top: -4px; padding-left: 10px; border-left: 4px solid var(--carton); color: var(--tinta); font-size: 12px; font-weight: 800; }
.web-btn { height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--tinta); color: var(--papel); font: 700 15px "Nunito", sans-serif; cursor: pointer; }
.android .web-btn { border-radius: 999px; }
.web-btn:disabled { opacity: .35; cursor: not-allowed; }
.web-btn svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.web-fine { margin-top: -3px; text-align: center; font-size: 12px; color: var(--tinta-suave); }
.i-lock { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.safari-bar { padding: 8px 14px 24px; background: var(--papel-2); border-top: 1px solid var(--linea); }
.chrome-bar { padding: 2px 12px 8px; border-bottom: 1px solid var(--linea); }
.url { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 9px; border-radius: 12px; background: var(--ios-chip); color: var(--tinta); font: 600 13px "Nunito", sans-serif; }
.chrome-bar .url { justify-content: flex-start; padding: 8px 14px; border-radius: 999px; background: var(--and-bg); }

/* Foco visible: que respete la forma de cada botón (la regla global lo redondea a 8 px) */
.seg button:focus-visible, .autofill:focus-visible, .android .web-btn:focus-visible, .btn:focus-visible { border-radius: 999px; }
.web-btn:focus-visible { border-radius: 12px; }
.lock-stand:focus-visible { border-radius: 14px; }
button.ios-n:focus-visible { border-radius: 20px; }
button.and-n:focus-visible { border-radius: 22px; }
.web-hero .autofill:focus-visible { outline-color: var(--crema); }
.fs-lock :focus-visible { outline-color: var(--papel); }
.fs-lock button.notif:focus-visible { outline-color: var(--tinta); }

/* ---------- Banda final: la ilustración (el resto de la banda está en styles.css) ----------
   Sin degradés, sin sombras, sin pastillas. El rojo: el subrayado, el último sello y el puntito de la etiqueta. */
/* Ilustración: dos tarjetas apiladas. La de atrás, corrida 16 px hacia arriba y a la derecha */
.cta-art { position: relative; width: 100%; max-width: 440px; justify-self: center; padding: 16px 16px 0 0; }
.ca-back { position: absolute; top: 0; right: 0; bottom: 16px; left: 16px; border-radius: var(--radius); background: var(--pliegue); }
.ca-card { position: relative; border-radius: var(--radius); background: var(--papel); color: var(--tinta); }
.ca-strip { padding: 12px 24px; border-radius: var(--radius) var(--radius) 0 0; background: var(--carton); font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--tinta); }
.ca-body { padding: 22px 24px 26px; }
.ca-title { font-size: 22px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.ca-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; }
.ca-count b { font-size: 46px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.ca-count span { font-size: 15px; font-weight: 700; color: var(--tinta-suave); }
.ca-seals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; max-width: 320px; margin-top: 22px; }
.sl { position: relative; aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--tinta); }
.sl i { position: absolute; inset: -2px; border-radius: 50%; background: var(--tinta); }
.sl.last i { background: var(--sello); }
.ca-sticker { position: absolute; top: -12px; right: -12px; padding: 7px 14px 8px; border: 2px solid var(--tinta); border-radius: 10px; background: var(--carton); color: var(--tinta); font-size: 17px; font-weight: 900; line-height: 1.1; transform: rotate(-6deg); }

/* Entrada única al aparecer en pantalla (site.js pone .in). Sin JS, o sin animaciones, todo queda a la vista */
.js .cta-band:not(.in) .sl i, .js .cta-band:not(.in) .ca-sticker { opacity: 0; }
.cta-band.in .sl i { animation: sealIn 200ms var(--ease-out) calc(300ms + var(--i) * 100ms) backwards; }
.cta-band.in .sl.last i { animation: sealPop 300ms var(--ease-pop) 1100ms backwards; }
.cta-band.in .ca-sticker { animation: stickIn 250ms var(--ease-pop) 1350ms backwards; }
@keyframes sealIn { from { opacity: 0; transform: scale(.4); } }
@keyframes sealPop { from { opacity: 0; transform: scale(.2); } }
@keyframes stickIn { from { opacity: 0; transform: rotate(-6deg) scale(.5); } }
@media (prefers-reduced-motion: reduce) {
  .cta-band .sl i, .cta-band .ca-sticker { animation: none !important; opacity: 1 !important; }
}
