:root {
  --ink: #0b0a0d;
  --ink-2: #16131b;
  --ink-3: #221d29;
  --rojo: #e0304e;
  --crema: #ece6cf;
  --crema-2: #a9a491;
  --azul: #2f6fb0;
  --morado: #3b2550;
  --neon: #ff3fa4;
  --cian: #3ff0ff;
  --verde-wa: #25d366;
  --r: 18px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--ink); color: var(--crema);
  font: 400 16px/1.45 Rubik, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
body.lock { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--cian); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Apertura ---------- */

/* ---------- Cabecera ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: color-mix(in srgb, var(--ink) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid #ffffff10; }
.top__brand { display: block; }
.top__brand img { width: auto; height: 40px; }
.top__nav { margin-left: auto; display: flex; gap: 4px; }
.top__nav a { color: var(--crema); text-decoration: none; font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 99px; }
.top__nav a:hover { background: var(--ink-3); }

/* ---------- Portada ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cover {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: calc(100svh - 61px);
  display: grid; place-content: center; justify-items: center; gap: clamp(18px, 4svh, 40px);
  padding: 24px 16px 32px; text-align: center;
  background: linear-gradient(to bottom, #000 0%, #000 70%, var(--ink) 100%);
}
/* Luz roja detrás del logo: un solo color de la marca, sin movimiento continuo */
.cover::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 42%;
  width: min(140vw, 900px); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, #e0304e30, #e0304e10 45%, transparent 75%);
  opacity: var(--glow, 1);
}
.cover__logo { position: relative; margin: 0; width: min(78vw, calc(48svh * .9), 440px); aspect-ratio: 526 / 584; }
.cover__part { position: absolute; inset: 0; width: 100%; height: 100%; }
/* El logo se recorta en tres franjas exactas (ilustración, CHUPE, Y ME DEJA) para presentarlas por turnos */
.cover__part--art { clip-path: inset(0% 0% 35.7% 0%); }
.cover__part--chupe { clip-path: inset(64.3% 0% 13.9% 0%); }
.cover__part--deja { clip-path: inset(86.1% 0% 0% 0%); }
.cover__copy { display: grid; justify-items: center; gap: 18px; }
.cover__lead { margin: 0; max-width: 26ch; font-size: clamp(17px, 4.4vw, 20px); line-height: 1.35; color: var(--crema); }
.cover__cta { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 220px; padding: 16px 32px; text-decoration: none; }
html.intro .cover__part--art { clip-path: inset(100% 0% 35.7% 0%); }
html.intro .cover__part--chupe { clip-path: inset(64.3% 100% 13.9% 0%); }
html.intro .cover__part--deja { clip-path: inset(86.1% 100% 0% 0%); }
html.intro .cover__copy > * { opacity: 0; }
html.intro .cover { --glow: 0; }

/* ---------- Hero ---------- */
.hero { padding: 40px 16px 4px; max-width: 1120px; margin: 0 auto; }
.hero__title { margin: 0 0 8px; font-weight: 900; font-size: clamp(44px, 13vw, 92px); line-height: .9; text-transform: uppercase; letter-spacing: -.025em; }
.hero__title span { color: var(--rojo); }
.hero__sub { margin: 0; max-width: 34ch; color: var(--crema-2); }

/* ---------- Constructor ---------- */
.builder { max-width: 1120px; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 4px; }
.stage {
  position: sticky; top: 60px; z-index: 10;
  display: grid; grid-template-columns: minmax(130px, 42%) 1fr; align-items: end; gap: 14px;
  margin: 14px -16px 8px; padding: 6px 16px 14px;
  background:
    radial-gradient(60% 70% at 22% 40%, #ff3fa42e, transparent 70%),
    radial-gradient(50% 60% at 95% 0%, #3ff0ff14, transparent 70%),
    linear-gradient(to bottom, var(--ink) 0%, #120f16 100%);
  box-shadow: 0 14px 24px -12px #000;
}
.stage__cup { height: clamp(200px, 32vh, 270px); }
.stage__cup svg { width: 100%; height: 100%; overflow: visible; }
.stage__info { padding-bottom: 10px; min-width: 0; }
.stage__type { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--crema-2); }
.stage__flavors { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-weight: 700; font-size: 16px; line-height: 1.25; }
.stage__flavors span { display: inline-flex; align-items: center; gap: 6px; }
.stage__flavors span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 10px var(--fc); }
.stage__flavors .is-empty { font-weight: 400; color: var(--crema-2); font-size: 14px; }
.stage__flavors .is-empty::before { display: none; }
.stage__price { margin: 10px 0 0; font-weight: 900; font-size: clamp(30px, 9vw, 44px); letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stage__price.is-text { font-size: 18px; font-weight: 700; color: var(--crema-2); letter-spacing: 0; }

.steps { display: grid; gap: 26px; padding-top: 6px; }
.step { border: 0; padding: 0; margin: 0; min-width: 0; transition: opacity .25s ease; }
.step:disabled { opacity: .35; }
.step legend { font-weight: 900; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; padding: 0; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; width: 100%; }
.step legend small { margin-left: auto; font-weight: 500; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--crema-2); font-variant-numeric: tabular-nums; }

/* Tipo: texto con una tinta que se desplaza a la opción elegida */
.types { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 18px; background: #ffffff0a; }
.type { position: relative; z-index: 1; display: grid; gap: 2px; text-align: left; padding: 12px 14px; min-height: 56px; border: 0; border-radius: 14px; background: none; transition: color .25s ease, transform .12s ease-out; }
.type__name { font-weight: 700; font-size: 17px; }
.type__meta { font-size: 12.5px; color: var(--crema-2); transition: color .25s ease; }
.type[aria-pressed="true"] { color: var(--ink); }
.type[aria-pressed="true"] .type__meta { color: #3a3540; }
.type__ink { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 14px; background: var(--crema); box-shadow: 0 6px 18px -6px #0008; opacity: 0;
  transition: transform .42s var(--ease-out), width .42s var(--ease-out), height .42s var(--ease-out), opacity .2s ease; }

/* Tamaño: el vaso crece como en la vida real */
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-items: end; }
.size { display: grid; justify-items: center; gap: 4px; padding: 8px 2px 10px; border: 0; border-radius: 14px; background: none; color: var(--crema-2); transition: color .2s ease, background-color .2s ease; }
.size .glyph { width: 30px; height: 36px; transition: transform .35s var(--ease-out); }
.size .glyph path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; transition: fill .25s ease, stroke .25s ease; }
.size__oz { font-weight: 900; font-size: 20px; color: var(--crema); letter-spacing: -.01em; }
.size__oz small { font-size: 12px; font-weight: 500; }
.size__price { font-size: 13px; font-variant-numeric: tabular-nums; }
.size[aria-pressed="true"] { background: #ffffff0d; color: var(--crema); }
.size[aria-pressed="true"] .glyph { transform: translateY(-2px); }
.size[aria-pressed="true"] .glyph path { fill: var(--neon); stroke: var(--neon); }

/* Sabores: cada uno se ve como el granizado que vas a recibir */
.flavors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 6px; }
.flavor { display: grid; justify-items: center; gap: 8px; padding: 4px 2px; border: 0; background: none; text-align: center; transition: opacity .25s ease; }
.flavor__scoop { position: relative; width: 58px; height: 58px; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, #ffffff55 0 4%, transparent 26%),
    radial-gradient(circle at 26% 46%, #ffffff50 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 56% 78%, #00000030 0 2px, transparent 3px),
    radial-gradient(circle at 70% 64%, #ffffff40 0 2px, transparent 3px),
    radial-gradient(circle at 40% 70%, #ffffff55 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 62% 34%, #ffffff60 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 50% 45%, var(--fc) 40%, color-mix(in srgb, var(--fc) 62%, #000) 100%);
  box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--fc) 70%, transparent), inset 0 -4px 8px #0004;
  transition: transform .3s var(--ease-out), box-shadow .3s ease; }
.flavor__scoop::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--crema); opacity: 0; transform: scale(.92); transition: opacity .2s ease, transform .3s var(--ease-out); }
/* El número vive dentro del círculo: no depende del nombre ni del ancho de pantalla */
.flavor__scoop b { position: absolute; inset: 0; margin: auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--crema); font-size: 15px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 2px 6px #0006; opacity: 0; transform: scale(.7); transition: opacity .18s ease, transform .3s var(--ease-out); }
.flavor__name { min-height: 2.4em; max-width: 100%; overflow-wrap: anywhere; font-weight: 500; font-size: 14px; line-height: 1.2; color: var(--crema-2); transition: color .2s ease; }
.flavor[aria-pressed="true"] .flavor__scoop::after { opacity: 1; transform: none; }
.flavor[aria-pressed="true"] .flavor__scoop b { opacity: 1; transform: none; }
.flavor[aria-pressed="true"] .flavor__name { color: var(--crema); font-weight: 700; }
.flavor.is-full { opacity: .32; cursor: not-allowed; }
.flavor.is-full .flavor__scoop { box-shadow: none; }
.flavor:active .flavor__scoop, .size:active .glyph, .type:active { transform: scale(.95); transition-duration: .1s; }
@media (hover: hover) and (pointer: fine) {
  .flavor:not(.is-full):hover .flavor__scoop { transform: translateY(-2px); }
  .size:hover { color: var(--crema); }
}

.step--add { display: flex; gap: 10px; align-items: stretch; }
.qty { display: flex; align-items: center; border-radius: 99px; background: var(--ink-3); }
.qty button { width: 44px; height: 52px; border: 0; background: none; font-size: 22px; font-weight: 700; }
.qty output { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty--sm button { width: 36px; height: 38px; font-size: 18px; }

.btn { border: 0; border-radius: 99px; padding: 14px 20px; min-height: 52px; font-weight: 700; font-size: 16px; transition: transform .12s ease-out, background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--primary { flex: 1; background: var(--rojo); color: #fff; box-shadow: 0 10px 22px -10px #000; font-variant-numeric: tabular-nums; }
.btn--primary:disabled { background: var(--ink-3); color: var(--crema-2); box-shadow: none; cursor: not-allowed; }
.btn--wa { width: 100%; background: var(--verde-wa); color: #062b14; }
.btn--ghost { width: 100%; background: none; color: var(--crema-2); text-decoration: underline; text-underline-offset: 3px; }

.note { margin: 8px 0 0; font-size: 14px; color: var(--crema-2); }
.note--error { color: #ff8da1; }
.note--error.is-ok { color: var(--cian); }
#addMsg:empty { display: none; }

/* ---------- Galería ---------- */
.gallery { max-width: 1120px; margin: 0 auto; padding: 28px 0 16px; }
.gallery h2, .gallery__sub { padding: 0 16px; }
.gallery h2 { margin: 0; font-weight: 900; text-transform: uppercase; font-size: 28px; }
.gallery__sub { margin: 4px 0 14px; color: var(--crema-2); font-size: 14px; }
.gallery__track { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 340px); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; padding: 0 16px 8px; overscroll-behavior-x: contain; scrollbar-width: none; }
.gallery__track::-webkit-scrollbar { display: none; }
/* Las tres fotos son verticales (~3:4): se muestran en su proporción original, sin recortes */
.gallery__track img { width: 100%; height: auto; aspect-ratio: 652 / 873; object-fit: cover; object-position: 50% 50%; border-radius: var(--r); scroll-snap-align: start; background: var(--ink-2); }

.foot { padding: 32px 16px calc(110px + var(--safe-b)); text-align: center; color: var(--crema-2); font-size: 13px; display: grid; justify-items: center; gap: 8px; }
.foot img { width: 96px; }
.foot a { color: var(--neon); font-weight: 700; font-size: 15px; }
.foot p { max-width: 40ch; margin: 0; }

/* ---------- Barra de pedido ---------- */
.bar { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border: 0; border-radius: 99px; background: var(--rojo); color: #fff; font-weight: 700; box-shadow: 0 12px 28px -6px #000c; }
.bar__count { display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 50%; background: var(--crema); color: var(--ink); }
.bar__total { margin-left: auto; }
.bar.is-bump { animation: bump .32s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.03); } }

/* ---------- Hoja de pedido ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet__backdrop { position: absolute; inset: 0; background: #000b; opacity: 0; transition: opacity .28s; }
.sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--ink-2); border-radius: 24px 24px 0 0; padding: 0 16px calc(20px + var(--safe-b)); transform: translateY(100%); transition: transform .28s cubic-bezier(.3,1,.4,1); }
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }
.sheet__head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 0 10px; background: var(--ink-2); z-index: 1; }
.sheet__head h2 { margin: 0; font-weight: 900; text-transform: uppercase; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink-3); font-size: 18px; }

.lines { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--ink-3); }
.line__swatch { display: flex; flex-direction: column-reverse; width: 14px; height: 48px; border-radius: 6px; overflow: hidden; }
.line__swatch i { flex: 1; }
.line__txt { display: grid; font-size: 14px; color: var(--crema-2); }
.line__txt b { color: var(--crema); font-size: 15px; }

form { display: grid; gap: 12px; }
.mode { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.mode label { position: relative; }
.mode input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mode span { display: block; text-align: center; padding: 12px; border-radius: 12px; border: 2px solid #ffffff1c; font-weight: 700; }
.mode input:checked + span { border-color: var(--neon); background: #ff3fa41a; }
.mode input:focus-visible + span { outline: 3px solid var(--cian); }
.field { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.field input, .field textarea { font: inherit; font-size: 16px; color: var(--crema); background: var(--ink); border: 1px solid #ffffff26; border-radius: 12px; padding: 12px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--neon); }
.totals { display: grid; gap: 6px; padding: 12px 0; border-top: 1px dashed #ffffff26; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals div:first-child b { font-size: 22px; font-weight: 900; }

/* ---------- Escritorio ---------- */
@media (min-width: 600px) and (max-width: 859px) {
  .stage { grid-template-columns: 300px 1fr; }
  .stage__cup { height: clamp(240px, 30svh, 320px); }
  .types { grid-template-columns: repeat(4, 1fr); }
  .flavors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .builder { grid-template-columns: minmax(340px, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
  .stage { top: 76px; margin: 14px 0 0; grid-template-columns: 1fr; padding: 24px 24px 28px; border-radius: 24px; text-align: center; }
  .stage__cup { height: min(calc(100svh - 300px), 440px); }
  .stage__flavors { justify-content: center; }
  .types { grid-template-columns: repeat(4, 1fr); }
  .flavors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery__track { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; padding: 0 16px; }
  .cover { grid-template-columns: auto minmax(0, 400px); place-content: center; align-items: center; column-gap: clamp(40px, 6vw, 96px); text-align: left; }
  .cover__logo { width: min(42vw, calc(64svh * .9), 500px); }
  .cover__copy { justify-items: start; }
  .cover__lead { font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; line-height: 1.15; letter-spacing: -.015em; max-width: 16ch; }
  .hero { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

::selection { background: var(--neon); color: var(--ink); }
