:root {
  --paper: #f4ecdf;
  --paper-2: #ebe0cc;
  --card: #fbf6ee;
  --ink: #2a1d14;
  --ink-2: #6a5646;
  --line: rgba(42, 29, 20, 0.14);
  --azul: #1d4b97;
  --azul-soft: #dfe6f2;
  --crust: #b85c22;
  --crust-soft: #f1d9c2;
  --ok: #2f6b3e;
  --low: #a8401c;
  --r: 14px;
  --serif: "Young Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
body.has-bag { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
body.lock { overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--azul); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-2); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--azul); margin-bottom: 10px;
}

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__mark { width: 30px; height: 30px; color: var(--crust); display: block; }
.logo__mark svg { width: 100%; height: 100%; display: block; }
.logo__word { font-family: var(--serif); font-size: 21px; line-height: 1; }
.logo__word em, .foot__word em { font-style: normal; color: var(--crust); }
.top__status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.top__status.closed .dot { background: var(--low); box-shadow: 0 0 0 3px color-mix(in srgb, var(--low) 20%, transparent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none; border: 1.5px solid transparent;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #3d2b1e; }
.btn--line { border-color: var(--ink); background: transparent; }
.btn--line:hover { background: var(--paper-2); }
.btn--block { width: 100%; }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero__in { position: relative; z-index: 1; padding-top: 36px; padding-bottom: 36px; }
.hero h1 { font-size: clamp(40px, 11vw, 76px); line-height: 1.02; max-width: 12ch; }
.hl { color: var(--crust); }
.lede { margin-top: 18px; font-size: 17px; color: var(--ink-2); max-width: 44ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 32px 0 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.facts div { padding: 14px 0; }
.facts div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-family: var(--serif); font-size: 18px; }

/* Azulejo band */
.tiles {
  height: 44px;
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%231d4b97' stroke-width='1.6'%3E%3Cpath d='M22 6c4 6 10 10 16 16-6 6-12 10-16 16-4-6-10-10-16-16 6-6 12-10 16-16z'/%3E%3Ccircle cx='22' cy='22' r='4.5' fill='%231d4b97'/%3E%3Cpath d='M0 6L6 0M38 0l6 6M0 38l6 6M38 44l6-6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 44px 44px;
  border-top: 1px solid var(--line);
}

/* Board */
.board { padding: 44px 0 24px; }
.board__head { display: grid; gap: 10px; margin-bottom: 20px; }
.board h2, .how h2, .visit h2 { font-size: clamp(30px, 7vw, 44px); line-height: 1.08; }
.board__note { color: var(--ink-2); font-size: 14px; max-width: 42ch; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 8px; padding: 4px var(--gutter) 12px;
  position: sticky; top: 60px; z-index: 5; background: var(--paper);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 500;
}
.chip[aria-selected="true"] { background: var(--azul); border-color: var(--azul); color: #fff; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.item {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.item.is-out { opacity: 0.55; }
.item__art {
  width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center;
  background: var(--crust-soft); color: var(--crust);
}
.item__art svg { width: 42px; height: 42px; }
.item__art.t-azul { background: var(--azul-soft); color: var(--azul); }
.item__body { min-width: 0; display: grid; gap: 4px; }
.item__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.item__name { font-size: 20px; line-height: 1.15; }
.item__price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item__gloss { font-size: 13px; color: var(--ink-2); font-style: italic; }
.item__desc { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.item__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.stock { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.stock__bar { width: 54px; height: 5px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.stock__bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.stock.low { color: var(--low); }
.stock.low .stock__bar i { background: var(--low); }
.tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: var(--azul-soft); color: var(--azul); margin-left: 4px;
}
.tag--hot { background: var(--crust-soft); color: var(--crust); }

.add {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: transparent; font-weight: 600; font-size: 14px;
}
.add:hover { background: var(--ink); color: var(--paper); }
.add:disabled { border-color: var(--line); color: var(--ink-2); cursor: not-allowed; background: transparent; }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; background: var(--ink); color: var(--paper); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 999px; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 22px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper--sm button { width: 34px; height: 34px; font-size: 18px; }

.empty { padding: 40px 0; text-align: center; color: var(--ink-2); }

/* How */
.how { padding: 48px 0; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 20px; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.steps__n {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--azul); color: var(--azul); font-family: var(--serif); font-size: 18px;
}
.steps h3 { font-size: 19px; margin-bottom: 4px; }
.steps p { color: var(--ink-2); font-size: 15px; }

/* Visit */
.visit { padding: 48px 0 56px; }
.visit__in { display: grid; gap: 28px; }
.addr { color: var(--ink-2); margin: 12px 0 20px; max-width: 40ch; }
.hours { width: 100%; border-collapse: collapse; font-size: 15px; }
.hours th, .hours td { padding: 13px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr.today th, .hours tr.today td { font-weight: 600; }
.hours tr.today th::after { content: "Today"; margin-left: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--azul); }

/* Footer */
.foot { background: var(--ink); color: var(--paper); padding: 36px 0 44px; }
.foot__in { display: grid; gap: 8px; font-size: 14px; }
.foot__word { font-family: var(--serif); font-size: 26px; margin-bottom: 6px; }
.foot .muted { color: #b9a796; }

/* Bag bar */
.bagbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, transparent);
  animation: rise .25s ease-out;
}
.bagbar__btn {
  width: 100%; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 20px 0 10px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 15px;
  box-shadow: 0 10px 30px -10px rgba(42, 29, 20, 0.5);
}
.bagbar__count {
  min-width: 36px; height: 36px; border-radius: 999px; background: var(--crust); color: #fff;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.bagbar__label { flex: 1; text-align: left; }
.bagbar__total { font-variant-numeric: tabular-nums; }
.bump { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.18); } }
@keyframes rise { from { transform: translateY(100%); } }

/* Sheet */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(30, 20, 12, 0.45); animation: fade .2s ease; }
.sheet__panel {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  background: var(--paper); border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
  animation: slide .28s cubic-bezier(.2, .8, .2, 1); outline: none;
}
.sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 10px auto 0; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--gutter) 6px 20px; }
.sheet__head h2 { font-size: 26px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper-2); display: grid; place-items: center; }
.sheet__body { overflow-y: auto; padding: 0 20px; display: flex; flex-direction: column; gap: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateY(40px); opacity: 0; } }

.bag { list-style: none; margin: 0; padding: 0; }
.bag li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bag__name { flex: 1; min-width: 0; }
.bag__name strong { display: block; font-weight: 500; }
.bag__name span { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.field { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.field legend, .field label { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 8px; }
.field label { margin-bottom: 0; }
.field input {
  min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 16px; width: 100%;
}
.field input:focus { border-color: var(--azul); outline: none; box-shadow: 0 0 0 3px var(--azul-soft); }
.field input[aria-invalid="true"] { border-color: var(--low); }
.err { color: var(--low); font-size: 13px; font-weight: 500; }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.slot span {
  display: grid; place-items: center; min-height: 44px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.slot input:checked + span { background: var(--azul); border-color: var(--azul); color: #fff; }
.slot input:focus-visible + span { outline: 2.5px solid var(--azul); outline-offset: 2px; }
.slot input:disabled + span { opacity: .4; text-decoration: line-through; }

.sheet__foot {
  position: sticky; bottom: 0; margin: 4px -20px 0; padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line); display: grid; gap: 12px;
}
.sum { display: flex; justify-content: space-between; align-items: baseline; }
.sum span { color: var(--ink-2); font-size: 14px; }
.sum strong { font-family: var(--serif); font-weight: 400; font-size: 24px; font-variant-numeric: tabular-nums; }

.done { padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); text-align: center; display: grid; gap: 6px; justify-items: center; }
.done[hidden] { display: none; }
.done__stamp { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin-bottom: 10px; }
.done__stamp svg { width: 40px; height: 40px; }
.done h2 { font-size: 28px; }
.done__code {
  font-family: var(--serif); font-size: 44px; letter-spacing: 0.04em; color: var(--azul);
  padding: 8px 22px; border: 2px dashed var(--azul); border-radius: 14px; margin: 4px 0 6px;
}
.done .btn { margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--azul); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: opacity .2s ease, transform .2s ease; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Tablet up */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .hero__in { padding-top: 64px; padding-bottom: 56px; }
  .facts { max-width: 560px; }
  .board { padding-top: 64px; }
  .board__head { grid-template-columns: 1fr auto; align-items: end; }
  .list { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .steps li { grid-template-columns: 1fr; }
  .visit__in { grid-template-columns: 1fr 1fr; align-items: start; gap: 56px; }
  .sheet { align-items: center; }
  .sheet__panel { border-radius: 22px; max-height: 88vh; }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 20px; }
  .sheet__foot { border-radius: 0 0 22px 22px; }
  .slots { grid-template-columns: repeat(5, 1fr); }
}

/* Desktop */
@media (min-width: 1080px) {
  .hero__in { display: grid; grid-template-columns: 1.3fr 1fr; column-gap: 64px; align-items: end; padding-top: 88px; padding-bottom: 72px; }
  .hero h1, .hero .eyebrow { grid-column: 1; }
  .hero .eyebrow { grid-row: 1; }
  .hero h1 { grid-row: 2 / span 3; align-self: start; }
  .lede { grid-column: 2; grid-row: 2; margin-top: 0; }
  .hero__cta { grid-column: 2; grid-row: 3; }
  .facts { grid-column: 2; grid-row: 4; }
  .tiles { height: 56px; background-size: 56px 56px; }
  .item { grid-template-columns: 76px 1fr; gap: 18px; padding: 22px 0; }
  .item__art { width: 76px; height: 76px; }
  .item__art svg { width: 50px; height: 50px; }
}
