:root {
  --rojo: #d52b2e;
  --rojo-osc: #b31f22;
  --crema: #fff4e2;
  --crema-2: #fbe7c8;
  --choco: #3e1f14;
  --choco-2: #6b4334;
  --suave: #7a5e52; /* un poco más oscuro: se lee bien también sobre el fondo crema */
  --linea: #ead6b8;
  --blanco: #fffdf8;
  --verde: #1f8a4c;
  --ambar: #b8761b;
  --radio: 18px;
  --sombra: 0 1px 0 rgba(62, 31, 20, 0.06), 0 8px 24px -12px rgba(62, 31, 20, 0.25);
  /* 'Baloo 2' solo trae la í/Í (Titan One las dibuja sin tilde); todo lo demás sale de Titan One */
  --titulo: 'Baloo 2', 'Titan One', system-ui, sans-serif;
  --cuerpo: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--crema);
  color: var(--choco);
  font: 500 16px/1.45 var(--cuerpo);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--rojo); }

/* Sin JavaScript: cartel con contacto (la barra de abajo no sirve sin JS) */
.sin-js { background: var(--choco); color: var(--crema); text-align: center; padding: 16px; font-weight: 700; }
.sin-js a { color: #ffd9a8; }
body:has(.sin-js) .barra { display: none; }

/* Foco visible para quien usa teclado (y no se ve al tocar con el dedo) */
:focus-visible { outline: 3px solid var(--choco); outline-offset: 2px; }
.btn-prim:focus-visible, .btn-wa:focus-visible { outline-color: var(--choco); }

/* ---------- Hero ---------- */
.hero {
  background: var(--rojo);
  color: var(--crema);
  text-align: center;
  padding: 28px 16px 40px;
  position: relative;
  background-image: radial-gradient(rgba(255, 244, 226, 0.12) 1.5px, transparent 1.6px);
  background-size: 18px 18px;
}
.logo { width: 104px; height: 104px; margin: 0 auto 10px; display: grid; place-items: center; }
.logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.logo-texto { display: none; }
.logo.sin-img {
  background: var(--crema);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--rojo), 0 0 0 8px var(--crema), 0 8px 18px rgba(0,0,0,.2);
}
.logo.sin-img .logo-texto { display: block; font: 27px/1 'Playball', cursive; color: var(--rojo); }
.hero h1 { font: 34px/1.05 var(--titulo); margin: 0; letter-spacing: 0.3px; }
.bajada { margin: 6px 0 14px; opacity: 0.92; font-weight: 600; }
.chips-info { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips-info li {
  background: rgba(255, 244, 226, 0.16);
  border: 1px solid rgba(255, 244, 226, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 700;
}

main { max-width: 560px; margin: 14px auto 0; padding: 0 16px; position: relative; }

/* ---------- Pasos ---------- */
.paso {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 18px 16px;
  margin-bottom: 14px;
}
.paso h2 { font: 21px/1.2 var(--titulo); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; font-weight: 400; }
.num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--rojo); color: var(--crema);
  display: inline-grid; place-items: center;
  font-size: 15px; flex: none;
}
.ayuda { color: var(--suave); font-size: 14px; margin: 10px 0 0; }
.ayuda.alerta { color: var(--rojo); font-weight: 700; }

/* ---------- Productos ---------- */
.productos { display: grid; gap: 12px; }
.producto {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px;
  border: 1.5px solid var(--linea);
  border-radius: 14px;
  transition: border-color .15s, background .15s;
}
.producto.activo { border-color: var(--rojo); background: #fff7ee; }
.producto .foto3d { position: relative; grid-row: span 2; width: 96px; height: 88px; display: grid; place-items: center; }
.producto .foto3d canvas { position: absolute; inset: 0; width: 96px; height: 88px; display: block; }
.producto .foto3d svg { width: 84px; height: auto; }
/* Foto del producto (la caja de verdad): flota despacito y salta al agregar */
.producto { grid-template-columns: 104px 1fr; }
.foto-prod { grid-row: span 2; width: 104px; display: grid; place-items: center; animation: flotarCaja 3.6s ease-in-out infinite; }
.foto-prod img { width: 104px; height: auto; display: block; filter: drop-shadow(0 6px 6px rgba(62, 31, 20, .18)); }
@keyframes flotarCaja { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-4px) rotate(1deg); } }
.producto h3 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; }
.producto .det { color: var(--suave); font-size: 13.5px; display: block; margin-top: 2px; }
.producto-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.precio { font-weight: 800; font-size: 17px; }
.stepper { display: inline-flex; align-items: center; background: var(--crema); border-radius: 999px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--choco); color: var(--crema);
  font-size: 22px; line-height: 1; display: grid; place-items: center;
}
.stepper button:disabled { opacity: .25; cursor: default; }
.stepper button.mas { background: var(--rojo); }
.stepper output { min-width: 34px; text-align: center; font-weight: 800; font-size: 17px; }

/* Cartel de pedido mínimo */
.minimo {
  display: flex; align-items: center; gap: 12px;
  background: var(--rojo); color: var(--crema);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
  box-shadow: 0 4px 0 var(--rojo-osc);
  transition: background .2s, box-shadow .2s;
}
.minimo svg { flex: none; }
.minimo-tit { display: block; font: 18px/1.15 var(--titulo); letter-spacing: .2px; }
.minimo-sub { display: block; font-size: 14px; font-weight: 700; opacity: .92; margin-top: 2px; }
.minimo.cumplido { background: var(--verde); box-shadow: 0 4px 0 #166b3a; }

/* Botón "Agregar 2" cuando la caja está en 0 */
.stepper .mas-txt { display: none; }
.stepper.vacio .menos, .stepper.vacio output { display: none; }
.stepper.vacio { background: transparent; }
.stepper.vacio .mas { width: auto; height: 40px; padding: 0 16px; border-radius: 999px; gap: 6px; display: inline-flex; align-items: center; font-size: 15px; font-weight: 800; box-shadow: 0 3px 0 var(--rojo-osc); }
.stepper.vacio .mas .mas-txt { display: inline; }
.stepper.vacio .mas .mas-signo { font-size: 20px; line-height: 1; }

/* ---------- Segmentado ---------- */
.segmentado { display: grid; grid-template-columns: 1fr 1fr; background: var(--crema); padding: 4px; border-radius: 14px; gap: 4px; margin-bottom: 14px; }
.segmentado button { border: 0; background: transparent; padding: 11px 6px; border-radius: 11px; font-weight: 800; color: var(--choco-2); }
.segmentado button[aria-checked='true'] { background: var(--choco); color: var(--crema); box-shadow: 0 2px 6px rgba(62,31,20,.25); }

/* ---------- Campos ---------- */
.campo { display: block; margin-bottom: 12px; }
.campo > span { display: block; font-weight: 800; font-size: 14px; margin-bottom: 5px; }
.campo em { font-style: normal; font-weight: 600; color: var(--suave); }
.campo input {
  width: 100%;
  border: 1.5px solid var(--linea);
  background: #fff;
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.campo input:focus { border-color: var(--choco); box-shadow: 0 0 0 3px rgba(62,31,20,.1); }
.campo.error input { border-color: var(--rojo); }

.btn-sec { background: var(--choco); color: var(--crema); border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; }
.btn-sec:disabled { opacity: .6; }
.btn-link { background: none; border: 0; color: var(--rojo); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; padding: 8px 4px; }

.resultados { list-style: none; margin: 0 0 12px; padding: 0; border: 1.5px solid var(--linea); border-radius: 12px; overflow: hidden; }
.resultados li + li { border-top: 1px solid var(--linea); }
.resultados button { width: 100%; text-align: left; background: #fff; border: 0; padding: 11px 13px; font-size: 15px; }
.resultados button:hover, .resultados button:focus-visible { background: var(--crema); }
.resultados .vacio { padding: 11px 13px; color: var(--suave); font-size: 14px; }

/* Mapa con buscador arriba (estilo app de mapas) */
.mapa-card { position: relative; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--linea); background: #e9e4dc; }
#mapa { height: 300px; z-index: 0; }
.buscador {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 600;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 12px; padding: 4px 4px 4px 12px;
  box-shadow: 0 2px 10px rgba(62,31,20,.25);
  color: var(--suave);
}
.buscador input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; padding: 9px 0; background: transparent; color: var(--choco); }
.buscador button { border: 0; background: var(--choco); color: var(--crema); font-weight: 800; border-radius: 9px; padding: 9px 14px; font-size: 15px; }
.buscador button:disabled { opacity: .6; }
.buscador:focus-within { box-shadow: 0 0 0 3px rgba(62,31,20,.18), 0 2px 10px rgba(62,31,20,.25); }
.mapa-card .resultados { position: absolute; top: 62px; left: 10px; right: 10px; z-index: 650; margin: 0; background: #fff; box-shadow: 0 6px 18px rgba(62,31,20,.22); }
.btn-ubic {
  position: absolute; right: 10px; bottom: 26px; z-index: 600;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--rojo); border: 0; border-radius: 999px;
  padding: 9px 13px; font-weight: 800; font-size: 14px; box-shadow: 0 2px 10px rgba(62,31,20,.25);
}
.btn-ubic:disabled { opacity: .6; }
.leaflet-top.leaflet-left { top: 62px; }
.pin-chichole { background: none; border: 0; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); }
.pin-chichole svg { animation: caerPin .35s ease-out; }
@keyframes caerPin { from { transform: translateY(-14px); } to { transform: none; } }
.mapa-ayuda { margin: 8px 0 12px; }

.zona-msg { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-weight: 700; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.zona-msg svg { flex: none; margin-top: 2px; }
.zona-msg small { display: block; font-weight: 600; opacity: .85; margin-top: 2px; }
.zona-msg.gratis { background: #e5f4ea; color: #145c33; }
.zona-msg.uber { background: #fdf0d9; color: #7a4a0c; }
.zona-msg.fuera { background: #fde5e5; color: #8f1a1c; }
.zona-msg.cargando { background: var(--crema); color: var(--suave); }

.nota-retiro { background: var(--crema); border-radius: 12px; padding: 12px 14px; font-weight: 600; }

/* ---------- Fechas ---------- */
.carrusel { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -4px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.fecha {
  flex: none; width: 70px; padding: 8px 0;
  border: 1.5px solid var(--linea); background: #fff; border-radius: 14px;
  display: grid; justify-items: center; gap: 0; scroll-snap-align: start;
}
.fecha .d { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--suave); }
.fecha .n { font: 22px/1.1 var(--titulo); }
.fecha .m { font-size: 12px; font-weight: 700; color: var(--suave); }
.fecha[aria-checked='true'] { background: var(--rojo); border-color: var(--rojo); color: var(--crema); }
.fecha[aria-checked='true'] .d, .fecha[aria-checked='true'] .m { color: var(--crema); }

.franjas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.franja { border: 1.5px solid var(--linea); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 15px; }
.franja[aria-checked='true'] { background: var(--choco); border-color: var(--choco); color: var(--crema); }

/* ---------- Pago ---------- */
.opciones-pago { display: grid; gap: 10px; }
.pago {
  display: flex; gap: 12px; align-items: center; text-align: left;
  border: 1.5px solid var(--linea); background: #fff; border-radius: 14px; padding: 13px;
}
.pago .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.pago strong { display: block; font-size: 16px; }
.pago small { color: var(--suave); font-size: 13.5px; font-weight: 600; }
.pago .radio { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--linea); flex: none; }
.pago[aria-checked='true'] { border-color: var(--rojo); background: #fff7ee; }
.pago[aria-checked='true'] .radio { border: 7px solid var(--rojo); }

/* ---------- Resumen ---------- */
.resumen h2 { margin-bottom: 8px; }
.resumen table { width: 100%; border-collapse: collapse; font-size: 15px; }
.resumen td { padding: 5px 0; vertical-align: top; }
.resumen td:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
.resumen tr.total td { border-top: 1.5px dashed var(--linea); padding-top: 10px; font-size: 18px; font-weight: 800; }
.resumen .sub { color: var(--suave); font-size: 13.5px; }

.errores { background: #fde5e5; color: #8f1a1c; border-radius: 14px; padding: 12px 16px; font-weight: 700; margin-bottom: 14px; }
.errores ul { margin: 0; padding-left: 18px; }
.pie { text-align: center; color: var(--suave); font-size: 14px; margin: 18px 0 8px; }

/* ---------- Barra inferior ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--blanco);
  border-top: 1px solid var(--linea);
  box-shadow: 0 -8px 24px -12px rgba(62,31,20,.3);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; justify-content: center;
}
.barra-info { display: grid; line-height: 1.15; min-width: 0; }
.barra-info span { font-size: 13px; color: var(--suave); font-weight: 700; }
.barra-info strong { font-size: 20px; font-weight: 800; }
.btn-prim {
  background: var(--rojo); color: var(--crema); border: 0;
  border-radius: 14px; padding: 14px 20px; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 0 var(--rojo-osc);
  flex: 1; max-width: 300px;
  transition: transform .08s, box-shadow .08s;
}
.btn-prim:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rojo-osc); }
.btn-prim:disabled { opacity: .65; cursor: wait; }

/* ---------- Pantalla final ---------- */
.final { text-align: center; padding: 26px 18px; }
.final .sello { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; }
.final .sello.ok { background: #e5f4ea; color: var(--verde); }
.final .sello.mal { background: #fde5e5; color: var(--rojo); }
.final h2 { justify-content: center; font-size: 26px; margin-bottom: 6px; }
.final .cod { display: inline-block; background: var(--crema); border-radius: 10px; padding: 6px 12px; font-weight: 800; letter-spacing: .5px; margin: 6px 0 12px; }
.final p { margin: 8px 0; }
.final .btns { display: grid; gap: 10px; margin-top: 18px; }
.final .btns a, .final .btns button { text-decoration: none; display: block; text-align: center; }

body.terminado .barra { display: none; }
body.terminado { padding-bottom: 24px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (min-width: 600px) { html { scroll-behavior: smooth; } }

/* ---------- Productos "Próximamente" (chef 3D) ---------- */
.producto-pronto {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: 6px 12px 6px 6px;
  border: 1.5px dashed #dcc39f;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--crema-2), #fff7ee 75%);
}
.escena { position: relative; width: 104px; height: 96px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.escena canvas { position: absolute; inset: 0; width: 104px; height: 96px; display: block; }
.escena svg { width: 84px; height: auto; }
.pronto-texto { min-width: 0; }
.pill-pronto {
  display: inline-block; background: var(--choco); color: var(--crema);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  border-radius: 999px; padding: 3px 9px;
}
.pronto-texto h3 { margin: 5px 0 1px; font-size: 16px; font-weight: 800; line-height: 1.2; }
.pronto-texto p { margin: 0; color: var(--suave); font-size: 13.5px; line-height: 1.35; }
.buscador.error { box-shadow: 0 0 0 3px var(--rojo), 0 2px 10px rgba(62,31,20,.25); }
.mapa-card .resultados { max-height: calc(100% - 72px); overflow-y: auto; }

/* =============================================================
   MOVIMIENTO: botones con resorte, ondas, rebotes y entradas
   ============================================================= */
.btn-prim, .btn-sec, .stepper button, .segmentado button, .fecha, .franja, .pago,
.buscador button, .btn-ubic, .btn-sonido, .resultados button {
  position: relative;
  overflow: hidden;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent;
}
.stepper button:active, .segmentado button:active, .fecha:active, .franja:active, .pago:active,
.buscador button:active, .btn-ubic:active, .btn-sonido:active, .btn-sec:active { transform: scale(.92); transition-duration: .08s; }
.btn-prim:active { transform: translateY(3px) scale(.97); transition-duration: .08s; }
@media (hover: hover) {
  .fecha:hover, .franja:hover, .pago:hover, .btn-sec:hover, .btn-ubic:hover { transform: translateY(-2px); }
  .btn-prim:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--rojo-osc); }
  .stepper button:not(:disabled):hover { transform: scale(1.08); }
}
.ripple { position: absolute; border-radius: 50%; background: currentColor; pointer-events: none; }

/* Envío / Retiro: la pastilla se desliza */
.segmentado { position: relative; }
.segmentado::before {
  content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px);
  border-radius: 11px; background: var(--choco); box-shadow: 0 3px 8px rgba(62,31,20,.3);
  opacity: 0; transform: translateX(0) scale(.9);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .2s;
}
.segmentado[data-sel="0"]::before { opacity: 1; transform: translateX(0); }
.segmentado[data-sel="1"]::before { opacity: 1; transform: translateX(calc(100% + 4px)); }
.segmentado button { z-index: 1; background: transparent !important; box-shadow: none !important; }
.segmentado button[aria-checked='true'] { color: var(--crema); }

/* Rebotes que dispara el JS */
.salto { animation: salto .45s cubic-bezier(.34,1.56,.64,1) !important; }
.achique { animation: achique .35s ease-out !important; }
.gelatina { animation: gelatina .55s ease-out !important; }
.festejo { animation: festejo .7s cubic-bezier(.34,1.56,.64,1) !important; }
.temblor { animation: temblor .45s ease-in-out !important; }
.aparecer { animation: aparecer .45s cubic-bezier(.2,.8,.3,1) !important; }
@keyframes salto { 0% { transform: scale(1); } 35% { transform: scale(1.32); } 65% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes achique { 0% { transform: scale(1); } 40% { transform: scale(.7); } 100% { transform: scale(1); } }
@keyframes gelatina { 0% { transform: scale(1); } 30% { transform: scale(1.03, .96); } 50% { transform: scale(.98, 1.03); } 70% { transform: scale(1.01, .99); } 100% { transform: scale(1); } }
@keyframes festejo { 0% { transform: scale(1); } 30% { transform: scale(1.06) rotate(-1.5deg); } 55% { transform: scale(.98) rotate(1deg); } 100% { transform: scale(1); } }
@keyframes temblor { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes aparecer { from { transform: translateY(10px) scale(.98); opacity: .2; } to { transform: none; opacity: 1; } }

/* Botón de confirmar "late" cuando está todo completo */
.btn-prim.listo::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: latido 2.2s ease-in-out infinite;
}
@keyframes latido { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(260%); } }

/* "+2" que sube y confeti */
.flota {
  position: fixed; z-index: 1000; pointer-events: none;
  font: 22px/1 var(--titulo); color: var(--rojo);
  text-shadow: 0 2px 0 var(--crema), 0 0 8px var(--crema);
}
.confeti { position: fixed; z-index: 999; pointer-events: none; }

/* Botón de sonido en el encabezado */
.btn-sonido {
  position: absolute; top: 12px; right: 12px;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,244,226,.16); color: var(--crema);
  border: 1px solid rgba(255,244,226,.4);
}
.btn-sonido[aria-pressed='false'] { opacity: .7; }

/* Entradas: encabezado, logo flotando y secciones que suben al aparecer */
.hero .logo { animation: flotarLogo 3.4s ease-in-out infinite; }
@keyframes flotarLogo { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
.hero h1 { animation: entrar .7s cubic-bezier(.2,.8,.3,1) both; }
.chips-info li { animation: pop .5s cubic-bezier(.34,1.56,.64,1) both; }
.chips-info li:nth-child(1) { animation-delay: .15s; }
.chips-info li:nth-child(2) { animation-delay: .25s; }
.chips-info li:nth-child(3) { animation-delay: .35s; }
#pasoProductos { animation: entrar .7s .1s cubic-bezier(.2,.8,.3,1) both; }
.producto, .producto-pronto { animation: entrar .6s cubic-bezier(.2,.8,.3,1) both; }
.productos > :nth-child(2) { animation-delay: .2s; }
.productos > :nth-child(3) { animation-delay: .3s; }
.productos > :nth-child(4) { animation-delay: .4s; }
@keyframes entrar { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.revelar { transform: translateY(28px) scale(.98); transition: transform .8s cubic-bezier(.2,.8,.3,1); }
.revelar.visto { transform: none; }

.final .sello { animation: pop .6s cubic-bezier(.34,1.56,.64,1) both; }
.final h2, .final .cod { animation: entrar .6s .15s cubic-bezier(.2,.8,.3,1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revelar { transform: none; }
}
/* Las entradas se apagan después de la primera vez (así los rebotes no las repiten) */
body.entrado #pasoProductos, body.entrado .producto, body.entrado .producto-pronto, body.entrado .hero h1, body.entrado .chips-info li { animation: none; }

/* =============================================================
   ENCABEZADO VIVO: chispitas, goteo y profundidad
   ============================================================= */
.hero > :not(.chispitas):not(.goteo):not(.btn-sonido) { position: relative; z-index: 1; }
.hero > .btn-sonido { z-index: 2; }
.chispitas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.goteo { position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: 130px; overflow: hidden; z-index: 3; pointer-events: none; }
.goteo i {
  position: absolute; top: 0; display: block;
  background: var(--rojo);
  border-radius: 0 0 999px 999px;
  transform-origin: top center;
  animation: gotear var(--dur) ease-in-out var(--delay) infinite alternate;
}
.goteo i.cae::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; width: 7px; height: 9px; margin-left: -3.5px;
  background: var(--rojo); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: gota-cae calc(var(--dur) * 1.4) ease-in var(--delay) infinite;
}
@keyframes gotear { from { transform: scaleY(.75); } to { transform: scaleY(1.12); } }
@keyframes gota-cae {
  0%, 60% { transform: translateY(0) scale(.6); opacity: 0; }
  66% { transform: translateY(4px) scale(1); opacity: 1; }
  100% { transform: translateY(70px) scale(.8); opacity: 0; }
}
.logo { will-change: translate, scale; }
.giro { animation: giro .8s cubic-bezier(.34,1.56,.64,1) !important; }
@keyframes giro { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.2); } 100% { transform: rotate(360deg) scale(1); } }

/* Alfajor que vuela al carrito */
.vuela { position: fixed; z-index: 1001; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(62,31,20,.3)); }

/* =============================================================
   BARRA DE PROGRESO (aparece al bajar)
   ============================================================= */
.progreso {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--blanco);
  box-shadow: 0 6px 18px -10px rgba(62,31,20,.35);
  transform: translateY(-110%);
  transition: transform .45s cubic-bezier(.34,1.3,.64,1);
}
.progreso.visible { transform: none; }
.prog-track { max-width: 528px; margin: 0 auto 6px; height: 6px; border-radius: 99px; background: var(--crema-2); overflow: hidden; }
.prog-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--rojo), #e8603a, var(--rojo));
  background-size: 200% 100%;
  transition: width .6s cubic-bezier(.34,1.3,.64,1);
  position: relative; overflow: hidden;
}
.progreso.completo .prog-fill { background: linear-gradient(90deg, var(--verde), #36b26a, var(--verde)); background-size: 200% 100%; }
.prog-fill::after {
  content: ''; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: brillo 2.2s linear infinite;
}
@keyframes brillo { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
.prog-pasos { list-style: none; margin: 0 auto; padding: 0; max-width: 528px; display: flex; justify-content: space-between; gap: 4px; }
.prog-pasos button {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 2px 4px;
  font-size: 13px; font-weight: 800; color: var(--suave);
}
.prog-dot {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--crema-2); color: var(--choco); font-size: 11px; font-weight: 800;
  transition: background-color .3s, color .3s;
}
.prog-pasos button.hecho { color: var(--choco); }
.prog-pasos button.hecho .prog-dot, .num.hecho { background: var(--verde); color: #fff; }
.num { transition: background-color .3s; }
body.terminado .progreso { display: none; }

/* Pantalla de espera al ir a pagar (logo con ruedita) */
.cargando-pago {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center; padding: 24px;
  background: rgba(255, 244, 226, .96);
  opacity: 0; transition: opacity .25s ease;
}
.cargando-pago.visible { opacity: 1; }
.cargando-caja { display: grid; justify-items: center; gap: 10px; text-align: center; }
.cargando-logo { position: relative; width: 136px; height: 136px; display: grid; place-items: center; margin-bottom: 6px; }
.cargando-logo img { width: 104px; height: 104px; animation: latirLogo 1.6s ease-in-out infinite; }
.cargando-logo::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 5px solid rgba(213, 43, 46, .15); border-top-color: var(--rojo);
  animation: girarRueda .85s linear infinite;
}
.cargando-tit { font: 22px/1.2 var(--titulo); font-weight: 400; color: var(--choco); }
.cargando-sub { color: var(--suave); font-weight: 700; font-size: 14.5px; }
@keyframes girarRueda { to { transform: rotate(360deg); } }
@keyframes latirLogo { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
/* Con "reducir movimiento" la ruedita igual gira (despacio): es lo que indica que está cargando */
@media (prefers-reduced-motion: reduce) { .cargando-logo::before { animation: girarRueda 2s linear infinite !important; } }

/* Pantalla final: el chef armando la caja */
.final-chef { position: relative; width: 260px; height: 220px; max-width: 100%; margin: -10px auto 2px; display: grid; place-items: center; }
.final-chef canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.final-chef .sello { margin: 0; }
.pill-ok {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e5f4ea; color: #145c33; border-radius: 999px; padding: 5px 12px 5px 9px;
  font-weight: 800; font-size: 14px; animation: pop .5s .1s cubic-bezier(.34,1.56,.64,1) both;
}
.final h2 { margin-top: 10px; }
.aviso-demo { display: inline-block; background: #fdf0d9; color: #7a4a0c; border-radius: 10px; padding: 6px 12px; font-size: 13.5px; font-weight: 700; }
.final .btns { justify-items: center; }
.final .btns .btn-prim, .final .btns .btn-wa { width: 100%; max-width: 300px; }
.btn-wa {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  background: #25d366; color: #fff; text-decoration: none; border-radius: 14px;
  padding: 13px 20px; font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 #1da851;
  position: relative; overflow: hidden; transition: transform .08s, box-shadow .08s;
}
.btn-wa:active { transform: translateY(3px); box-shadow: 0 1px 0 #1da851; }

@media (prefers-reduced-motion: reduce) {
  .goteo i, .goteo i::after, .prog-fill { animation: none !important; }
}

/* =============================================================
   CÓDIGO DE DESCUENTO
   ============================================================= */
.cupon { margin: -4px 0 14px; }
.cupon-abrir {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1.5px dashed #d9bf98; border-radius: 14px;
  padding: 12px; color: var(--choco-2); font-weight: 800; font-size: 15px;
  transition: background-color .2s, border-color .2s, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.cupon-abrir svg { color: var(--rojo); }
.cupon-abrir:active { transform: scale(.97); }
@media (hover: hover) { .cupon-abrir:hover { background: var(--blanco); border-color: var(--rojo); } }
.cupon-form { display: flex; gap: 8px; margin-top: 8px; }
.cupon-form input {
  flex: 1; min-width: 0; border: 1.5px solid var(--linea); background: #fff; border-radius: 12px;
  padding: 12px 13px; font-size: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; outline: none;
}
.cupon-form input:focus { border-color: var(--choco); box-shadow: 0 0 0 3px rgba(62,31,20,.1); }
.cupon-form input::placeholder { letter-spacing: normal; font-weight: 600; text-transform: none; }
.cupon-form button {
  border: 0; background: var(--choco); color: var(--crema); font-weight: 800; border-radius: 12px; padding: 0 18px;
  position: relative; overflow: hidden; transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.cupon-form button:active { transform: scale(.93); }
.cupon-ok {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #e5f4ea; color: #145c33; border-radius: 14px; padding: 10px 12px;
  border: 1.5px solid #bfe3cb;
}
.cupon-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--verde); color: #fff; border-radius: 999px; padding: 4px 10px 4px 8px;
  font-weight: 800; font-size: 14px; letter-spacing: .05em;
}
.cupon-desc { order: 4; flex-basis: 100%; font-size: 14px; font-weight: 700; }
.cupon-monto { margin-left: auto; font-size: 16px; }
.cupon-quitar { border: 0; background: rgba(20,92,51,.12); color: #145c33; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; font-weight: 800; }
.cupon-msg { margin: 8px 2px 0; font-size: 14px; font-weight: 700; color: var(--rojo); }
.cupon-msg.aviso { color: #7a4a0c; }
.resumen tr.desc td { color: var(--verde); }
.cupon-form button, .cupon-quitar { -webkit-tap-highlight-color: transparent; }

/* =============================================================
   STOCK EN VIVO Y ENTREGA HOY
   ============================================================= */
.stock-vivo {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 12.5px; font-weight: 800; color: #145c33;
  background: #e5f4ea; border-radius: 999px; padding: 3px 9px 3px 7px;
}
.stock-vivo i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); }
.stock-vivo i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--verde); animation: enVivo 1.6s ease-out infinite; }
@keyframes enVivo { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.8); opacity: 0; } }
.fecha-hoy { border-color: var(--verde); background: #e5f4ea; }
.fecha-hoy .d { color: var(--verde); }
.fecha-hoy .n { font-size: 18px; }
.fecha-hoy[aria-checked='true'] { background: var(--verde); border-color: var(--verde); }
#ayudaFecha.alerta { color: var(--rojo); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .stock-vivo i::after, .btn-prim.listo::after, .prog-fill::after { animation: none !important; } }

/* Cupo por día */
.fecha-llena { opacity: .55; cursor: not-allowed; background: var(--crema); border-style: dashed; }
.fecha-llena .n { text-decoration: line-through; text-decoration-thickness: 2px; }
.fecha-llena .m { color: var(--rojo); font-weight: 800; }
.fecha-pocos { border-color: #e0a23a; }
.fecha-pocos .m { color: #9a5b0a; font-weight: 800; font-size: 11px; }
.fecha-pocos[aria-checked='true'] .m { color: var(--crema); }

/* Dibujo mientras carga el 3D, y fundido cuando está listo */
.foto3d canvas, .escena canvas, .final-chef canvas { opacity: 0; transition: opacity .5s ease; }
.foto3d > svg, .escena > svg, .final-chef > .sello { transition: opacity .4s ease, transform .4s ease; }
.con3d > canvas { opacity: 1; }
.con3d > svg, .con3d > .sello { opacity: 0; transform: scale(.9); }

/* Rendimiento: las tarjetas no hacen recalcular el resto de la página */
.paso, .producto, .producto-pronto { contain: layout paint; }
.barra { contain: layout paint; transform: translateZ(0); }
.progreso { contain: layout paint; } /* ya tiene su propio transform (si no, este lo pisaba y la barra quedaba siempre a la vista) */
.goteo i { will-change: transform; }
