/* Curry & Chopsticks order page. A street-stall signboard: cart-paint green, turmeric lettering, FSSAI diet marks. */
:root {
  --green: #0E3B2E;      /* signboard, primary buttons */
  --green-2: #14513F;    /* pressed / hover */
  --turmeric: #F4B400;   /* lettering on the sign, the offer ticket */
  --chilli: #B3261E;     /* non-veg mark, warnings */
  --leaf: #1E8E3E;       /* veg mark */
  --egg: #C27C0E;        /* egg mark */
  --ink: #1B1F1D;
  --muted: #5D6762;
  --line: #E3E7E4;
  --wash: #F1F4F2;
  --paper: #FFFFFF;
  --radius-s: 6px;
  --radius-m: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.45 var(--font);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the sign ---------- */
.sign { background: var(--green); color: var(--turmeric); }
.sign-inner { max-width: 720px; margin: 0 auto; padding: 28px 20px 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lockup { margin: 0; font-weight: 850; font-size: clamp(34px, 10vw, 52px); line-height: .9; letter-spacing: -0.035em; display: flex; flex-direction: column; }
.lockup span:first-child { font-size: .62em; letter-spacing: -0.02em; }
.sign-sub { margin: 0 0 4px; color: #CFE0D8; font-size: 14px; text-align: right; max-width: 12em; }
.ticket {
  margin: 0; background: var(--turmeric); color: var(--green);
  font-weight: 750; font-size: 17px; text-align: center; padding: 10px 16px;
  /* the torn ticket edge */
  -webkit-mask: radial-gradient(6px at 50% 0, #0000 98%, #000) 50% / 18px 100% repeat-x;
          mask: radial-gradient(6px at 50% 0, #0000 98%, #000) 50% / 18px 100% repeat-x;
  padding-top: 14px;
}
.ticket small { display: block; font-weight: 500; font-size: 13px; opacity: .85; }

.notice { max-width: 720px; margin: 12px auto 0; padding: 10px 14px; border-radius: var(--radius-s); background: #FCEDEB; color: #6E1712; font-size: 15px; width: calc(100% - 32px); }
.notice.calm { background: var(--wash); color: var(--ink); }

/* ---------- search, filter, sections ---------- */
.tools { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.tools-row { max-width: 720px; margin: 0 auto; padding: 12px 16px 6px; display: flex; gap: 8px; }
.search { flex: 1; }
.search input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--wash);
  font-size: 16px; /* 16px stops iOS zooming in */
}
.search input:focus { background: var(--paper); border-color: var(--green); outline: none; box-shadow: 0 0 0 3px #0E3B2E22; }
/* ---------- who is it for: two tabs ---------- */
.modes { max-width: 720px; margin: 14px auto 0; padding: 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode {
  text-align: left; border: 1.5px solid var(--line); background: var(--paper); border-radius: var(--radius-m); padding: 10px 14px;
  display: grid; gap: 2px;
}
.mode-title { font-weight: 800; font-size: 17px; }
.mode-sub { font-size: 13px; color: var(--muted); }
.mode[aria-selected="true"] { border-color: var(--green); background: var(--green); color: var(--paper); }
.mode[aria-selected="true"] .mode-sub { color: #CFE0D8; }
.group-intro { max-width: 720px; margin: 14px auto 0; padding: 0 16px; color: var(--ink); font-size: 15px; }

/* ---------- Veg / Egg / Non-veg switches ---------- */
.diets { max-width: 720px; margin: 0 auto; padding: 0 16px 10px; display: flex; gap: 18px; flex-wrap: wrap; }
.diet { border: 0; background: none; padding: 4px 0; display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.track { width: 38px; height: 22px; border-radius: 11px; background: #C9D1CD; position: relative; flex: none; transition: background .15s; }
.knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.diet[aria-checked="true"] .knob { transform: translateX(16px); }
.diet[data-diet="veg"][aria-checked="true"] .track { background: var(--leaf); }
.diet[data-diet="egg"][aria-checked="true"] .track { background: var(--egg); }
.diet[data-diet="nonveg"][aria-checked="true"] .track { background: var(--chilli); }
.diet[aria-checked="false"] { color: var(--muted); }
.chips { max-width: 720px; margin: 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; background: var(--wash); color: var(--ink); padding: 7px 12px; border-radius: 16px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip[aria-current="true"] { background: var(--green); color: var(--paper); }

/* ---------- menu ---------- */
main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.loading, .empty { color: var(--muted); padding: 40px 0; text-align: center; }
.section { padding-top: 22px; scroll-margin-top: 150px; }
.section h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 800; }
.section-note { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.items { list-style: none; margin: 8px 0 0; padding: 0; }
.item { display: grid; grid-template-columns: 18px 1fr auto; gap: 4px 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.item:first-child { border-top: 0; }
.item-name { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.3; }
.item-price { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.item .mark { margin-top: 3px; }
.variants { grid-column: 2 / 4; display: grid; gap: 8px; margin-top: 6px; }
.variant { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 6px 12px; border-left: 3px solid var(--line); }
.variant-label { font-size: 15px; }
.variant-label b { font-weight: 600; }

/* FSSAI-style diet marks: a square outline with a dot (veg, egg) or triangle (non-veg) */
.mark { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 3px; display: inline-grid; place-items: center; flex: none; }
.mark::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mark.veg { color: var(--leaf); }
.mark.egg { color: var(--egg); }
.mark.nonveg { color: var(--chilli); }
.mark.nonveg::after { width: 0; height: 0; border-radius: 0; background: none; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-bottom: 8px solid currentColor; }

/* add button and stepper */
.add {
  min-width: 84px; height: 38px; border-radius: var(--radius-s); border: 1.5px solid var(--green); background: var(--paper); color: var(--green); font-weight: 750; font-size: 15px;
}
.add:active { background: #E7EFEA; }
.stepper { display: inline-flex; align-items: center; height: 38px; min-width: 84px; border-radius: var(--radius-s); background: var(--green); color: var(--paper); }
.stepper button { width: 32px; height: 38px; border: 0; background: none; color: inherit; font-size: 20px; font-weight: 700; line-height: 1; }
.stepper output { min-width: 20px; text-align: center; font-weight: 750; }

/* ---------- cart bar and sheet ---------- */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(#fff0, #fff 30%); }
.cartbar-btn {
  max-width: 688px; margin: 0 auto; width: 100%; min-height: 56px; border: 0; border-radius: var(--radius-m); background: var(--green); color: var(--paper);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 16px; text-align: left;
}
.cartbar-count { font-size: 14px; color: #CFE0D8; }
.cartbar-total { font-weight: 800; font-size: 18px; }
.cartbar-total s { font-weight: 500; font-size: 14px; color: #CFE0D8; margin-right: 6px; }
.cartbar-go { font-weight: 750; color: var(--turmeric); }
.cartbar.bump .cartbar-btn { animation: bump .25s ease-out; }
@keyframes bump { 50% { transform: scale(1.02); } }

.sheet-backdrop { position: fixed; inset: 0; background: #0E3B2E66; z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88vh; overflow: auto; background: var(--paper);
  border-radius: 18px 18px 0 0; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto;
  animation: rise .22s ease-out;
}
@keyframes rise { from { transform: translateY(24px); } }
.sheet-head { position: sticky; top: 0; background: var(--paper); display: flex; align-items: center; justify-content: space-between; padding: 18px 0 8px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.close { width: 40px; height: 40px; border: 0; border-radius: 20px; background: var(--wash); font-size: 16px; }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 18px 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line-name { font-size: 15px; font-weight: 600; }
.line-price { grid-column: 2; color: var(--muted); font-size: 14px; }
.line .stepper { grid-row: 1 / 3; grid-column: 3; }
.bill { margin: 12px 0 0; padding: 14px 0 0; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 15px; }
.bill dt { color: var(--muted); }
.bill dd { margin: 0; text-align: right; }
.bill .save { color: #0F5223; font-weight: 650; }
.bill .grand { font-weight: 800; font-size: 18px; color: var(--ink); }
.small { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.warn { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-s); background: #FCEDEB; color: #6E1712; font-size: 14px; }
.who { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.primary {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; margin-top: 16px; border: 0; border-radius: var(--radius-m);
  background: var(--green); color: var(--paper); font-weight: 800; font-size: 17px; text-decoration: none;
}
.primary:disabled { background: #9DB0A8; cursor: not-allowed; }
.primary:not(:disabled):active { background: var(--green-2); }

/* ---------- sent ---------- */
.done { position: fixed; inset: 0; z-index: 30; background: var(--green); color: var(--paper); display: grid; place-items: center; padding: 24px; }
.done-inner { max-width: 420px; text-align: center; }
.done-tick { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: var(--turmeric); color: var(--green); display: grid; place-items: center; font-size: 40px; font-weight: 900; }
.done h2 { margin: 0; font-size: 26px; line-height: 1.2; color: var(--turmeric); }
.done p { color: #DDE9E3; margin: 12px 0 0; }
.done .primary { background: var(--turmeric); color: var(--green); }

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