:root {
  --red: #d71f26;
  --red-dark: #a8151b;
  --ink: #161616;
  --muted: #6b6b6b;
  --line: #e7e4e0;
  --bg: #f7f5f2;
  --card: #ffffff;
  --ok: #1d7a3e;
  --warn-bg: #fff4e5;
  --radius: 12px;
  --display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--body); padding-bottom: 96px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink);
  font: 600 18px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.brand em { font-style: normal; color: var(--red); }
nav { display: flex; gap: 4px; }
.link { background: none; border: 0; padding: 8px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.link.on { color: var(--ink); background: var(--bg); font-weight: 600; }

main { max-width: 860px; margin: 0 auto; padding: 16px; }
h1, h2 { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
h1 { font-size: 26px; margin: 4px 0 4px; }
h2 { font-size: 20px; margin: 28px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
h2 small { font: 400 14px var(--body); text-transform: none; color: var(--muted); letter-spacing: 0; }
.sub { color: var(--muted); margin: 0 0 8px; }
.loading { color: var(--muted); }

/* banner with next delivery / pickup */
.when { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.when div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.when b { display: block; font-size: 15px; }
.when span { color: var(--muted); font-size: 13px; }

/* buttons */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 14px; cursor: pointer;
  font-weight: 600; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:active { background: var(--red-dark); }
.btn.wide { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 6px 10px; font-size: 14px; }

/* product list */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.item.out { opacity: .55; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.thumb.ph { display: grid; place-items: center; font: 600 20px var(--display); color: #c9c3bc; }
.name { font-weight: 600; line-height: 1.25; }
.meta { color: var(--muted); font-size: 14px; }
.price { color: var(--ink); font-weight: 600; }
.was { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-left: 4px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: var(--red); color: #fff; margin-left: 4px; vertical-align: 1px; }
.tag.grey { background: #e4e0db; color: #555; }

.step { display: flex; align-items: center; gap: 4px; }
.step button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; }
.step button.plus { background: var(--ink); color: #fff; border-color: var(--ink); }
.step input { width: 58px; height: 38px; text-align: center; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; -moz-appearance: textfield; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; }
.step .unit { width: 36px; font-size: 13px; color: var(--muted); }
.add { white-space: nowrap; }

/* specials */
.specials { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.special { background: #fff; border: 2px solid var(--red); border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 8px; }
.special .big { font: 600 22px var(--display); color: var(--red); }

/* catalogue tools */
.tools { position: sticky; top: 57px; z-index: 5; background: var(--bg); padding: 8px 0; }
.search { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px;
  cursor: pointer; font-size: 14px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { color: var(--muted); padding: 16px; text-align: center; }

/* cart bar */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
.cartbar .btn { max-width: 828px; margin: 0 auto; padding: 14px 16px; }

/* checkout sheet */
.sheet { border: 0; border-radius: 16px 16px 0 0; padding: 0; width: 100%; max-width: 640px; margin: auto auto 0;
  max-height: 92vh; }
.sheet::backdrop { background: rgba(0,0,0,.4); }
.sheet .in { padding: 16px; overflow-y: auto; max-height: 92vh; }
.sheet h2 { margin-top: 4px; }
.close { float: right; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 12px; }
.seg button { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.seg button.on { border: 2px solid var(--red); font-weight: 700; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
select, textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
textarea { min-height: 72px; resize: vertical; }
.lines { border-top: 1px solid var(--line); margin-top: 8px; }
.line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; font-weight: 700; padding: 12px 0 4px; }
.note { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.err { color: var(--red-dark); font-weight: 600; }

/* login */
.login { max-width: 380px; margin: 8vh auto; text-align: center; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; }
.login img { width: 180px; margin: 0 auto 8px; }
.pin { letter-spacing: .5em; text-align: center; font-size: 28px; width: 100%; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; margin: 12px 0; }

/* orders */
.order { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.order header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.status { font-size: 13px; font-weight: 700; text-transform: uppercase; }
.status.placed { color: var(--ok); } .status.cancelled { color: var(--muted); }
.order ul { margin: 8px 0; padding-left: 18px; color: #333; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; z-index: 30; max-width: calc(100% - 32px); }

@media (min-width: 700px) {
  .when { grid-template-columns: 1fr 1fr; }
  .item { grid-template-columns: 64px 1fr auto; }
  .thumb { width: 64px; height: 64px; }
}
.center { justify-content: center !important; }
.mb8 { margin-bottom: 8px; }
.tc { text-align: center; }
@media (max-width: 420px) {
  .brand span { font-size: 15px; }
  .brand em { display: block; }
  .link { padding: 8px; white-space: nowrap; }
}
/* when an item is in the cart, the stepper sits under the name so names stay readable */
@media (max-width: 560px) {
  .item:has(.step) { grid-template-columns: 56px 1fr; }
  .item:has(.step) .ctl { grid-column: 2; }
  .line:has(.step) { flex-direction: column; }
}
