/* ============================================================
   Charissa — Order Online
   Brand reference: charissa.ng (green #008C0C, Inter / Plus
   Jakarta Sans, warm hospitality tone, practical layout).
   Mobile-first.
   ============================================================ */

:root {
  --green: #008c0c;
  --green-dark: #036b0b;
  --green-tint: #eef6ee;
  --ink-green: #0a3d2c;
  --ink: #22261f;
  --muted: #6f7468;
  --faint: #9aa093;
  --bg: #faf9f5;
  --card: #ffffff;
  --line: #e6e4da;
  --line-soft: #efede4;
  --sand: #f6efdd;
  --sand-ink: #6b5820;
  --danger: #b3261e;
  --radius: 8px;
  --shadow-1: 0 1px 2px rgba(30, 36, 26, 0.06), 0 2px 8px rgba(30, 36, 26, 0.05);
  --shadow-2: 0 4px 14px rgba(30, 36, 26, 0.10), 0 12px 40px rgba(30, 36, 26, 0.12);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 0.9, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
}

* { box-sizing: border-box; }

/* the hidden attribute must always win over author display rules */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

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

button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.ic {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------------- header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 249, 245, 0.96);
  backdrop-filter: saturate(1.2) blur(8px);
  border-top: 3px solid var(--green);
  border-bottom: 1px solid var(--line-soft);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand img { height: 28px; width: auto; }

.header-nav { display: flex; align-items: center; gap: 18px; }

.header-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
}
.header-link:hover { color: var(--ink-green); }

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--ink-green);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.cart-btn:hover { background: #0d4a36; }
.cart-btn:active { transform: scale(0.97); }
.cart-btn .ic { width: 18px; height: 18px; }

.cart-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}
.cart-count.pop { animation: pop 0.35s var(--ease-spring); }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ---------------- health banner ---------------- */

.health-banner {
  background: var(--sand);
  border-bottom: 1px solid #eadfc3;
  color: var(--sand-ink);
  overflow: hidden;
  animation: banner-in 0.35s var(--ease-out);
}
@keyframes banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.health-banner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 13.5px;
}
.health-banner .ic { width: 18px; height: 18px; }

/* ---------------- intro band ---------------- */

.intro-band {
  background: var(--ink-green);
  color: #fff;
}
.intro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}
.intro-text h1 {
  margin: 0 0 3px;
  font-family: var(--font-head);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.intro-text p { margin: 0; color: #b7d0c1; font-size: 13.5px; max-width: 46ch; }

.intro-photos { display: flex; flex: none; padding-left: 12px; }
.intro-photos img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(250, 249, 245, 0.85);
  margin-left: -14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.intro-photos img:first-child { margin-left: 0; }

/* ---------------- toolbar: search + categories ---------------- */

.toolbar {
  position: sticky;
  top: 59px; /* header row + its 3px brand accent border */
  z-index: 30;
  background: var(--bg);
  padding: 12px 0 0;
  border-bottom: 1px solid var(--line-soft);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 42px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 140, 12, 0.12);
}
.search-box .ic { color: var(--faint); width: 18px; height: 18px; }
.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  padding: 0 8px;
  /* 16px minimum: iOS Safari zooms the whole page when a smaller input
     is focused, which strands the customer mid-layout */
  font-size: 16px;
  color: var(--ink);
}
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { display: none; }

.search-clear {
  border: 0;
  background: none;
  color: var(--faint);
  padding: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
}
.search-clear:hover { color: var(--ink); background: var(--line-soft); }
.search-clear .ic { width: 15px; height: 15px; }

/* top-level sections: restaurant / à la carte / bbq / supermarket */
.section-tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 2px 0 0;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.section-tabs::-webkit-scrollbar { display: none; }

.section-tab {
  position: relative;
  flex: none;
  padding: 10px 2px 12px;
  border: 0;
  background: none;
  font-family: var(--font-head);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: color 0.18s var(--ease-out);
}
.section-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--green);
  transform: scaleX(0);
  transition: transform 0.26s var(--ease-out);
}
.section-tab:hover { color: var(--ink-green); }
.section-tab[aria-selected="true"] { color: var(--ink-green); font-weight: 700; }
.section-tab[aria-selected="true"]::after { transform: scaleX(1); }
.section-tab .sec-count {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  margin-left: 5px;
}

.cat-tabs {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 0 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }

/* Both tab strips scroll horizontally and Restaurant alone has 20
   categories, so fade the edge that has more content off-screen --
   otherwise there is nothing telling you the row continues. */
.section-tabs,
.cat-tabs {
  --edge-fade: 26px;
}
.section-tabs.can-right,
.cat-tabs.can-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--edge-fade)), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - var(--edge-fade)), transparent);
}
.section-tabs.can-left,
.cat-tabs.can-left {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--edge-fade));
  mask-image: linear-gradient(to right, transparent, #000 var(--edge-fade));
}
.section-tabs.can-both,
.cat-tabs.can-both {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--edge-fade),
    #000 calc(100% - var(--edge-fade)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--edge-fade),
    #000 calc(100% - var(--edge-fade)), transparent);
}

.cat-tab {
  position: relative;
  flex: none;
  padding: 9px 2px 11px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.18s var(--ease-out);
}
.cat-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--green);
  transform: scaleX(0);
  transition: transform 0.24s var(--ease-out);
}
.cat-tab:hover { color: var(--ink-green); }
.cat-tab[aria-selected="true"] { color: var(--ink-green); }
.cat-tab[aria-selected="true"]::after { transform: scaleX(1); }

/* ---------------- product grid ---------------- */

.menu-area { padding: 16px 0 90px; min-height: 55vh; }

.grid-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 14px;
}
.grid-head h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-green);
  letter-spacing: -0.01em;
}
.grid-head span { font-size: 13px; color: var(--faint); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-1);
  animation: card-in 0.3s var(--ease-out) both;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}
@media (hover: hover) {
  .product-card:not(.unavailable):hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(30, 36, 26, 0.08), 0 10px 26px rgba(30, 36, 26, 0.09);
  }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3f0e7;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
  opacity: 0;
}
.card-media img.loaded { opacity: 1; }
.product-card:hover .card-media img { transform: scale(1.04); }

.card-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #c6ceba;
}
.card-placeholder .ic { width: 36px; height: 36px; stroke-width: 1.4; }

/* warm per-category placeholder tints */
.ph-protein  { background: #f7efe4; color: #cb9f7c; }
.ph-others   { background: #f5f2e1; color: #bfae67; }
.ph-bbq      { background: #f9ece2; color: #d29467; }
.ph-shawarma { background: #f6f0df; color: #c2a25f; }
.ph-pizza    { background: #f9efdf; color: #d0a057; }
.ph-noodles  { background: #f4f2e3; color: #b3a961; }
.ph-swallow  { background: #f2efe2; color: #a89d68; }
.ph-pastries { background: #f8f1e1; color: #cd9f5c; }
.ph-bread    { background: #f7f0dc; color: #c49c50; }
.ph-cakes    { background: #f9edea; color: #cf948d; }
.ph-juice    { background: #edf4e3; color: #8cb36e; }
.ph-drinks   { background: #eaf2ec; color: #77a887; }

.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.card-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.card-desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* where a search result lives, since results span every section */
.card-origin {
  margin: 0;
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-price {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink-green);
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.pack-note {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 10.5px;
  color: var(--faint);
}

.add-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  transition: background 0.16s, transform 0.16s var(--ease-spring);
}
.add-btn:hover { background: var(--green-dark); }
.add-btn:active { transform: scale(0.9); }
.add-btn .ic { width: 17px; height: 17px; stroke-width: 2; }
.add-btn:disabled { background: var(--line); color: var(--faint); cursor: not-allowed; }

/* in-card quantity stepper (replaces add button once item is in cart) */
.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--green-tint);
  border: 1px solid #d3e8d3;
  border-radius: 7px;
  height: 34px;
  animation: stepper-in 0.22s var(--ease-spring);
}
@keyframes stepper-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}
.stepper button {
  width: 30px;
  height: 32px;
  border: 0;
  background: none;
  color: var(--green-dark);
  display: grid;
  place-items: center;
  border-radius: 6px;
  transition: background 0.14s;
}
.stepper button:hover { background: #ddefdd; }
.stepper button .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.stepper .qty {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-green);
}
.stepper .qty.tick { animation: qty-tick 0.22s var(--ease-out); }
@keyframes qty-tick {
  0% { transform: translateY(35%); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* unavailable */
.product-card.unavailable .card-media img,
.product-card.unavailable .card-placeholder { filter: grayscale(0.9); opacity: 0.55; }
.product-card.unavailable .card-name,
.product-card.unavailable .card-price { color: var(--faint); }

.oos-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(34, 38, 31, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
}

.product-card.shake { animation: shake 0.4s var(--ease-out); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* skeletons */
.skel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.skel .s-media { aspect-ratio: 4/3; }
.skel .s-line { height: 12px; border-radius: 4px; margin: 10px 12px 0; }
.skel .s-line.short { width: 45%; margin-bottom: 14px; }
.s-media, .s-line {
  background: linear-gradient(100deg, #f0eee5 40%, #f8f6ee 50%, #f0eee5 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* menu status (empty / error / offline) */
.menu-status { display: none; }
.menu-status.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
  animation: card-in 0.3s var(--ease-out);
}
.menu-status .ic { width: 36px; height: 36px; stroke-width: 1.4; color: var(--faint); }
.menu-status h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 17px;
  color: var(--ink);
}
.menu-status p { margin: 0; font-size: 14px; max-width: 40ch; }
.menu-status .btn-secondary { margin-top: 6px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-green);
  text-decoration: none;
  transition: border-color 0.16s, background 0.16s;
}
.btn-secondary:hover { border-color: var(--green); background: var(--green-tint); }

/* ---------------- floating cart bar ---------------- */

.cart-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  transform: translateY(0);
  transition: transform 0.3s var(--ease-spring), background 0.18s;
  animation: bar-in 0.35s var(--ease-spring);
}
@keyframes bar-in {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
.cart-bar:hover { background: var(--green-dark); }
.cart-bar:active { transform: scale(0.985); }
.cart-bar.leaving { transform: translateY(130%); }

.cart-bar-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  font-size: 13px;
}
.cart-bar-label { flex: 1; text-align: left; }
.cart-bar-total { font-family: var(--font-head); font-weight: 700; }

/* ---------------- drawer ---------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 24, 18, 0.45);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.drawer-backdrop.open { opacity: 1; }

.drawer {
  position: fixed;
  z-index: 51;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* clip the sliding stage track */
  /* mobile: bottom sheet */
  left: 0;
  right: 0;
  bottom: 0;
  top: 8dvh;
  border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow-2);
  transform: translateY(105%);
  transition: transform 0.38s var(--ease-spring);
}
.drawer.open { transform: translateY(0); }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-head h2 {
  flex: 1;
  margin: 0;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-green);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn .ic { width: 18px; height: 18px; }

.drawer-track {
  flex: 1;
  display: flex;
  width: 300%;
  min-height: 0;
  transform: translateX(0);
  transition: transform 0.34s var(--ease-spring);
}
.drawer-track[data-pos="1"] { transform: translateX(-33.3333%); }
.drawer-track[data-pos="2"] { transform: translateX(-66.6667%); }

.drawer-panel {
  width: 33.3333%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}

.panel-foot {
  border-top: 1px solid var(--line-soft);
  background: var(--card);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--muted);
}
.foot-row strong { color: var(--ink); font-family: var(--font-head); font-size: 15.5px; }
.foot-row.foot-total { font-size: 15px; }
.foot-row.foot-total strong { font-size: 19px; color: var(--ink-green); }

.foot-hint { margin: 0; font-size: 12px; color: var(--faint); text-align: center; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.16s, transform 0.16s var(--ease-out), opacity 0.16s;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary .ic { width: 19px; height: 19px; }

/* cart lines */
.cart-line {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  animation: card-in 0.25s var(--ease-out);
}
.cart-line.removing {
  animation: line-out 0.25s var(--ease-out) forwards;
}
@keyframes line-out {
  to { opacity: 0; transform: translateX(-14px); height: 0; padding: 0; }
}

.cart-line-media {
  width: 52px;
  height: 52px;
  border-radius: 7px;
  background: #f3f0e7;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #c6ceba;
  flex: none;
}
.cart-line-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-media .ic { width: 22px; height: 22px; stroke-width: 1.4; }

.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-line-price { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.cart-line-total { font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--ink-green); }

.cart-line .stepper { height: 30px; }
.cart-line .stepper button { width: 26px; height: 28px; }

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 46px 16px;
}
.cart-empty .ic { width: 34px; height: 34px; stroke-width: 1.3; color: var(--faint); margin: 0 auto 10px; }
.cart-empty p { margin: 0; font-size: 14px; }

/* segmented control */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--line-soft);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 14px;
}
.seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--card);
  border-radius: 7px;
  box-shadow: var(--shadow-1);
  transition: transform 0.28s var(--ease-spring);
}
.seg[data-active="delivery"] .seg-thumb { transform: translateX(100%); }
.seg-opt {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border: 0;
  background: none;
  border-radius: 7px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s;
}
.seg-opt[aria-checked="true"] { color: var(--ink-green); }
.seg-opt .ic { width: 18px; height: 18px; }

.pickup-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--green-tint);
  border: 1px solid #d3e8d3;
  border-radius: var(--radius);
  padding: 11px 12px;
  margin-bottom: 14px;
  animation: card-in 0.25s var(--ease-out);
}
.pickup-note .ic { color: var(--green-dark); width: 18px; height: 18px; margin-top: 1px; }
.pickup-note p { margin: 0; font-size: 12.5px; color: var(--ink-green); line-height: 1.45; }

/* delivery locations */
.location-block { margin-bottom: 14px; animation: card-in 0.25s var(--ease-out); }
.location-list { display: flex; flex-direction: column; gap: 7px; }

.location-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color 0.16s, background 0.16s;
}
.location-opt:hover { border-color: #bcd9bc; }
.location-opt[aria-checked="true"] {
  border-color: var(--green);
  background: var(--green-tint);
}
.location-radio {
  width: 18px;
  height: 18px;
  border: 1.6px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: border-color 0.16s;
  flex: none;
}
.location-opt[aria-checked="true"] .location-radio { border-color: var(--green); }
.location-radio::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  transform: scale(0);
  transition: transform 0.2s var(--ease-spring);
}
.location-opt[aria-checked="true"] .location-radio::after { transform: scale(1); }
.location-name { flex: 1; font-weight: 500; font-size: 14px; }
.location-fee { font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--ink-green); }

/* form fields */
.details-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-green);
  letter-spacing: 0.01em;
}
.field-label em { font-style: normal; font-weight: 400; color: var(--faint); }
.field input {
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  outline: 0;
  /* 16px minimum stops iOS zooming the page when the customer taps a
     checkout field -- the worst possible moment to lose the layout */
  font-size: 16px;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 140, 12, 0.12);
}
.field input.invalid { border-color: var(--danger); }
.field input.invalid:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12); }

.form-error {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--danger);
  animation: card-in 0.2s var(--ease-out);
}

/* review */
.review-section { margin-bottom: 18px; animation: card-in 0.3s var(--ease-out) both; }
.review-section:nth-child(2) { animation-delay: 0.05s; }
.review-section:nth-child(3) { animation-delay: 0.1s; }
.review-section h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
}

.review-lines {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 4px 12px;
}
.review-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.review-line:last-child { border-bottom: 0; }
.review-line .qty { color: var(--muted); font-variant-numeric: tabular-nums; }
.review-line .amount { font-weight: 600; color: var(--ink); white-space: nowrap; }
.review-line-name { flex: 1; }

.review-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  padding: 4px 0;
}
.review-kv .k { color: var(--muted); }
.review-kv .v { text-align: right; font-weight: 500; }

.review-warning {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: var(--sand);
  border: 1px solid #eadfc3;
  color: var(--sand-ink);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.review-warning .ic { width: 16px; height: 16px; margin-top: 1px; }

.btn-whatsapp { background: #128c3c; }
.btn-whatsapp:hover { background: #0e7431; }

/* spinner inside buttons */
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* success view */
.success-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 18px;
  animation: card-in 0.3s var(--ease-out);
}
.success-check {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--green-tint);
  border: 1.5px solid #cfe7cf;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  margin-bottom: 14px;
}
.success-check svg { width: 30px; height: 30px; }
.success-check .draw {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  animation: draw 0.5s 0.15s var(--ease-out) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.success-view h3 {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--ink-green);
}
.success-ref { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.success-ref strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.success-note { margin: 0 0 20px; font-size: 13.5px; color: var(--muted); max-width: 34ch; }
.success-view .btn-primary { max-width: 320px; }
.success-actions { display: flex; flex-direction: column; gap: 9px; width: 100%; align-items: center; }
.link-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}
.link-btn:hover { color: var(--ink-green); background: var(--line-soft); }
.link-btn .ic { width: 15px; height: 15px; }

/* ---------------- footer ---------------- */

.site-footer {
  background: var(--ink-green);
  color: #cfe0d5;
  margin-top: 30px;
}
.footer-grid {
  display: grid;
  gap: 26px;
  padding-top: 34px;
  padding-bottom: 26px;
}
.footer-logo {
  height: 24px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
.footer-tag { font-size: 13px; margin: 10px 0 0; color: #9dbcaa; }
.site-footer h3 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}
.site-footer p { margin: 0 0 7px; font-size: 13.5px; }
.site-footer a {
  color: #cfe0d5;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.site-footer a:hover { color: #fff; }
.site-footer .ic { width: 16px; height: 16px; }

.footer-base {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
  padding-bottom: 18px;
}
.footer-base p { font-size: 12.5px; color: #9dbcaa; margin: 0; }
.footer-base a { color: #9dbcaa; }

/* ---------------- desktop ---------------- */

/* ---------------- phones ----------------
   Two things matter most here: fingers need ~44px of target, and the
   customer should see food without scrolling past a screenful of chrome. */
@media (max-width: 640px) {
  /* reclaim vertical space above the first product */
  .intro-row { padding-top: 13px; padding-bottom: 13px; }
  .intro-text h1 { font-size: 20px; }
  .intro-text p { font-size: 12.5px; }
  .intro-photos img { width: 46px; height: 46px; margin-left: -15px; }
  .toolbar { padding-top: 10px; }
  .section-tab { padding: 8px 2px 10px; font-size: 15px; }
  .cat-tabs { gap: 13px; }
  .cat-tab { padding: 8px 5px 10px; }
  .menu-area { padding-top: 12px; }
  .grid-head { margin: 2px 0 10px; }

  /* On a phone the brand bar doesn't need to follow you down a long
     list -- the floating cart bar keeps the cart reachable. Letting it
     scroll away hands ~60px back to the menu on every screen. */
  .site-header { position: static; }
  .toolbar { top: 0; }

  /* touch targets */
  .add-btn { width: 42px; height: 42px; border-radius: 9px; }
  .add-btn .ic { width: 19px; height: 19px; }
  .stepper { height: 42px; }
  .stepper button { width: 38px; height: 40px; }
  .stepper .qty { min-width: 24px; font-size: 14.5px; }
  .cart-line .stepper { height: 38px; }
  .cart-line .stepper button { width: 34px; height: 36px; }
  .icon-btn { width: 42px; height: 42px; }
  .seg-opt { padding: 13px 8px; }
  .location-opt { padding: 14px 12px; }
}

@media (max-width: 420px) {
  .intro-photos img { width: 42px; height: 42px; margin-left: -16px; }
  .intro-text p { display: none; } /* the H1 already says it; give the space to food */
}

@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .intro-text h1 { font-size: 27px; }
  .intro-photos img { width: 62px; height: 62px; }
}

@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* Sections get their own full-width row; the categories for the chosen
     section sit on the row below, beside the search box. Without the
     wrap + 100% basis the section tabs join the category row and the two
     tiers read as one meaningless strip. */
  .toolbar .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 18px;
  }
  .section-tabs { flex: 1 0 100%; order: 0; }
  .cat-tabs { flex: 1; order: 1; padding: 12px 0; min-width: 0; }
  .search-box { width: 300px; flex: none; order: 2; }

  /* drawer becomes a right-side panel */
  .drawer {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    width: 430px;
    border-radius: 0;
    transform: translateX(105%);
  }
  .drawer.open { transform: translateX(0); }

  .cart-bar {
    left: auto;
    right: 24px;
    bottom: 24px;
    min-width: 300px;
  }
}

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
