/* ============================================================
   Oxford Social — order.html (QR landing / order-at-table)
   Page-specific styles only — global components live in
   css/styles.css and are never redefined here. Mobile-first:
   this is the page people open standing at their table.

   Design v4: strict monochrome — everything consumes the
   contextual -c tokens (dark is the default; the sticky table
   bar and the bottom cart bar sit on --bg-alt-c with hairlines).
   ============================================================ */

/* ----- Layout helpers ----- */
.order-wrap { max-width: 720px; margin: 0 auto; }

/* Tighter vertical rhythm than the default .section padding —
   ordering is a utility flow, not a brochure scroll. */
.section.order-section { padding: 1.4rem clamp(1.2rem, 5vw, 3rem) 4.5rem; }

/* Opt the ordering sections out of the global scroll-reveal: the
   menu section is far taller than the viewport, so it can never
   reach the observer's visibility threshold on a phone. */
.section.order-section.reveal { opacity: 1; transform: none; transition: none; }

/* ----- Compact hero (get people to the menu fast) ----- */
/* The body already clears the fixed nav (padding-top: --nav-h). */
.page-hero--order { min-height: 0; padding: 2.6rem clamp(1.2rem, 5vw, 3rem) 2.2rem; }
/* .page-hero sets display:flex, which would beat the [hidden] UA rule —
   the hero is hidden while the tracking screen is up. */
.page-hero--order[hidden] { display: none; }
.page-hero--order .page-hero__inner { max-width: 720px; }
.page-hero--order h1 { font-size: clamp(2.3rem, 9vw, 3.4rem); }
.order-age {
  margin-top: 1.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ----- Resume-order banner ----- */
.resume { border-bottom: 1px solid var(--line-c); background: var(--bg-alt-c); }
.resume__in {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding: 0.85rem clamp(1.2rem, 5vw, 3rem);
}
.resume p { font-size: 0.9rem; }
.resume strong { color: var(--accent-c); letter-spacing: 0.05em; font-weight: 600; }
.resume__actions { display: flex; align-items: center; gap: 0.8rem; }
.resume__btn { padding: 0.5rem 1.1rem; font-size: 0.7rem; }
.resume__dismiss {
  background: none;
  border: 0;
  color: var(--muted-c);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.resume__dismiss:hover { color: var(--ink-c); }
.resume__dismiss:focus-visible { outline: 2px solid var(--accent-c); outline-offset: 2px; }

/* ----- Table picker (1px-border squares) ----- */
.order-picker h2 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin-bottom: 0.5rem; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.7rem;
  margin: 1.5rem 0 1.3rem;
}
.picker-grid button {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-c);
  font: inherit;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.picker-grid button:hover { border-color: var(--accent-c); color: var(--accent-c); }
.picker-grid button:focus-visible { outline: 2px solid var(--accent-c); outline-offset: 2px; }
.picker-grid button.is-current {
  border-color: var(--accent-c);
  color: var(--accent-c);
  background: rgba(242, 239, 232, 0.08);
}
.order-picker__browse { font-size: 0.88rem; }
.order-picker__browse a { color: var(--accent-c); border-bottom: 1px solid var(--line-c); }
.order-picker__browse a:hover { border-color: var(--accent-c); }

/* ----- Sticky cluster: table bar + category tabs -----
   Mono: sits on the alternate dark band with a hairline below
   (.theme-dark in the markup is a harmless v4 alias).
   --oxso-nav-h is measured by js/order.js (fixed nav height). */
.order-sticky {
  position: sticky;
  top: var(--oxso-nav-h, var(--nav-h, 76px));
  z-index: 40;
  background: var(--bg-alt-c);
  border-bottom: 1px solid var(--line-c);
}
.order-sticky__in { max-width: 720px; margin: 0 auto; padding: 0 clamp(1.2rem, 5vw, 3rem); }
.tablebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0 0.35rem;
}
.tablebar__label { font-size: 0.9rem; color: var(--muted-c); letter-spacing: 0.03em; }
.tablebar__label strong { color: var(--accent-c); font-weight: 500; }
.tablebar__change {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  color: var(--muted-c);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.34rem 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tablebar__change:hover { color: var(--accent-c); border-color: var(--accent-c); }
.tablebar__change:focus-visible { outline: 2px solid var(--accent-c); outline-offset: 2px; }
/* The sticky container draws the divider — drop the tabs' own. */
.order-tabs { border-bottom: 0; }
.order-tabs__skel { width: 84px; height: 1.4rem; margin: 0.55rem 0.5rem 0.55rem 0; border-radius: var(--radius); }

/* ----- Menu list ----- */
.order-cat { padding-top: 1.6rem; }
.order-cat h2 { font-size: clamp(1.75rem, 6.5vw, 2.3rem); }
.order-cat__note { font-size: 0.85rem; color: var(--accent-c); margin-top: 0.1rem; }
.mi {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line-c);
}
.mi__info { flex: 1; min-width: 0; }
.mi__name { font-size: 1.2rem; line-height: 1.15; color: var(--ink-c); }
.mi__desc { color: var(--muted-c); font-size: 0.87rem; margin: 0.2rem 0 0.35rem; }
.mi__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.mi__price { color: var(--accent-c); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.mi__act {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  min-width: 96px;
  padding-top: 0.25rem;
}
/* ADD — small ghost rectangle (mirrors .btn--ghost at chip size) */
.mi__add {
  background: none;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  color: var(--ink-c);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.mi__add:hover { border-color: var(--accent-c); color: var(--accent-c); }
.mi__add:focus-visible { outline: 2px solid var(--accent-c); outline-offset: 2px; }

/* ----- Menu error state ----- */
.order-error { margin-top: 1.6rem; }
.order-error__msg { display: block; margin-top: 0.3rem; color: var(--muted-c); }
.order-error .btn { margin-top: 1.1rem; }

/* ----- Fixed bottom cart bar (alternate dark band, hairline top) -----
   Mono: warm-white ink and total; emphasis via the outlined
   button, not colour (.theme-dark in the markup is a v4 alias). */
.cartbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 0.85rem clamp(1rem, 4vw, 2rem) calc(0.85rem + env(safe-area-inset-bottom));
  background: var(--bg-alt-c);
  border-top: 1px solid var(--line-c);
}
.cartbar__btn {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: none;
  border: 1px solid var(--accent-c);
  border-radius: var(--radius);
  color: var(--ink-c);
  padding: 0.9rem 1.2rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.cartbar__btn:hover { background: var(--accent-c); color: var(--bg-c); }
.cartbar__btn:hover .cartbar__count { border-color: currentColor; }
.cartbar__btn:hover .cartbar__total { color: inherit; }
.cartbar__btn:focus-visible { outline: 2px solid var(--accent-c); outline-offset: 3px; }
.cartbar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease;
}
/* The "View order" text between the count chip and the total. */
.cartbar__label { white-space: nowrap; }
.cartbar__total {
  color: var(--accent-c);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}
body.has-cartbar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.is-locked { overflow: hidden; }

/* ----- Cart sheet (dark bottom sheet on mobile, dialog ≥ 640px) ----- */
.modal--sheet { align-items: flex-end; padding: 0; }
.modal--sheet .modal__panel {
  max-width: none;
  max-height: 88vh;
  border-bottom: 0;
  border-radius: 0;
  padding: 1.7rem 1.4rem calc(1.5rem + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .modal--sheet { align-items: center; padding: 1.2rem; }
  .modal--sheet .modal__panel {
    max-width: 520px;
    border-bottom: 1px solid var(--line-c);
    border-radius: var(--radius);
  }
}
.cart-title { font-size: 1.9rem; }
.cart-tableline { font-size: 0.85rem; margin-top: 0.15rem; }
.cart-lines { list-style: none; margin: 1.1rem 0 0.4rem; padding: 0; }
.cart-line {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-c);
}
.cart-line:first-child { border-top: 1px solid var(--line-c); }
.cart-line__info { flex: 1; min-width: 0; }
.cart-line__name { font-size: 0.95rem; }
.cart-line__each { font-size: 0.76rem; color: var(--muted-c); }
.cart-line__sum {
  min-width: 4rem;
  text-align: right;
  color: var(--accent-c);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.cart-line .qty button { width: 30px; height: 30px; }
.cart-empty { text-align: center; color: var(--muted-c); padding: 1.3rem 0 0.9rem; }
.cart-form { margin-top: 1.1rem; }
.cart-form .field { margin-bottom: 1rem; }
.cart-opt { text-transform: none; letter-spacing: 0.02em; font-weight: 400; }
.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.9rem 0;
  border-top: 1px solid var(--ink-c);
  margin-top: 0.3rem;
}
.cart-total span {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted-c);
}
.cart-total strong {
  color: var(--accent-c);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cart-submit { width: 100%; }
.cart-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.cart-age { text-align: center; font-size: 0.75rem; margin-top: 0.85rem; }

/* ----- Order tracking / success (hairline panel, Playfair ref) ----- */
.order-track {
  padding: 2.6rem clamp(1.2rem, 5vw, 3rem) 4.5rem;
  text-align: center;
}
.track-panel {
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  background: var(--bg-c);
  padding: 2.4rem 1.5rem 2rem;
}
.track-ref {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 12vw, 4rem);
  line-height: 1.08;
  letter-spacing: 0.04em;
  margin: 0.4rem 0 0.3rem;
  color: var(--ink-c);
}
.track-table { font-size: 0.95rem; }

/* Timeline — hairline connectors, warm-white dots when done/current. */
.timeline { list-style: none; margin: 2.1rem auto 0.6rem; padding: 0; max-width: 330px; text-align: left; }
.timeline li { position: relative; display: flex; gap: 1.1rem; padding-bottom: 1.7rem; }
.timeline li:last-child { padding-bottom: 0.4rem; }
/* Text column beside each step's dot. */
.timeline__body { flex: 1; min-width: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 30px;
  bottom: 2px;
  width: 1px;
  background: var(--line-c);
}
.timeline li:last-child::before { display: none; }
.timeline li.is-done::before { background: var(--accent-c); }
.timeline__dot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-c);
  background: var(--bg-c);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.timeline h3 { font-size: 1.3rem; color: var(--muted-c); transition: color 0.3s ease; }
.timeline p { font-size: 0.82rem; color: var(--muted-c); }
.timeline li.is-done h3,
.timeline li.is-now h3 { color: var(--ink-c); }
.timeline li.is-done .timeline__dot { border-color: var(--accent-c); }
.timeline li.is-done .timeline__dot::after {
  content: "\2713";
  color: var(--accent-c);
  font-size: 0.82rem;
  font-weight: 600;
}
.timeline li.is-now .timeline__dot { border-color: var(--accent-c); }
.timeline li.is-now .timeline__dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-c);
}
.timeline.is-cancelled { opacity: 0.4; }

.track-done,
.track-cancelled { margin-top: 1.5rem; }
.track-done .notice,
.track-cancelled .notice { margin-bottom: 1.1rem; }
.track-note { margin-top: 1.5rem; font-size: 0.8rem; }

/* ----- Card payment return states (confirming / not completed) ----- */
.track-checking,
.track-pending { margin-top: 1.5rem; }
.track-checking .notice,
.track-pending .notice { margin-bottom: 1.1rem; }
.track-pending__actions { display: flex; justify-content: center; }
.track-pending__note { margin-top: 1.1rem; font-size: 0.8rem; }

/* ----- Utilities ----- */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----- Wider screens ----- */
@media (min-width: 1100px) {
  .order-wrap,
  .order-sticky__in,
  .resume__in { max-width: 780px; }
}
