/* ==========================================================
   Plantilla "Caja de pizza" — para otro local cambiá :root
   y lib/manifest.js
   ========================================================== */
:root {
  --kraft: #caa472;        /* cartón */
  --kraft-2: #b98f5c;
  --kraft-3: #e2c79c;
  --red: #c8261b;          /* tinta roja de la caja */
  --red-dark: #9c1b12;
  --black: #1d1a17;
  --paper: #fffdf4;        /* comanda */
  --line: #9fb6d6;         /* renglones de la comanda */
  --pen: #213c8f;          /* birome */
  --green: #1f8a4c;        /* WhatsApp, apagado */
  --slab: "Alfa Slab One", "Rockwell", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --hand: "Gochi Hand", "Comic Sans MS", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html, body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 18px; line-height: 1.5; color: var(--black);
  background-color: var(--kraft);
  /* fibras del cartón */
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 2px, transparent 2px 11px),
    radial-gradient(rgba(80,50,20,.18) 1px, transparent 1.5px);
  background-size: auto, auto, 5px 5px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }

.demo-strip {
  background: var(--black); color: var(--kraft-3); font-size: 14px; text-align: center; padding: 8px 18px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
.demo-strip a { color: #fff; }

/* ---------- Barra ---------- */
.bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px); background: var(--red); color: var(--kraft-3);
  border-bottom: 4px solid var(--black);
}
.bar-logo { font-family: var(--slab); font-size: 22px; text-decoration: none; color: #fff; margin-right: auto; letter-spacing: .01em; }
.bar-nav { display: flex; gap: 22px; }
.bar-nav a { text-decoration: none; font-weight: 600; font-size: 16px; color: #ffe9d4; }
.bar-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
.bar-cta {
  background: var(--kraft-3); color: var(--black); font-weight: 800; text-decoration: none; font-size: 16px;
  padding: 9px 16px; border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black);
}
.bar-cta:hover { background: #fff; }

/* ---------- Tapa ---------- */
.lid { padding: clamp(24px, 4vw, 48px) clamp(12px, 3vw, 40px) 0; }
.lid-frame {
  max-width: 1240px; margin: 0 auto; position: relative;
  border: 3px solid var(--red); outline: 1.5px solid var(--red); outline-offset: 6px;
  padding: clamp(32px, 6vw, 80px) clamp(22px, 5vw, 70px);
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center;
}
.stamp-line {
  display: inline-block; color: var(--red); font-weight: 800; font-size: 15px; letter-spacing: .03em;
  border: 2px solid var(--red); padding: 6px 12px; transform: rotate(-1.5deg); margin-bottom: 26px;
}
.stamp-line.closed { color: var(--black); border-color: var(--black); }
.lid h1 {
  font-family: var(--slab); color: var(--red); font-size: clamp(46px, 7vw, 98px); line-height: .95; letter-spacing: -.01em;
  text-shadow: 3px 3px 0 rgba(29, 26, 23, .12);
}
.lid h1 span { display: block; color: var(--black); }
.lid-sub { font-size: clamp(18px, 1.6vw, 22px); max-width: 38ch; margin: 24px 0 32px; font-weight: 500; }
.lid-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35em; cursor: pointer;
  font-family: var(--sans); font-weight: 800; font-size: 18px; text-decoration: none;
  padding: 14px 24px; border: 2.5px solid var(--black); transition: transform .1s, box-shadow .1s;
}
.btn-red { background: var(--red); color: #fff; box-shadow: 4px 4px 0 var(--black); }
.btn-red:hover { background: var(--red-dark); }
.btn-outline { background: transparent; color: var(--black); }
.btn-outline:hover { background: var(--kraft-3); }
.btn-green { background: var(--green); color: #fff; box-shadow: 4px 4px 0 var(--black); }
.btn-green:hover { background: #17703c; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--black); }
.btn-block { width: 100%; }
.btn-small { font-size: 16px; padding: 9px 16px; }

.badge { justify-self: center; width: min(100%, 420px); }
.badge svg { width: 100%; height: auto; display: block; }
.b-fill { fill: var(--red); }
.b-line { fill: none; stroke: var(--kraft-3); stroke-width: 3; }
.b-ring { fill: var(--kraft-3); font-family: var(--slab); font-size: 17px; }
.cat > path:first-child { fill: var(--kraft-3); }
.cat-eye { fill: var(--black); }
.cat-nose { fill: var(--red); }
.cat-wh { stroke: var(--black); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.cat-hat { fill: #fff; stroke: var(--black); stroke-width: 3; }
.js .badge svg { transform-origin: 50% 50%; }
.js .badge.spin svg { animation: spinIn 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes spinIn { from { transform: rotate(-120deg) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

.lid-edge {
  max-width: 1240px; margin: 22px auto 0; overflow: hidden; white-space: nowrap;
  font-family: var(--slab); color: var(--red); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; opacity: .85;
}

/* ---------- Pedido ---------- */
.order {
  max-width: 1240px; margin: 0 auto; padding: clamp(60px, 8vw, 110px) clamp(16px, 4vw, 48px);
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start;
}
.menu h2, .salon h2, .where h2 { font-family: var(--slab); font-size: clamp(38px, 4.6vw, 60px); line-height: 1; color: var(--red); }
.menu-note { margin: 12px 0 26px; font-weight: 500; }
.menu-list { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--black); }
.menu-list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center;
  padding: 18px 0; border-bottom: 1.5px dashed rgba(29, 26, 23, .45);
}
.mi-text h3 { font-family: var(--slab); font-size: 26px; line-height: 1.1; }
.mi-text p { font-size: 16px; margin-top: 4px; max-width: 42ch; }
.mi-price { font-weight: 800; font-size: 18px; white-space: nowrap; }
.qty { display: flex; align-items: center; border: 2.5px solid var(--black); background: var(--kraft-3); }
.qty button {
  width: 44px; height: 44px; border: 0; background: transparent; font-size: 24px; font-weight: 800; cursor: pointer; color: var(--black);
  font-family: var(--sans); line-height: 1;
}
.qty .q-plus { background: var(--red); color: #fff; }
.qty .q-plus:hover { background: var(--red-dark); }
.qty .q-minus:hover { background: #fff; }
.qty output { min-width: 34px; text-align: center; font-weight: 800; font-size: 18px; }
.menu-list li.has { background: linear-gradient(90deg, rgba(255, 255, 255, .22), transparent 70%); }
.demo-note { font-family: var(--hand); font-size: 20px; color: var(--pen); margin-top: 18px; }

.comanda-wrap { position: sticky; top: 90px; }
.comanda {
  background: var(--paper); padding: 22px 22px 26px; transform: rotate(1.2deg);
  box-shadow: 8px 10px 0 rgba(29, 26, 23, .25);
  background-image: repeating-linear-gradient(transparent 0 33px, var(--line) 33px 34px);
  background-position: 0 50px;
  /* borde dentado arriba, como arrancada del talonario */
  -webkit-mask: radial-gradient(7px at 7px 0, #0000 98%, #000) -7px 0 / 14px 100%;
          mask: radial-gradient(7px at 7px 0, #0000 98%, #000) -7px 0 / 14px 100%;
}
.c-top {
  display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0 10px;
  border-bottom: 2px solid var(--red); font-family: var(--slab); color: var(--red); font-size: 22px;
}
.c-no { font-family: var(--sans); font-size: 14px; color: var(--black); }
.c-no b { color: var(--red); font-size: 18px; }
.c-lines { list-style: none; margin: 0; padding: 6px 0 12px; min-height: 120px; }
.c-lines li {
  font-family: var(--hand); font-size: 24px; color: var(--pen); line-height: 34px;
  display: flex; justify-content: space-between; gap: 12px;
}
.c-lines li.new { animation: write .35s ease-out; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.c-empty { color: #8a8f9b !important; font-size: 20px !important; }
.c-total { border-top: 2px solid var(--pen); margin-top: 6px; font-weight: 700; }
.c-field { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 10px; }
.c-label, .c-field > label { font-weight: 700; font-size: 15px; min-width: 76px; }
.c-in input {
  flex: 1; min-width: 160px; border: 0; border-bottom: 2px dotted var(--black); background: transparent;
  font-family: var(--hand); font-size: 24px; color: var(--pen); padding: 0 4px 2px;
}
.c-in input:focus { outline: none; border-bottom: 2px solid var(--pen); }
.c-in input.invalid { border-bottom: 2px solid var(--red); }
.c-opt { display: inline-flex; align-items: center; cursor: pointer; font-family: var(--hand); font-size: 23px; }
.c-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.c-opt span { padding: 0 8px; border: 2px solid transparent; border-radius: 50%; }
.c-opt input:checked + span { border-color: var(--red); color: var(--pen); }
.c-opt input:focus-visible + span { outline: 3px solid var(--pen); }
.c-error { color: var(--red); font-weight: 700; min-height: 1.4em; margin: 10px 0 6px; font-size: 16px; }

.wa-preview { background: #e8f6e0; border: 2.5px solid var(--black); padding: 20px; margin-top: 26px; }
.wa-preview[hidden] { display: none; }
.wa-title { font-weight: 800; }
.wa-bubble {
  background: #d9fdd3; border-radius: 10px 10px 10px 2px; padding: 12px 14px; margin: 12px 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; white-space: pre-wrap; color: #111;
}
.wa-note { font-size: 15px; margin-bottom: 14px; }

/* ---------- Salón ---------- */
.salon {
  max-width: 1240px; margin: 0 auto; padding: clamp(40px, 6vw, 90px) clamp(16px, 4vw, 48px);
  display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.salon-copy p { margin-top: 16px; font-size: 20px; max-width: 40ch; font-weight: 500; }
.photos { position: relative; height: 380px; }
.ph {
  position: absolute; margin: 0; background: #f4ecdd; padding: 12px 12px 44px; box-shadow: 6px 8px 0 rgba(29, 26, 23, .25);
  display: flex;
}
.ph span {
  flex: 1; display: grid; place-items: center; text-align: center; font-family: var(--hand); font-size: 22px; color: #7a6a52;
  border: 2px dashed #bca786; background: repeating-linear-gradient(45deg, #efe4d0 0 10px, #f4ecdd 10px 20px);
}
.ph-1 { width: 46%; height: 72%; left: 0; top: 6%; transform: rotate(-5deg); }
.ph-2 { width: 50%; height: 64%; left: 30%; top: 26%; transform: rotate(3deg); z-index: 2; }
.ph-3 { width: 36%; height: 56%; right: 0; top: 0; transform: rotate(7deg); }
.salon .demo-note { grid-column: 1 / -1; }

/* ---------- Dónde ---------- */
.where {
  max-width: 1240px; margin: 0 auto; padding: clamp(50px, 7vw, 100px) clamp(16px, 4vw, 48px);
  display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 5vw, 64px); align-items: start;
}
.addr { font-weight: 800; font-size: 22px; margin: 14px 0 18px; }
.hours { width: 100%; border-collapse: collapse; font-size: 18px; }
.hours th, .hours td { text-align: left; padding: 9px 4px; border-bottom: 1.5px dashed rgba(29, 26, 23, .45); font-weight: 500; }
.hours td { text-align: right; }
.hours tr.today th, .hours tr.today td { color: var(--red); font-weight: 800; }
.hours tr.today th::before { content: "▸ "; }
.rating { display: inline-block; margin-top: 22px; font-weight: 600; text-underline-offset: 4px; }
.rating b { color: var(--red); font-size: 22px; }
.map { border: 3px solid var(--black); background: var(--kraft-3); box-shadow: 6px 6px 0 var(--black); }
.map iframe { display: block; width: 100%; height: 400px; border: 0; filter: sepia(.25) saturate(.9); }

.foot {
  background: var(--black); color: var(--kraft-3); padding: 30px clamp(16px, 4vw, 48px) calc(30px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 16px;
}
.foot a { color: #fff; }
.foot-sep { color: var(--red); padding: 0 .4em; }

.float-order { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .lid-frame, .order, .salon, .where { grid-template-columns: 1fr; }
  .badge { width: min(78%, 340px); order: -1; }
  .comanda-wrap { position: static; }
  .bar-nav { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .bar-logo { font-size: 19px; }
  .bar-cta { font-size: 14px; padding: 7px 11px; }
  .lid-frame { outline-offset: 4px; }
  .menu-list li { grid-template-columns: 1fr auto; row-gap: 10px; }
  .mi-price { grid-column: 1; grid-row: 2; }
  .qty { grid-column: 2; grid-row: 1 / span 2; }
  .photos { height: 300px; }
  .float-order {
    display: flex; justify-content: center; gap: 8px; position: fixed; left: 14px; right: 14px; z-index: 50;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--red); color: #fff; text-decoration: none;
    font-weight: 800; font-size: 18px; padding: 14px; border: 2.5px solid var(--black); box-shadow: 4px 4px 0 var(--black);
    transition: transform .2s, opacity .2s;
  }
  .float-order.away { opacity: 0; transform: translateY(130%); pointer-events: none; }
  .foot { padding-bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .badge.spin svg, .c-lines li.new { animation: none; }
  html { scroll-behavior: auto; }
}
