/* KK BOBA BITE — public QR menu page.
   Cream + brand-red look taken from the shop's own Canva menu designs;
   category colours come from the POS (sent by /api/public/menu).
   Phone-first, no framework, no login. */
:root {
  --bg: #f7f1e3;
  --card: #fffdf8;
  --ink: #2e2019;
  --muted: #7a6a5c;
  --brand: #be0f2e;
  --brown: #4a3226;
  --line: #e7dcc6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---------- header ---------- */
.site-header {
  text-align: center;
  padding: 26px 16px 18px;
  background: linear-gradient(180deg, #fdfaf2, var(--bg));
}
.site-header .logo, .site-footer .logo {
  /* logo.jpg is a wide banner (542x286) — show it at natural aspect */
  width: auto;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(74, 50, 38, .18);
}
.site-header .logo { height: 64px; }
.site-footer .logo { height: 44px; }
.site-header h1 {
  margin: 10px 0 2px;
  font-size: 30px;
  letter-spacing: 1px;
  color: var(--brand);
  font-weight: 800;
}
.tagline { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.hours { margin: 0 0 12px; font-size: 15px; }
.call-btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(190, 15, 46, .3);
}

/* ---------- category nav ---------- */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  background: rgba(247, 241, 227, .96);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  min-height: 40px;
}
.cat-nav .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- layout ---------- */
main { max-width: 680px; margin: 0 auto; padding: 6px 14px 10px; }
.loading, .menu-error { text-align: center; color: var(--muted); padding: 42px 10px; font-size: 16px; }
.menu-error button {
  margin-top: 12px; font-size: 15px; font-weight: 700; padding: 10px 20px;
  border: 0; border-radius: 999px; background: var(--brand); color: #fff;
}

/* ---------- popular showcase ---------- */
.popular { margin-top: 14px; }
.popular h2, .cat-section h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; margin: 0 0 12px; font-weight: 800;
}
.popular h2 { color: var(--brand); }
.popular-row {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none;
}
.popular-row::-webkit-scrollbar { display: none; }
.pop-card {
  flex: 0 0 68%; max-width: 300px; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(74, 50, 38, .08);
}
.pop-card img { width: 100%; height: 190px; object-fit: cover; display: block; }
.pop-card .pop-body { padding: 10px 14px 13px; }
.pop-card .pop-name { font-weight: 700; font-size: 17px; }
.pop-card .pop-cat { color: var(--muted); font-size: 13px; margin-top: 1px; }

/* ---------- category sections ---------- */
.cat-section { margin-top: 26px; scroll-margin-top: 66px; }
.cat-section h2 .dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 5px rgba(74, 50, 38, .06);
  position: relative;
}
.photo-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.photo-card .card-body { padding: 9px 11px 11px; }
.item-name { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.item-price { color: var(--brand); font-weight: 800; font-size: 15.5px; margin-top: 3px; }
.item-adders { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.35; }

/* list rows for items without a photo */
.item-rows { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.photo-grid + .item-rows { margin-top: 12px; }
.item-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 11px 14px; position: relative;
}
.item-row + .item-row { border-top: 1px solid var(--line); }
.item-row .row-main { min-width: 0; }
.item-row .item-name { font-size: 15.5px; }
.item-row .leader { flex: 1 1 auto; border-bottom: 2px dotted #d8cbae; transform: translateY(-4px); min-width: 14px; }
.item-row .item-price { margin-top: 0; white-space: nowrap; }
.item-row .item-adders { flex-basis: 100%; }

/* ---------- sold out ---------- */
.is-soldout img { filter: grayscale(1); opacity: .55; }
.is-soldout .item-name, .is-soldout .item-price { color: var(--muted); }
.soldout-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(46, 32, 25, .88); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .4px;
  padding: 5px 10px; border-radius: 999px; text-transform: uppercase;
}
.item-row .soldout-badge { position: static; margin-left: 8px; padding: 3px 9px; font-size: 11px; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 34px;
  background: var(--brown);
  color: #f3e9dc;
  text-align: center;
  padding: 26px 18px 30px;
  font-size: 14.5px;
  line-height: 1.5;
}
.site-footer p { margin: 4px 0; }
.site-footer .foot-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; margin-top: 8px; }
.foot-link { color: #ffd9a8; font-weight: 700; }

@media (min-width: 560px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .pop-card { flex-basis: 31%; }
}
