:root {
  --night: #16130f;
  --night-2: #211c17;
  --paper: #f5f0e7;
  --paper-2: #ece5d8;
  --ink: #1d1a16;
  --ink-2: #4a443c;
  --muted: #7a7166;
  --line: rgba(29, 26, 22, .14);
  --gold: #b48a4e;
  --gold-soft: #c9a46a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --top-h: 56px;
  --nav-h: 50px;
  --gutter: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + var(--nav-h) + 8px);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 500; }
p { margin: 0; }
.muted { color: var(--muted); }

.kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Header ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--paper);
  transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s;
}
.topbar.solid {
  background: rgba(245, 240, 231, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  padding-left: .32em; /* compensa el tracking */
}
.wordmark--sm { font-size: 16px; }
.order-icon {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  margin-right: -10px;
}
.order-icon__count {
  position: absolute; top: 6px; right: 4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  background: var(--gold); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 17px; text-align: center;
  transform: scale(0);
  transition: transform .35s var(--ease);
}
.order-icon.has .order-icon__count { transform: scale(1); }

/* ---------- Hero ---------- */
.hero {
  min-height: 88svh;
  display: grid; place-items: center;
  padding: calc(var(--top-h) + 32px) var(--gutter) 56px;
  text-align: center;
  color: var(--paper);
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(180, 138, 78, .28), transparent 60%),
    radial-gradient(80% 50% at 50% 0%, rgba(255, 255, 255, .04), transparent 70%),
    var(--night);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__inner { position: relative; z-index: 1; max-width: 560px; }
.hero .kicker { color: var(--gold-soft); }
.hero__title {
  font-size: clamp(64px, 20vw, 132px);
  line-height: .95;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding-left: .12em;
  margin: 18px 0 20px;
}
.rule { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold-soft); }
.rule span { width: 48px; height: 1px; background: currentColor; opacity: .6; }
.rule i { width: 6px; height: 6px; border: 1px solid currentColor; transform: rotate(45deg); }
.hero__sub { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 6vw, 30px); margin-top: 20px; }
.hero__meta { font-size: 13px; color: rgba(245, 240, 231, .6); margin-top: 10px; }
.hero__cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 40px;
  padding: 14px 26px;
  border: 1px solid rgba(245, 240, 231, .35);
  font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  transition: background .3s, border-color .3s, color .3s;
}
.hero__cta:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.hero__cta svg { animation: nudge 2.4s var(--ease) infinite; }

/* ---------- Category nav ---------- */
.catnav {
  position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 30;
  height: var(--nav-h);
  background: rgba(245, 240, 231, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.catnav__track {
  position: relative;
  height: 100%;
  display: flex; align-items: stretch; gap: 4px;
  padding: 0 calc(var(--gutter) - 10px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 880px; margin: 0 auto;
}
.catnav__track::-webkit-scrollbar { display: none; }
.cat-link {
  flex: none;
  padding: 0 10px;
  display: flex; align-items: center;
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  transition: color .25s;
  white-space: nowrap;
}
.cat-link.active { color: var(--ink); }
.catnav__bar {
  position: absolute; bottom: 0; left: 0;
  height: 2px; background: var(--gold);
  transition: transform .45s var(--ease), width .45s var(--ease);
}

/* ---------- Carta ---------- */
.carta { max-width: 880px; margin: 0 auto; padding: 8px var(--gutter) 24px; }

.cat { padding-top: 48px; }
.cat__head { text-align: center; margin-bottom: 28px; }
.cat__head h2 { font-size: clamp(34px, 9vw, 46px); font-weight: 400; line-height: 1.1; }
.cat__head p { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 17px; margin-top: 4px; }

.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.item:first-child { border-top: 1px solid var(--line); }
.item__line { display: flex; align-items: baseline; gap: 10px; grid-column: 1 / -1; }
.item h3 { font-size: 21px; line-height: 1.25; font-weight: 600; }
.item .dots { flex: 1; min-width: 16px; border-bottom: 1px dotted rgba(29, 26, 22, .3); transform: translateY(-5px); }
.price { font-family: var(--serif); font-size: 20px; font-weight: 600; white-space: nowrap; font-variant-numeric: lining-nums; }
.item__desc { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-top: 4px; }
.item__tags { display: flex; gap: 6px; margin-top: 8px; }
.tag {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag--new { border-color: var(--gold); color: var(--gold); }
.item__side { display: flex; align-items: flex-end; justify-content: flex-end; padding-top: 4px; }

/* add button */
.add {
  position: relative;
  height: 36px; min-width: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 18px;
  color: var(--ink);
  font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  transition: background .25s, color .25s, border-color .25s;
}
.add--label { padding: 0 16px 0 12px; }
.add__plus { position: relative; width: 12px; height: 12px; }
.add__plus::before, .add__plus::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 12px; height: 1.5px; margin: -.75px 0 0 -6px;
  background: currentColor;
  transition: transform .35s var(--ease), width .35s var(--ease);
}
.add__plus::after { transform: rotate(90deg); }
.add:hover { background: var(--ink); color: var(--paper); }
.add.done { background: var(--gold); border-color: var(--gold); color: #fff; }
.add.done .add__plus::before { width: 5px; transform: translate(-2px, 2px) rotate(45deg); }
.add.done .add__plus::after { width: 10px; transform: translate(2px, 0) rotate(-45deg); }

/* chef */
.chef {
  margin: 56px 0 32px;
  padding: 36px 24px;
  text-align: center;
  background: var(--night);
  color: var(--paper);
  position: relative;
}
.chef::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid rgba(201, 164, 106, .35);
  pointer-events: none;
}
.chef .kicker { color: var(--gold-soft); }
.chef h3 { font-size: clamp(30px, 8vw, 40px); font-weight: 400; margin: 12px 0 10px; }
.chef__desc { color: rgba(245, 240, 231, .7); max-width: 46ch; margin: 0 auto; font-size: 14px; }
.chef__foot { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; }
.chef .price { font-size: 26px; color: var(--gold-soft); }
.chef .add { border-color: rgba(245, 240, 231, .6); color: var(--paper); }
.chef .add:hover { background: var(--paper); color: var(--ink); }
.chef .add.done { background: var(--gold); border-color: var(--gold); color: #fff; }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: 12px; color: var(--muted); }
.legend b { font-weight: 600; color: var(--ink); margin-right: 4px; }
.fineprint { text-align: center; font-size: 12px; color: var(--muted); max-width: 52ch; margin: 14px auto 0; }

/* ---------- Info ---------- */
.info {
  max-width: 880px; margin: 0 auto;
  padding: 48px var(--gutter);
  display: grid; gap: 28px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.info__item p:last-child { margin-top: 8px; font-family: var(--serif); font-size: 19px; line-height: 1.45; }

.footer {
  background: var(--night); color: rgba(245, 240, 231, .6);
  text-align: center;
  padding: 36px var(--gutter) calc(96px + var(--safe-b));
  font-size: 12px;
}
.footer .wordmark { color: var(--paper); display: block; margin-bottom: 8px; }

/* ---------- Order bar ---------- */
.orderbar {
  position: fixed; z-index: 35;
  left: 12px; right: 12px; bottom: calc(12px + var(--safe-b));
  height: 56px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px 0 10px;
  background: var(--night); color: var(--paper);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .45);
  transform: translateY(calc(100% + 24px));
  transition: transform .45s var(--ease);
}
.orderbar.show { transform: none; }
.orderbar__count {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid rgba(201, 164, 106, .6);
  color: var(--gold-soft);
  font-weight: 600; font-size: 14px;
}
.orderbar__count.tick { animation: tick .4s var(--ease); }
.orderbar__label { flex: 1; text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.orderbar__total { font-family: var(--serif); font-size: 20px; font-weight: 600; }

/* ---------- Sheet ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(22, 19, 15, .55);
  opacity: 0; visibility: hidden;
  transition: opacity .35s, visibility .35s;
}
.sheet {
  position: fixed; z-index: 60;
  left: 0; right: 0; bottom: 0;
  max-height: 86svh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 14px 14px 0 0;
  transform: translateY(100%);
  transition: transform .45s var(--ease);
  padding-bottom: var(--safe-b);
}
.open .scrim { opacity: 1; visibility: visible; }
.open .sheet { transform: none; }
.sheet__grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 10px auto 0; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter) 14px; border-bottom: 1px solid var(--line); }
.sheet__head h2 { font-size: 28px; font-weight: 400; }
.close { width: 44px; height: 44px; display: grid; place-items: center; margin-right: -12px; }
.sheet__list { list-style: none; margin: 0; padding: 0 var(--gutter); overflow-y: auto; flex: 1; }
.sheet__list li {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  animation: rowIn .35s var(--ease) both;
}
.sheet__list .name { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.2; }
.sheet__list .sub { font-size: 13px; color: var(--muted); }
.qty { grid-row: span 2; display: flex; align-items: center; border: 1px solid var(--line); }
.qty button { width: 40px; height: 40px; font-size: 18px; color: var(--ink-2); }
.qty button:active { background: var(--paper-2); }
.qty span { min-width: 22px; text-align: center; font-weight: 600; font-size: 14px; }
.sheet__empty { display: none; padding: 40px var(--gutter); text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 19px; }
.sheet.empty .sheet__empty { display: block; }
.sheet.empty .sheet__list { display: none; }
.sheet__foot { padding: 16px var(--gutter) 16px; border-top: 1px solid var(--line); }
.sheet__row { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.sheet__row--total { font-family: var(--serif); font-size: 24px; font-weight: 600; padding-top: 10px; }
.confirm {
  width: 100%; height: 54px; margin-top: 14px;
  background: var(--night); color: var(--paper);
  font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  transition: background .25s, opacity .25s;
}
.confirm:hover { background: #000; }
.sheet.empty .confirm { opacity: .35; pointer-events: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--top-h) + 12px + env(safe-area-inset-top, 0px)); z-index: 70;
  padding: 12px 18px;
  background: var(--night); color: var(--paper);
  font-size: 13px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  transform: translate(-50%, -12px); opacity: 0;
  transition: transform .35s var(--ease), opacity .35s;
  pointer-events: none;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Motion ---------- */
.fade { opacity: 0; animation: fadeUp 1s var(--ease) var(--d, 0s) forwards; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(3px); } }
@keyframes tick { 40% { transform: scale(1.15); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Pantallas más grandes ---------- */
@media (min-width: 640px) {
  :root { --gutter: 32px; --top-h: 64px; }
  .item { grid-template-columns: 1fr 120px; }
  .item__line { grid-column: 1; }
  .item__side { grid-row: 1 / span 3; grid-column: 2; align-items: center; }
  .info { grid-template-columns: repeat(3, 1fr); }
  .orderbar { left: 50%; right: auto; width: 420px; margin-left: -210px; }
  .catnav__track { justify-content: center; }
}
@media (min-width: 900px) {
  .sheet {
    left: auto; top: 0; width: 420px; max-height: none;
    border-radius: 0;
    transform: translateX(100%);
  }
  .sheet__grab { display: none; }
}
@media (hover: none) {
  .add:hover { background: none; color: var(--ink); }
  .chef .add:hover { background: none; color: var(--paper); }
  .add.done:hover, .chef .add.done:hover { background: var(--gold); color: #fff; }
  .hero__cta:hover { background: none; color: var(--paper); border-color: rgba(245, 240, 231, .35); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
