/* Cowboy's Restaurant — customer site
   The printed menu is the brand: white paper, green section headers,
   red specials, dotted rules. The site borrows those directly. */

:root {
  --paper: #FBF8F1;
  --paper-2: #F4EEDF;
  --ink: #1E1A16;
  --ink-2: #5E554A;
  --rule: #CBBFAA;
  --green: #2F6B3A;
  --green-dark: #235229;
  --green-tint: #E6EFE3;
  --red: #B6321F;
  --red-dark: #8F2616;
  --red-tint: #F7E6E2;
  --gold: #E0A81E;
  --white: #FFFFFF;
  --focus: #1F5FBF;
  --shadow: 0 10px 30px rgba(30, 26, 22, .18);
  --display: "Alfa Slab One", "Rockwell Extra Bold", Georgia, serif;
  --body: "Barlow", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
  --gutter: 16px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }
a { color: var(--green-dark); }
button { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter);
  background: var(--paper);
  border-bottom: 3px dotted var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 25px; fill: var(--ink); }
.brand-name { font-family: var(--display); font-size: 22px; letter-spacing: .01em; }
.cart-btn {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px 0 6px;
  border: 0; border-radius: 999px;
  background: var(--red); color: #fff;
  font-weight: 600; cursor: pointer;
}
.cart-btn:active { background: var(--red-dark); }
.cart-count { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--red); font-weight: 700; }
.cart-label { display: none; }
.cart-total { font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .cart-label { display: inline; } }

/* ---------- loading ---------- */
.loading { padding: 80px var(--gutter); text-align: center; color: var(--ink-2); }
.loading-mark { width: 72px; height: 45px; margin: 0 auto 12px; fill: var(--rule); }

/* ---------- hero ---------- */
.hero {
  padding: 28px var(--gutter) 24px;
  text-align: center;
  border-bottom: 3px dotted var(--rule);
  background:
    radial-gradient(ellipse at 50% 120%, var(--paper-2), transparent 70%),
    var(--paper);
}
.hero-mark { width: 140px; height: 87px; margin: 0 auto 10px; fill: var(--ink); }
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(38px, 10vw, 64px); line-height: .95;
  margin: 0; color: var(--ink);
}
.hero .place { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }
.hero .tagline {
  margin: 18px auto 0; max-width: 34ch;
  font-size: clamp(19px, 4.6vw, 24px); font-weight: 600; line-height: 1.25; color: var(--green-dark);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 7px 14px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  background: var(--green-tint); color: var(--green-dark);
}
.status-pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.status-pill.closed { background: var(--red-tint); color: var(--red-dark); }
.status-pill.closed::before { background: var(--red); }
.status-pill.paused { background: #FBF1D6; color: #7A5A00; }
.status-pill.paused::before { background: var(--gold); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.hero-msg { margin: 14px auto 0; max-width: 44ch; color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: var(--radius); border: 2px solid transparent;
  font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: background .12s, color .12s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary[disabled] { background: #C9B9B3; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink-2); font-weight: 600; min-height: 44px; }
.btn-ghost:hover { color: var(--ink); }
.btn-block { width: 100%; }

/* ---------- specials strip ---------- */
.specials {
  display: grid; gap: 6px;
  padding: 14px var(--gutter);
  background: var(--red); color: #fff;
  text-align: center; font-weight: 600; font-size: 15px;
}
.specials .special-today { font-size: 17px; }
.specials .special-today::before { content: "Today: "; font-weight: 400; opacity: .85; }

/* ---------- category nav ---------- */
.catnav {
  position: sticky; top: var(--topbar-h); z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.catnav-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--gutter);
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.catnav-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--rule); background: transparent;
  font-weight: 600; font-size: 15px; white-space: nowrap; cursor: pointer; color: var(--ink);
}
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- menu ---------- */
.menu { max-width: 760px; margin: 0 auto; padding: 8px var(--gutter) 60px; }
.cat { padding-top: 26px; scroll-margin-top: calc(var(--topbar-h) + 112px); }
.cat-head { text-align: center; padding: 10px 0 8px; border-top: 3px dotted var(--rule); border-bottom: 3px dotted var(--rule); }
.cat-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 6vw, 32px); color: var(--green); }
.cat-note { margin: 6px 0 0; color: var(--ink-2); font-style: italic; font-size: 15px; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px dotted var(--rule); }
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; }
.item-desc { margin: 3px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.35; }
.item-price { margin-top: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.item-price .from { font-weight: 400; color: var(--ink-2); font-size: 14px; }
.item.soldout .item-name, .item.soldout .item-desc, .item.soldout .item-price { color: #A39A8E; }
.tag-soldout { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: 13px; font-weight: 600; vertical-align: 2px; }
.add-btn {
  flex: 0 0 auto; width: 44px; height: 44px; margin-top: 2px;
  border-radius: 50%; border: 2px solid var(--red); background: var(--paper); color: var(--red);
  font-size: 26px; line-height: 1; font-weight: 600; cursor: pointer;
}
.add-btn:hover { background: var(--red); color: #fff; }
.add-btn[disabled] { border-color: var(--rule); color: var(--rule); background: transparent; cursor: not-allowed; }

/* ---------- footer ---------- */
.footer { border-top: 3px dotted var(--rule); background: var(--paper-2); padding: 26px var(--gutter) 40px; color: var(--ink-2); font-size: 15px; }
.footer-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 20px; }
@media (min-width: 640px) { .footer-inner { grid-template-columns: 1fr 1fr 1fr; } }
.footer-name { font-family: var(--display); color: var(--ink); font-size: 18px; margin-bottom: 4px; }
.footer-heading { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.footer-note p { margin: 0 0 8px; }
.footer-staff { color: var(--ink-2); }
.hours-row { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- sheets (bottom sheets on phones, centered dialogs on desktop) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(30, 26, 22, .55); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  animation: sheet-up .22s ease-out;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; max-height: 88vh; transform: translate(-50%, -50%); border-radius: 18px; animation: none; }
}
.sheet:focus { outline: none; }
.sheet-head { position: relative; padding: 18px 56px 10px 20px; border-bottom: 1px solid var(--rule); }
.sheet-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.15; }
.sheet-price { margin-top: 4px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper-2); font-size: 18px; cursor: pointer; }
.sheet-body { overflow-y: auto; padding: 14px 20px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); display: flex; gap: 12px; align-items: center; background: var(--paper); }
.sheet-foot-col { flex-direction: column; align-items: stretch; gap: 10px; }
.sheet-desc { margin: 0 0 12px; color: var(--ink-2); }

.group { margin: 14px 0 6px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.group-name { font-weight: 700; font-size: 17px; }
.group-rule { font-size: 14px; color: var(--ink-2); }
.group.invalid .group-rule { color: var(--red); font-weight: 600; }
.choice {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; margin: 0 0 6px;
  border: 1.5px solid var(--rule); border-radius: var(--radius); background: var(--white);
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
.choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); flex: 0 0 auto; }
.choice-text { flex: 1; display: flex; flex-direction: column; }
.choice-name { font-weight: 600; }
.choice-sub { font-size: 14px; color: var(--ink-2); }
.choice-price { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.choice-check { margin-top: 14px; }

.field { display: block; margin: 0 0 16px; }
.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.field-help { display: block; font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.optional { font-weight: 400; color: var(--ink-2); font-size: 14px; }
fieldset.field { border: 0; padding: 0; }
legend.field-label { padding: 0; }
input[type=text], input[type=tel], textarea, .select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: var(--radius);
  background: var(--white); font: inherit; color: var(--ink);
}
textarea { resize: vertical; min-height: 56px; }
input:focus, textarea:focus, .select:focus { border-color: var(--green); outline: 3px solid rgba(47, 107, 58, .25); outline-offset: 0; }
.select { margin: 6px 0 4px; }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.notes-field { margin-top: 16px; }

.pay-note { margin: 8px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--paper-2); color: var(--ink-2); font-size: 15px; }
.notice { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 600; }
.notice-closed { background: var(--red-tint); color: var(--red-dark); }
.form-error { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--red-tint); color: var(--red-dark); font-weight: 600; }
.hp { position: absolute; left: -9999px; top: -9999px; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--white); }
.qty-btn { width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; cursor: pointer; border-radius: 50%; }
.qty-num { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.btn-add { flex: 1; }
.btn-add span { font-variant-numeric: tabular-nums; }

/* cart lines */
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px dotted var(--rule); }
.line-name { font-weight: 700; }
.line-opts { color: var(--ink-2); font-size: 14px; grid-column: 1; }
.line-notes { color: var(--ink-2); font-size: 14px; font-style: italic; grid-column: 1; }
.line-price { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.line-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.line-remove { border: 0; background: transparent; color: var(--red-dark); font-weight: 600; cursor: pointer; padding: 6px 0; }
.qty.small .qty-btn { width: 38px; height: 38px; }
.empty { text-align: center; color: var(--ink-2); padding: 30px 0; }

.totals { display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; color: var(--ink-2); }
.totals .grand { color: var(--ink); font-weight: 700; font-size: 19px; border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  z-index: 70; padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- order status page ---------- */
.status-page { max-width: 640px; margin: 0 auto; padding: 28px var(--gutter) 60px; }
.status-card { background: var(--white); border: 1.5px solid var(--rule); border-radius: 16px; padding: 22px 20px; }
.status-number { font-family: var(--display); font-size: clamp(44px, 14vw, 72px); line-height: 1; color: var(--green); margin: 0; }
.status-sub { color: var(--ink-2); margin: 6px 0 0; }
.status-headline { font-size: 22px; font-weight: 700; margin: 18px 0 4px; }
.status-headline.cancelled { color: var(--red-dark); }
.status-detail { margin: 0; color: var(--ink-2); }
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; color: var(--ink-2); }
.step::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rule); margin-left: 4px; }
.step.done { color: var(--ink); }
.step.done::before { background: var(--green); border-color: var(--green); }
.step.current { color: var(--ink); font-weight: 700; }
.step.current::before { border-color: var(--green); background: var(--green-tint); box-shadow: 0 0 0 4px rgba(47, 107, 58, .18); }
.step-time { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.status-section { margin-top: 20px; }
.status-section h2 { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 0 0 8px; color: var(--green); }
.pickup-box { padding: 12px 14px; border-radius: var(--radius); background: var(--green-tint); color: var(--green-dark); font-weight: 600; }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.status-note { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.not-found { text-align: center; padding: 60px var(--gutter); }

/* desktop refinements */
@media (min-width: 900px) {
  .hero { padding: 48px var(--gutter) 40px; }
  .hero-mark { width: 180px; height: 112px; }
  .menu { padding-bottom: 90px; }
}

/* ---------- search ---------- */
.search { position: relative; padding: 10px var(--gutter) 0; }
.search input {
  width: 100%; min-height: 44px; padding: 10px 44px 10px 40px;
  border: 1.5px solid var(--rule); border-radius: 999px; background: var(--white);
  font: inherit; font-size: 16px; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E554A' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center; background-size: 18px;
  -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { border-color: var(--green); outline: 3px solid rgba(47, 107, 58, .25); outline-offset: 0; }
.search-clear { position: absolute; right: calc(var(--gutter) + 6px); top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--paper-2); font-size: 15px; cursor: pointer; }
.search-summary { padding: 10px var(--gutter) 12px; color: var(--ink-2); font-size: 15px; font-weight: 600; }

/* ---------- plate photos ---------- */
.item-thumb { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: var(--paper-2); }
.sheet-photo { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin: 2px 0 14px; background: var(--paper-2); }

/* ---------- staff bar (dine-in mode) ---------- */
.staffbar {
  position: sticky; top: var(--topbar-h); z-index: 35;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px var(--gutter); background: var(--ink); color: var(--paper); font-size: 15px;
}
.staffbar-label { font-weight: 700; }
.staffbar-link { margin-left: auto; color: var(--paper); font-weight: 600; }
.segmented { display: inline-flex; border: 1.5px solid rgba(255, 255, 255, .5); border-radius: 999px; overflow: hidden; }
.seg { border: 0; background: transparent; color: var(--paper); padding: 7px 14px; font-weight: 700; font-size: 15px; cursor: pointer; }
.seg.active { background: var(--paper); color: var(--ink); }
body:has(.staffbar:not([hidden])) .catnav { top: calc(var(--topbar-h) + 46px); }
body:has(.staffbar:not([hidden])) .cat { scroll-margin-top: calc(var(--topbar-h) + 46px + 110px); }
.notice-staff { background: var(--green-tint); color: var(--green-dark); }
.input-big { font-size: 24px !important; font-weight: 700; letter-spacing: .04em; }
.status-table { display: inline-block; vertical-align: middle; margin-left: 10px; padding: 4px 12px; border-radius: 999px; background: var(--green); color: #fff; font-family: var(--body); font-size: 18px; font-weight: 700; }
