/* ================================================================
   BUDINES CASEROS · La caja de confitería atada con hilo
   ================================================================ */

@font-face {
  font-family: "Bagel Fat One";
  src: url("../fonts/bagel-fat-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans";
  src: url("../fonts/sofia-sans-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans Condensed";
  src: url("../fonts/sofia-sans-condensed-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  /* el mundo: cartón, hilo, sticker, sello */
  --carton: #F7CAD3;
  --carton-borde: #E9AEBC;
  --carton-hondo: #EFB8C5;
  --seda: #FBE4EA;
  --papel: #FFFFFF;
  --hilo: #D7313E;
  --sello: #B23A62;        /* tinta de sello sobre blanco */
  --sello-oscuro: #9B2950; /* tinta de sello sobre cartón */
  --tinta: #3A2A2E;        /* texto */
  --tinta-suave: #6B3347;

  --fuente-marca: "Bagel Fat One", "Sofia Sans", system-ui, sans-serif;
  --fuente-texto: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fuente-sello: "Sofia Sans Condensed", "Sofia Sans", system-ui, sans-serif;

  --salida: cubic-bezier(.16, 1, .3, 1);   /* ease-out exponencial */
  --gutter: clamp(16px, 4vw, 40px);
  --ancho: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  background: var(--carton);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--sello) var(--carton);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
body {
  min-height: 100svh;
  font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
  line-height: 1.5;
  overflow-x: clip;
  caret-color: var(--sello);
}
::selection { background: var(--sello); color: var(--papel); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sello); outline-offset: 3px; border-radius: 6px; }
b, strong { font-weight: 800; }

.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--papel); color: var(--tinta); padding: 10px 16px; border-radius: 10px;
  font-weight: 700; text-decoration: none;
}
.saltar:focus { top: 12px; }

.titulo {
  font-family: var(--fuente-marca);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.5rem);
  line-height: .98;
  letter-spacing: -.01em;
  color: var(--sello-oscuro);
  text-wrap: balance;
}

/* ================================================================
   1. APERTURA (tramo fijo de scroll)
   ================================================================ */
.apertura { position: relative; height: 430svh; }
.escena {
  position: sticky; top: 0;
  height: 100svh;
  overflow: hidden;
  overflow: clip;
  contain: paint;
  perspective: 1400px;
}
[hidden] { display: none !important; }

/* --- interior de la caja: papel de seda y budín --- */
.interior {
  position: absolute; inset: 0;
  background-color: var(--seda);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0125 .05' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .58 0 0 0 0 .2 0 0 0 0 .33 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow:
    inset 0 0 0 clamp(10px, 2.2vw, 22px) var(--carton-hondo),
    inset 0 clamp(18px, 3vw, 30px) 28px -14px rgba(58,42,46,.22);
}
.budin {
  position: absolute;
  left: 50%; top: 47%;
  width: min(88vw, 980px);
  aspect-ratio: 1500 / 600;
  translate: -50% -50%;
  display: flex;
  mix-blend-mode: multiply;  /* el fondo blanco de la foto se funde con el papel de seda */
}
/* en el celular (pantalla parada) el budín se acuesta a lo largo de la pantalla */
@media (orientation: portrait) {
  .budin { width: min(64svh, 600px); top: 43%; rotate: 90deg; }
}
/* el budín entero, sin cortes, hasta que empieza el cuchillo (evita líneas entre rodajas) */
.budin::before {
  content: ""; position: absolute; inset: 0;
  background: url("../img/marmolado-entero.webp") 0 0 / 100% 100% no-repeat;
}
.budin.is-cortando::before { opacity: 0; }
.budin__rodaja {
  flex: 1 1 0;
  height: 100%;
  background-image: url("../img/marmolado-entero.webp");
  background-size: 100% 100%; /* cada rodaja ajusta su posición desde JS */
  background-repeat: no-repeat;
  opacity: 0;
  will-change: transform;
}
.budin.is-cortando .budin__rodaja { opacity: 1; }

/* papel de seda: dos hojas translúcidas, marcadas por los dobleces, que se solapan en el centro */
.seda {
  position: absolute; top: 0; bottom: 0; width: 54%;
  background-color: #FDEDF1;
  background-image:
    linear-gradient(112deg, transparent 0 22%, rgba(255,255,255,.75) 22% 22.25%, rgba(178,58,98,.09) 22.25% 23.1%, transparent 23.1%),
    linear-gradient(71deg, transparent 0 57%, rgba(255,255,255,.7) 57% 57.25%, rgba(178,58,98,.08) 57.25% 58.2%, transparent 58.2%),
    linear-gradient(158deg, transparent 0 76%, rgba(255,255,255,.7) 76% 76.3%, rgba(178,58,98,.07) 76.3% 77%, transparent 77%),
    linear-gradient(8deg, transparent 0 38%, rgba(178,58,98,.05) 38% 39%, transparent 39%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.009 .03' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .6 0 0 0 0 .2 0 0 0 0 .35 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .93;
  backface-visibility: hidden;
  will-change: transform;
}
.seda--izq { left: 0; transform-origin: 0 50%; }
.seda--der {
  right: 0; transform-origin: 100% 50%;
  box-shadow: -1px 0 0 rgba(178,58,98,.18), -10px 0 18px -10px rgba(58,42,46,.18); /* borde de la hoja de arriba */
}

.corte-texto {
  position: absolute; left: 0; right: 0; bottom: max(28px, 7svh);
  display: grid; justify-items: center; gap: 4px;
  text-align: center;
  padding: 0 var(--gutter);
  opacity: 0;
  pointer-events: none;
}
.corte-texto__nombre {
  font-family: var(--fuente-marca);
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1;
  color: var(--sello-oscuro);
}
.corte-texto__detalle { font-size: 1.05rem; color: var(--tinta-suave); font-weight: 600; }
.corte-texto__seguir {
  margin-top: 10px;
  font-family: var(--fuente-sello); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  font-size: .95rem;
  color: var(--sello-oscuro);
}

/* --- la tapa --- */
.tapa {
  position: absolute; inset: 0;
  background: var(--carton);
  transform-origin: 50% 0;
  will-change: transform;
  box-shadow: 0 30px 50px -20px rgba(58,42,46,0);
}
.tapa__pliegue {
  position: absolute; inset: clamp(10px, 2.2vw, 22px);
  border: 2px solid var(--carton-borde);
  border-radius: 4px;
}
.tapa__dato {
  position: absolute; top: clamp(30px, 5svh, 52px);
  font-family: var(--fuente-sello); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  font-size: clamp(.82rem, .76rem + .3vw, 1rem);
  color: var(--sello-oscuro);
}
.tapa__dato--izq { left: clamp(30px, 5vw, 64px); }
.tapa__dato--der { right: clamp(30px, 5vw, 64px); }

.hilo {
  position: absolute;
  background: repeating-linear-gradient(-45deg, var(--hilo) 0 5px, var(--papel) 5px 10px);
  will-change: transform;
}
.hilo--v { top: 0; bottom: 0; left: 50%; width: 9px; margin-left: -4.5px; }
.hilo--h { left: 0; right: 0; top: 42%; height: 9px; margin-top: -4.5px; }

.sticker {
  position: absolute; left: 50%; top: 42%;
  width: clamp(220px, 58vw, 380px);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--papel);
  box-shadow: 0 0 0 3px var(--papel), 0 0 0 6px var(--sello), 0 10px 18px -8px rgba(58,42,46,.35);
  display: grid; place-content: center; justify-items: center;
  text-align: center;
  padding: clamp(20px, 4vw, 40px);
  will-change: transform, opacity;
}
.sticker__titulo { display: grid; justify-items: center; font-weight: 400; }
.sticker__marca {
  font-family: var(--fuente-marca);
  font-size: clamp(2.6rem, 1.6rem + 6vw, 4.6rem);
  line-height: .9;
  color: var(--sello);
  letter-spacing: -.01em;
}
.sticker__sub {
  font-family: var(--fuente-marca);
  font-size: clamp(1.6rem, 1rem + 3.4vw, 2.6rem);
  line-height: .95;
  color: var(--tinta);
  rotate: -4deg;
  margin-top: 2px;
}
.sticker__sabores {
  margin-top: 12px;
  font-weight: 700;
  font-size: clamp(.82rem, .74rem + .35vw, 1rem);
  line-height: 1.35;
  color: var(--tinta);
}

.etiqueta-colgante {
  --baja: clamp(130px, 31vw, 210px);           /* distancia del hilo a la etiqueta */
  position: absolute;
  top: calc(42% + var(--baja));
  left: calc(50% + clamp(10px, 4vw, 70px));
  z-index: 1;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 18px 20px 18px 34px;
  min-height: 64px;
  color: var(--tinta);
  font-weight: 800; font-size: 1.05rem; line-height: 1.15;
  text-decoration: none;
  isolation: isolate;
  transform-origin: 22px calc(-1 * var(--baja));
  rotate: 6deg;
  will-change: transform;
}
.etiqueta-colgante::after { /* el papel de la etiqueta, con las esquinas cortadas */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--papel);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
  transition: background-color .2s;
}
.etiqueta-colgante::before { /* el hilito que la ata al nudo, por debajo del sticker */
  content: ""; position: absolute; left: 20px; width: 2px;
  top: calc(50% - var(--baja) - 32px); height: calc(var(--baja) + 32px);
  background: var(--hilo);
  z-index: -2;
}
.etiqueta-colgante__ojal {
  position: absolute; left: 16px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; background: var(--carton); box-shadow: inset 0 0 0 2px var(--carton-borde);
}
.etiqueta-colgante:hover::after { background: #FFF2F6; }
.etiqueta-colgante .flecha { width: 20px; height: 20px; flex: none; }
.sticker { z-index: 2; }

.flecha path, .contador__boton path, .sello-elegido path {
  fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}

/* rótulo de papel pegado sobre la tapa: el hilo pasa por debajo */
.tapa__pie {
  position: absolute; left: clamp(26px, 5vw, 64px);
  bottom: clamp(30px, 5svh, 56px);
  max-width: calc(100% - 2 * clamp(26px, 5vw, 64px));
  z-index: 2;
  display: grid; gap: 4px;
  padding: 14px 18px 16px;
  background: var(--papel);
  border-radius: 3px;
  box-shadow: 0 10px 18px -12px rgba(58,42,46,.4);
  rotate: -1.5deg;
}
.tapa__invita {
  font-family: var(--fuente-marca);
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.8rem);
  line-height: 1;
  color: var(--tinta);
}
.tapa__zonas { font-weight: 700; color: var(--tinta-suave); font-size: clamp(.95rem, .9rem + .2vw, 1.1rem); }

/* ================================================================
   2. LA CAJA ABIERTA
   ================================================================ */
.caja {
  position: relative;
  padding: clamp(72px, 12vw, 140px) var(--gutter) clamp(16px, 3vw, 32px);
  max-width: calc(var(--ancho) + 2 * var(--gutter));
  margin: 0 auto;
}
.caja__cabeza { max-width: 36ch; margin-bottom: clamp(28px, 5vw, 48px); }
.caja__bajada { margin-top: 14px; font-size: 1.1rem; color: var(--tinta-suave); font-weight: 500; }
.caja__bajada b { color: var(--sello-oscuro); }

/* el fondo de la caja con sus divisiones de cartón */
.compartimentos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--carton-borde);
  border-radius: 8px;
}
@media (min-width: 760px) {
  .compartimentos { grid-template-columns: 1fr 1fr; }
}

.compartimento {
  position: relative;
  /* cada compartimento está forrado con papel de seda, hundido entre las paredes de cartón */
  background-color: var(--seda);
  background-image:
    linear-gradient(118deg, transparent 0 14%, rgba(255,255,255,.7) 14% 14.3%, rgba(178,58,98,.08) 14.3% 15.2%, transparent 15.2%),
    linear-gradient(64deg, transparent 0 82%, rgba(255,255,255,.65) 82% 82.3%, rgba(178,58,98,.07) 82.3% 83.1%, transparent 83.1%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0125 .05' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .58 0 0 0 0 .2 0 0 0 0 .33 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: inset 0 14px 18px -12px rgba(58,42,46,.28), inset 0 -2px 0 rgba(255,255,255,.6);
  border-radius: 3px;
  padding: clamp(16px, 3vw, 28px);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "foto foto"
    "nota contador";
  align-items: center;
  gap: 14px 12px;
  isolation: isolate;
}
.compartimento img {
  grid-area: foto;
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  mix-blend-mode: multiply;
  /* los bordes de la foto se funden con el forro: no queda un rectángulo pegado */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-composite: intersect;
}
.compartimento__nota {
  grid-area: nota;
  font-weight: 700;
  color: var(--tinta-suave);
  font-size: 1rem;
  line-height: 1.3;
}

/* sticker redondo con nombre y precio */
.precio-sticker {
  position: absolute;
  top: clamp(10px, 2vw, 18px);
  width: clamp(120px, 31vw, 136px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--papel);
  box-shadow: 0 0 0 2px var(--papel), 0 0 0 4px var(--sello), 0 6px 12px -6px rgba(58,42,46,.4);
  display: grid; place-content: center; justify-items: center; text-align: center;
  z-index: 2;
}
.precio-sticker--a { left: clamp(10px, 2vw, 18px); rotate: -8deg; }
.precio-sticker--b { right: clamp(10px, 2vw, 18px); rotate: 6deg; }
.precio-sticker--c { left: clamp(10px, 2vw, 18px); rotate: 4deg; }
.precio-sticker--d { right: clamp(10px, 2vw, 18px); rotate: -5deg; }
.precio-sticker__nombre {
  font-family: var(--fuente-marca);
  font-size: clamp(1.12rem, .98rem + .5vw, 1.42rem);
  line-height: 1;
  color: var(--sello);
}
.precio-sticker__monto {
  margin-top: 5px;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--tinta);
  font-variant-numeric: tabular-nums;
}

/* contador: una etiqueta de papel atada con hilo, con − número + */
.contador {
  grid-area: contador;
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 6px 8px 6px 32px;
  rotate: -2deg;
}
.contador::after { /* el papel */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--papel);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}
.contador::before { /* el ojal */
  content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; background: var(--seda); box-shadow: inset 0 0 0 2px var(--carton-borde);
}
.contador__hilo { /* el hilo que la ata al compartimento */
  position: absolute; left: 16px; bottom: 50%; width: 3px; height: 54px; z-index: -2;
  background: repeating-linear-gradient(-45deg, var(--hilo) 0 3px, var(--papel) 3px 6px);
}
.contador__boton {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--sello-oscuro);
  cursor: pointer;
  transition: background-color .15s, color .15s, scale .15s var(--salida);
}
.contador__boton svg { width: 22px; height: 22px; }
.contador__boton:hover { background: var(--seda); }
.contador__boton:active { scale: .92; }
.contador__boton--mas { background: var(--sello); color: var(--papel); }
.contador__boton--mas:hover { background: var(--sello-oscuro); }
.contador__boton:disabled { color: #B9A3AA; background: transparent; cursor: default; }
.contador__numero {
  min-width: 2.2ch; text-align: center;
  font-family: var(--fuente-marca); font-size: 1.5rem; line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* marca de "elegido": sello entintado, nunca solo un color */
.sello-elegido {
  position: absolute;
  right: clamp(20px, 4vw, 36px);
  bottom: clamp(84px, 14vw, 104px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px;
  border: 2.5px solid var(--sello);
  border-radius: 8px;
  color: var(--sello);
  background: rgba(255,255,255,.72);
  font-family: var(--fuente-sello); font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  font-size: .95rem;
  rotate: -9deg;
  opacity: 0; scale: 1.6;
  pointer-events: none;
  transition: opacity .18s ease-out, scale .38s var(--salida);
  z-index: 3;
}
.sello-elegido svg { width: 20px; height: 20px; }
.compartimento.is-elegido .sello-elegido { opacity: 1; scale: 1; }

/* la promo: sticker grande pegado en el borde de la caja */
.promo { display: flex; justify-content: flex-end; margin-top: -34px; padding-right: clamp(0px, 4vw, 48px); position: relative; z-index: 4; }
.promo__sticker {
  width: clamp(200px, 52vw, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sello);
  color: var(--papel);
  box-shadow: 0 0 0 4px var(--papel), 0 12px 22px -10px rgba(58,42,46,.45);
  display: grid; place-content: center; justify-items: center; text-align: center;
  padding: 30px;
  rotate: -7deg;
}
.promo__cantidad { font-family: var(--fuente-marca); font-size: clamp(1.6rem, 1.3rem + 1vw, 1.9rem); line-height: 1; }
.promo__precio { font-family: var(--fuente-marca); font-size: clamp(2.3rem, 1.8rem + 2vw, 2.9rem); line-height: 1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; color: #FFE3EB; }
.promo__detalle { font-size: .9rem; font-weight: 600; line-height: 1.2; }

/* ================================================================
   3. EL COSTADO DE LA CAJA
   ================================================================ */
.costado {
  max-width: calc(var(--ancho) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) var(--gutter) clamp(40px, 8vw, 80px);
}
.costado__panel {
  margin-top: clamp(24px, 4vw, 40px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 48px);
  padding: 28px;
  padding: clamp(22px, 4vw, 44px);
  border: 2px solid var(--carton-borde);
  border-radius: 8px;
  position: relative;
}
.costado__panel::before { /* el hilo que recorre el costado */
  content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 9px;
  background: repeating-linear-gradient(-45deg, var(--hilo) 0 5px, var(--papel) 5px 10px);
}
@media (min-width: 760px) {
  .costado__panel { grid-template-columns: 1.5fr 1fr; align-items: center; }
}
.datos { display: grid; gap: clamp(18px, 3vw, 26px); }
.dato { display: grid; gap: 2px; }
.dato dt {
  font-family: var(--fuente-sello); font-weight: 800; text-transform: uppercase; letter-spacing: .12em;
  font-size: .9rem; color: var(--sello-oscuro);
}
.dato dd { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; line-height: 1.32; text-wrap: balance; }

.mapa { justify-self: center; width: min(100%, 260px); }
.mapa svg { width: 100%; height: auto; overflow: visible; }
.mapa__ruta { fill: none; stroke: var(--hilo); stroke-width: 5; stroke-dasharray: 7 5; stroke-linecap: round; }
.mapa__ruta-texto { font-family: var(--fuente-sello); font-weight: 700; font-size: 15px; fill: var(--sello-oscuro); letter-spacing: .06em; }
.mapa__punto { fill: var(--papel); stroke: var(--sello); stroke-width: 4; }
.mapa__lugar { font-family: var(--fuente-texto); font-weight: 800; font-size: 17px; fill: var(--tinta); }
.mapa figcaption { margin-top: 6px; text-align: center; font-size: .85rem; color: var(--tinta-suave); font-weight: 600; }

/* ================================================================
   4. LA ETIQUETA DEL PEDIDO
   ================================================================ */
.pedido {
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(72px, 12vw, 140px);
  display: grid; justify-items: center;
}
.etiqueta-pedido {
  position: relative;
  width: min(100%, 520px);
  background: var(--papel);
  padding: 48px 28px 32px;
  padding: clamp(44px, 7vw, 56px) clamp(22px, 5vw, 44px) clamp(28px, 5vw, 40px);
  clip-path: polygon(0 22px, 22px 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
  rotate: -1.5deg;
}
.etiqueta-pedido__ojal {
  position: absolute; left: 50%; top: 18px; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: var(--carton); box-shadow: inset 0 0 0 2px var(--carton-borde);
}
.etiqueta-pedido__titulo {
  font-family: var(--fuente-marca); font-weight: 400;
  font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem); line-height: 1;
  color: var(--sello);
  text-align: center;
  margin-bottom: 18px;
}
.pedido__vacio { text-align: center; color: var(--tinta-suave); font-weight: 600; }
.pedido__vacio b { color: var(--sello-oscuro); }
.pedido__lista { list-style: none; padding: 0; display: grid; }
.pedido__lista li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-bottom: 2px dashed var(--carton-borde);
  font-weight: 700; font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.pedido__cuentas { margin-top: 8px; display: grid; }
.cuenta { display: flex; justify-content: space-between; padding: 8px 0; font-variant-numeric: tabular-nums; }
.cuenta dt { font-weight: 600; color: var(--tinta-suave); }
.cuenta dd { font-weight: 700; }
.cuenta--ahorro dd { color: var(--sello-oscuro); }
.cuenta--total { border-top: 3px solid var(--tinta); margin-top: 6px; padding-top: 12px; }
.cuenta--total dt { color: var(--tinta); font-weight: 800; }
.cuenta--total dd { font-family: var(--fuente-marca); font-size: 1.9rem; line-height: 1; }

/* las acciones de pedido son etiquetas de papel frambuesa, con ojal y esquinas cortadas */
.boton-wa, .barra__boton {
  position: relative;
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
  border-radius: 0;
}
.boton-wa::before, .barra__boton::before { /* el ojal */
  content: ""; position: absolute; left: 14px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px;
  border-radius: 50%; background: var(--papel); box-shadow: inset 0 0 0 2px rgba(58,42,46,.18);
}
.boton-wa {
  margin-top: 22px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 62px; padding: 14px 22px 14px 42px;
  background: var(--sello); color: var(--papel);
  font-weight: 800; font-size: 1.15rem; text-decoration: none;
  transition: background-color .15s, scale .15s var(--salida);
}
.boton-wa:hover { background: var(--sello-oscuro); }
.boton-wa:active { scale: .98; }
.boton-wa .flecha { width: 22px; height: 22px; }
.pedido__nota { margin-top: 14px; text-align: center; font-size: .95rem; color: var(--tinta-suave); font-weight: 600; }

/* ================================================================
   5. CIERRE
   ================================================================ */
.cierre {
  display: grid; justify-items: center; text-align: center; gap: 10px;
  padding: clamp(56px, 10vw, 120px) var(--gutter) calc(120px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--carton-borde);
}
.cierre__caja {
  position: relative; width: 168px; height: 120px; margin-bottom: 18px; padding: 16px;
  background: var(--carton-hondo); border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--carton-borde);
}
.cierre__hilo { position: absolute; background: repeating-linear-gradient(-45deg, var(--hilo) 0 4px, var(--papel) 4px 8px); }
.cierre__hilo--v { top: 0; bottom: 0; left: 50%; width: 6px; margin-left: -3px; }
.cierre__hilo--h { left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; }
.cierre__sticker {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--papel); box-shadow: 0 0 0 3px var(--sello);
  display: grid; place-content: center;
  font-family: var(--fuente-marca); font-size: 1rem; line-height: .9; color: var(--sello);
}
.cierre__sticker small { display: block; margin-top: 3px; font-size: .78rem; line-height: 1; color: var(--tinta); }
.cierre__frase { font-family: var(--fuente-marca); font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); line-height: 1; color: var(--sello-oscuro); text-wrap: balance; }
.cierre__lema { font-weight: 700; font-size: 1.1rem; }
.cierre__wa { margin-top: 8px; font-weight: 800; font-size: 1.1rem; color: var(--sello-oscuro); }
.cierre__legal { margin-top: 18px; font-size: .9rem; color: var(--tinta-suave); font-weight: 600; }

/* ================================================================
   BARRA FIJA DEL PEDIDO
   ================================================================ */
.barra {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 560px; margin: 0 auto;
  padding: 8px 8px 8px 20px;
  background: var(--papel);
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--carton-borde), 0 14px 28px -12px rgba(58,42,46,.45);
  translate: 0 calc(100% + 40px);
  transition: translate .5s var(--salida);
}
.barra.is-visible { translate: 0 0; }
.barra__resumen { font-weight: 800; font-size: 1rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.barra__resumen small { display: block; font-weight: 600; color: var(--tinta-suave); font-size: .85rem; }
.barra__boton {
  flex: none;
  display: grid; place-items: center;
  min-height: 52px; padding: 0 22px 0 38px;
  background: var(--sello); color: var(--papel);
  font-weight: 800; text-decoration: none; font-size: 1.05rem;
}
.barra__boton:hover { background: var(--sello-oscuro); }

/* ================================================================
   APARICIONES (solo con JS y movimiento permitido)
   ================================================================ */
@media (prefers-reduced-motion: no-preference) {
  .js [data-aparece] {
    opacity: 0;
    translate: 0 28px;
    transition: opacity .7s var(--salida), translate .9s var(--salida);
  }
  .js [data-aparece="pega"] { translate: 0 0; scale: 1.25; rotate: 8deg; transition: opacity .25s ease-out, scale .7s var(--salida), rotate .7s var(--salida); }
  .js .compartimento[data-aparece] .precio-sticker { scale: 1.35; opacity: 0; transition: scale .6s var(--salida) .25s, opacity .2s ease-out .25s; }
  .js [data-aparece].is-visible { opacity: 1; translate: 0 0; }
  .js [data-aparece="pega"].is-visible { scale: 1; rotate: 0deg; }
  .js .compartimento.is-visible .precio-sticker { scale: 1; opacity: 1; }
}

/* ================================================================
   SIN MOVIMIENTO: la caja aparece cerrada y se abre sin tramo fijo
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .apertura { height: auto; }
  .escena { position: relative; height: 100svh; }
  .interior, .corte-texto { display: none; }
  .barra { transition: none; }
}
.no-escena .apertura { height: auto; }
.no-escena .escena { position: relative; height: 100svh; }
.no-escena .interior, .no-escena .corte-texto { display: none; }

@media (min-width: 900px) {
  .hilo--h { top: 45%; }
  .sticker { top: 45%; width: clamp(380px, 32vw, 460px); }
  .sticker__marca { font-size: clamp(4.6rem, 3rem + 2.6vw, 5.6rem); }
  .sticker__sabores { font-size: 1.1rem; }
  .tapa__dato { font-size: 1.05rem; }
  .etiqueta-colgante { --baja: 175px; top: calc(45% + var(--baja)); left: calc(50% + 150px); font-size: 1.2rem; padding: 22px 26px 22px 40px; }
  .caja__cabeza { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
  .caja__bajada { max-width: 34ch; margin: 0 0 8px; }
}

/* ================================================================
   APERTURA CON VIDEO (cuadros del video de Google Flow)
   Se activa sola desde main.js si los cuadros cargan (clase .con-video).
   ================================================================ */
.video-scroll { display: none; }
.con-video .escena { background: #E8CBC6; }
.con-video .video-scroll {
  display: block;
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.con-video .interior,
.con-video .tapa__pliegue,
.con-video .hilo { display: none; }
.con-video .tapa { background: transparent; box-shadow: none !important; }
/* el sticker del video ya dice "Budines caseros": el título queda para lectores de pantalla */
.con-video .sticker {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; box-shadow: none;
}
.con-video .tapa__dato { text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.con-video .etiqueta-colgante {
  --baja: 0px;
  top: auto; left: auto;
  right: clamp(26px, 5vw, 64px);
  bottom: clamp(30px, 5svh, 56px);
  rotate: 4deg;
  transform-origin: 50% 0;
  box-shadow: none;
  filter: drop-shadow(0 8px 12px rgba(58,42,46,.22));
}
.con-video .etiqueta-colgante::before { display: none; }

@media (orientation: portrait) {
  /* celular parado: el video vertical ocupa toda la pantalla */
  .con-video .video-scroll { inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .con-video .etiqueta-colgante { bottom: calc(clamp(30px, 5svh, 56px) + 104px); }
}
@media (max-width: 759px) and (orientation: landscape) {
  .con-video .etiqueta-colgante { bottom: calc(clamp(30px, 5svh, 56px) + 108px); }
}

/* ================================================================
   DATOS DE ENTREGA (dentro de la etiqueta del pedido)
   ================================================================ */
.datos { margin-top: 22px; padding-top: 18px; border-top: 2px dashed var(--carton-borde); display: grid; gap: 16px; }
.datos__titulo { font-size: 1.15rem; font-weight: 800; line-height: 1.25; color: var(--tinta); }
.datos__aviso {
  padding: 10px 14px; border-radius: 6px;
  background: #FCE4EC; color: var(--sello-oscuro); font-weight: 700; font-size: .95rem;
}
.campo { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.campo label, .campo legend { font-weight: 700; font-size: .95rem; color: var(--tinta); padding: 0; }
.campo legend { margin-bottom: 6px; }
.campo input[type="text"], .campo select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit; font-size: 1rem; /* 16px: el celular no hace zoom al tocar */
  color: var(--tinta);
  background: #FFFBFC;
  border: 2px solid var(--carton-borde);
  border-radius: 6px;
  transition: border-color .15s;
}
.campo select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%239B2950' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
.campo input::placeholder { color: #8A6670; }
.campo input:hover, .campo select:hover { border-color: #DA93A7; }
.campo input:focus-visible, .campo select:focus-visible { outline: 3px solid var(--sello); outline-offset: 2px; border-color: var(--sello); }
.campo.is-error input[type="text"], .campo.is-error select { border-color: var(--sello); background: #FFF5F8; }
.campo__error { color: var(--sello-oscuro); font-weight: 700; font-size: .9rem; }

/* medios de pago: etiquetitas para elegir una */
.pagos { display: flex; flex-wrap: wrap; gap: 8px; }
.pago { position: relative; cursor: pointer; }
.pago input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pago span {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 10px 14px;
  border: 2px solid var(--carton-borde); border-radius: 6px;
  background: #FFFBFC;
  font-weight: 700; font-size: .95rem; color: var(--tinta);
  transition: background-color .15s, border-color .15s, color .15s;
}
.pago span::before { /* marca de elegido: un tilde, no solo un color */
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--carton-borde);
}
.pago:hover span { border-color: #DA93A7; }
.pago input:checked + span { background: var(--sello); border-color: var(--sello); color: var(--papel); }
.pago input:checked + span::before {
  box-shadow: none; border-radius: 0; width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.pago input:focus-visible + span { outline: 3px solid var(--sello); outline-offset: 2px; }
.campo--pago.is-error .pago span { border-color: var(--sello); }

.datos .boton-wa { margin-top: 4px; width: 100%; border: 0; cursor: pointer; font-family: inherit; }
/* con video, el nombre del final va en un rótulo de papel para no pisar las rodajas */
.con-video .corte-texto {
  left: 50%; right: auto; translate: -50% 0;
  width: max-content; max-width: calc(100% - 40px);
  padding: 14px 24px 16px;
  background: var(--papel);
  border-radius: 3px;
  box-shadow: 0 10px 18px -12px rgba(58,42,46,.4);
  rotate: -1.5deg;
  bottom: max(20px, 4svh);
}
