/* Carvee & Kylie — ordering shop
   Layout follows the familiar food-delivery pattern (sticky category rail,
   text-left/image-right item rows, fixed cart bar). Colours are sampled from
   the shop's own logo banner; the marks are its own. */

@font-face {
  font-family: 'Baloo 2';
  src: url('/assets/fonts/baloo2-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('/assets/fonts/baloo2-800.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  --display:      'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --brand:        #882834;   /* logo wordmark maroon; white text on it = 8.75:1 */
  --brand-hi:     #6f1f2a;
  --brand-ink:    #882834;   /* same maroon used as text on white */
  --accent:       #b8770a;   /* rating star */
  --blue:         #3960e0;   /* logo "&" / flag blue — "open" status */
  --warn:         #b45309;   /* "closed" — amber, never mistaken for the brand */
  --ink:          #1c1f23;
  --ink-2:        #56606a;
  --ink-3:        #8a949e;
  --line:         #e6e9ec;
  --bg:           #ffffff;
  --bg-2:         #f6f7f8;
  --danger:       #c0392b;
  --amber:        #8a5a00;
  --radius:       12px;
  --wrap:         960px;
  --bar-h:        60px;
}

* { box-sizing: border-box; }

/* Class rules below set display:flex/grid on elements that are toggled with the
   [hidden] attribute; without this they would out-specify the UA's
   `[hidden] { display: none }` and stay on screen, swallowing clicks. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

img { max-width: 100%; display: block; }

svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--brand); color: #fff;
  font-weight: 800; font-size: 13px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--ink-2); font-size: 12px; }

.search { position: relative; flex: 1 1 auto; min-width: 0; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); font-size: 15px; color: inherit;
}
.search input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; background: #fff; }

.cart-btn {
  position: relative; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.cart-btn-count {
  position: absolute; top: -3px; right: -3px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ---------- hero + shop head ---------- */
.hero { background: var(--bg-2); }
.hero img { width: 100%; height: clamp(150px, 30vw, 260px); object-fit: cover; }

.shop-head { padding-top: 18px; }
.shop-head h1 { margin: 0 0 4px; font-size: clamp(21px, 4.5vw, 28px); line-height: 1.2; }
.cuisine { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.rating { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.rating svg { width: 16px; height: 16px; fill: var(--accent); stroke: none; }
.rating span { color: var(--ink-2); }
.dot { color: var(--ink-3); }
.addr { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }

.status { font-weight: 700; }
.status.is-open { color: var(--blue); }
.status.is-shut { color: var(--warn); }

.closed-note {
  margin: 14px 0 0; padding: 12px 14px;
  border-radius: var(--radius); background: #fff8ec;
  border: 1px solid #f0dfc0; color: var(--amber); font-size: 14px;
}

/* ---------- popular rail ---------- */
.popular { padding-top: 22px; }
.popular h2 { margin: 0 0 10px; font-size: 19px; }
.pop-rail {
  list-style: none; margin: 0; padding: 0 0 4px;
  display: flex; gap: 12px; overflow-x: auto; scrollbar-width: thin;
}
.pop-card { flex: none; width: 150px; }
.pop-open {
  display: block; width: 100%; padding: 0; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; cursor: pointer; overflow: hidden; color: inherit; font: inherit;
}
.pop-open:hover { border-color: var(--ink-3); }
.pop-open img { width: 100%; height: 110px; object-fit: cover; background: var(--bg-2); }
.pop-name {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; padding: 8px 10px 2px; font-size: 13px; font-weight: 600; line-height: 1.3;
}
.pop-price { display: block; padding: 0 10px 10px; font-size: 13px; font-weight: 700; }

/* ---------- category rail ---------- */
.cat-nav { position: sticky; top: 60px; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); margin-top: 16px; }
.cat-nav-inner { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--ink-2); background: var(--bg-2); white-space: nowrap;
}
.cat-nav a.is-active { background: var(--brand); color: #fff; }

/* ---------- menu ---------- */
.menu { padding-top: 8px; }
.no-results { padding: 40px 0; text-align: center; color: var(--ink-2); }

.cat { scroll-margin-top: 116px; padding-top: 18px; }
.cat h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 19px; }
.cat h2 .count { font-size: 13px; font-weight: 500; color: var(--ink-3); }

.items { list-style: none; margin: 0; padding: 0; }

.item { position: relative; border-bottom: 1px solid var(--line); }

/* The whole row is the affordance for opening the detail sheet. */
.item-open {
  display: flex; gap: 14px; align-items: flex-start; width: 100%;
  padding: 16px 0; border: 0; background: none; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
}
.item-open:disabled { cursor: default; }
.item-open:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 8px; }

.item-body { flex: 1 1 auto; min-width: 0; display: block; }
.item-name { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.tag {
  display: inline-block; margin-left: 6px; vertical-align: 2px;
  padding: 1px 7px; border-radius: 999px;
  background: #f9ebed; color: var(--brand-ink); font-size: 11px; font-weight: 700;
}
.desc {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 6px; font-size: 13px; color: var(--ink-2);
}
.price { display: block; font-size: 15px; font-weight: 700; }

.item-media { position: relative; flex: none; width: 112px; display: block; }
.item-media img, .img-fallback {
  width: 112px; height: 112px; border-radius: var(--radius);
  object-fit: cover; background: var(--bg-2); display: block;
}

/* Add / stepper sits over the image, outside the row button so clicks don't
   bubble into "open the detail sheet". */
.item-actions { position: absolute; right: 6px; bottom: 22px; }
.add, .item-actions .stepper { box-shadow: 0 2px 8px rgb(0 0 0 / .16); }
.add {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--brand-ink);
  display: grid; place-items: center; cursor: pointer;
}
.add:hover { background: var(--bg-2); }

.stepper {
  display: flex; align-items: center; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px;
}
.stepper button {
  width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: transparent; color: var(--brand-ink);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.stepper button:hover { background: var(--bg-2); }
.stepper span { min-width: 20px; text-align: center; font-weight: 700; font-size: 14px; }

.item--out { opacity: .55; }
.sold-out {
  position: absolute; right: 6px; bottom: 26px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 3px 8px; font-size: 12px; color: var(--ink-2);
}

.site-foot { padding: 28px 16px 32px; color: var(--ink-2); font-size: 13px; border-top: 1px solid var(--line); margin-top: 24px; }
.site-foot p { margin: 0 0 4px; }
.fine { color: var(--ink-3); font-size: 12px; }
.call { color: var(--brand-ink); font-weight: 700; }

/* ---------- fixed cart bar ---------- */
.cart-bar {
  position: fixed; z-index: 45;
  left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: calc(var(--wrap) - 32px); margin-inline: auto;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; border: 0; border-radius: 14px;
  background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgb(0 0 0 / .22);
}
.cart-bar:hover { background: var(--brand-hi); }
.cart-bar-count {
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 8px; background: rgb(255 255 255 / .22);
  display: grid; place-items: center; font-size: 13px;
}
.cart-bar-label { flex: 1 1 auto; text-align: left; }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .45); }

/* item detail sheet */
.sheet {
  position: fixed; z-index: 60; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 24px)); max-height: 90vh;
  background: #fff; border-radius: 16px; overflow: auto;
  box-shadow: 0 12px 40px rgb(0 0 0 / .28);
}
.sheet-close {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .92); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink);
}
/* Source photos are all 1:1, so a square box shows them uncropped.
   `contain` keeps any future non-square upload intact rather than slicing it. */
.sheet-img {
  width: 100%; aspect-ratio: 1 / 1; max-height: 46vh;
  object-fit: contain; background: var(--bg-2);
}
.sheet-body { padding: 16px; }
.sheet-body h2 { margin: 0 0 6px; font-size: 19px; }
.sheet-desc { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.sheet-price { margin: 0 0 14px; font-size: 17px; font-weight: 800; }
.sheet-note { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sheet-note textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: inherit; font-weight: 400; color: var(--ink); resize: vertical;
}
.sheet-note textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.sheet-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.sheet-stepper { flex: none; }
.sheet-stepper button { width: 36px; height: 36px; font-size: 20px; }
.sheet-add { flex: 1 1 auto; }

/* cart panel */
.cart-panel {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: #fff; display: flex; flex-direction: column;
  box-shadow: -6px 0 24px rgb(0 0 0 / .18);
}
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); flex: none; }
.cart-head h2 { margin: 0; font-size: 17px; }
.cart-head button {
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: var(--bg-2); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink);
}

.cart-empty { padding: 48px 20px; text-align: center; color: var(--ink-2); }
.cart-content { flex: 1 1 auto; overflow-y: auto; padding: 16px; }

.cart-lines { list-style: none; margin: 0 0 16px; padding: 0; }
.cart-line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-2); }
.cart-line-body { flex: 1 1 auto; min-width: 0; }
.cart-line-body h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.cart-line-body p { margin: 0; font-size: 13px; color: var(--ink-2); }
.cart-line-note { font-style: italic; color: var(--ink-3) !important; font-size: 12px !important; }

.fulfil { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fulfil label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.totals { margin: 14px 0; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dt, .totals dd { margin: 0; }
.totals dt { color: var(--ink-2); }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 800; }
.totals .grand dt { color: var(--ink); }

.sof-note, .min-warn { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.sof-note { background: #fff8ec; color: var(--amber); }
.min-warn { background: #fdf2f0; color: var(--danger); }

.checkout { display: flex; flex-direction: column; gap: 10px; }
.checkout label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.checkout input, .checkout textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: inherit; font-weight: 400; color: var(--ink); background: #fff; resize: vertical;
}
.checkout input:focus-visible, .checkout textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.form-error { margin: 0; color: var(--danger); font-size: 13px; }

.btn { border: 0; border-radius: 12px; padding: 13px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hi); }
.btn-primary:disabled { background: var(--ink-3); cursor: not-allowed; }
.btn-ghost { background: var(--bg-2); color: var(--ink); }

.cart-done { padding: 48px 24px; text-align: center; }
.cart-done .tick {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: #f9ebed; color: var(--brand-ink);
  display: grid; place-items: center; font-size: 26px; font-weight: 700;
}
.cart-done h3 { margin: 0 0 6px; }
.cart-done p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.cart-done .btn { margin-top: 12px; }

@media (max-width: 640px) {
  .brand-text { display: none; }
  .item-media { width: 96px; }
  .item-media img, .img-fallback { width: 96px; height: 96px; }
  .sheet-img { max-height: 38vh; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- display type (matches the landing page + logo lettering) ---------- */
.shop-head h1,
.cat h2,
.popular h2,
.cart-head h2,
.sheet-body h2,
.cart-done h3,
.brand-text strong,
.sheet-price,
.cart-bar,
.btn { font-family: var(--display); }

.shop-head h1 { font-weight: 800; letter-spacing: -0.005em; }
.cat h2, .popular h2 { font-weight: 800; font-size: 21px; }
.brand-mark { font-family: var(--display); font-size: 14px; }
.cart-bar { font-size: 17px; }
.btn { font-size: 16px; }
.sheet-body h2 { font-weight: 800; font-size: 21px; }
