/* ==========================================================================
   Theme tokens — change these to rebrand. The staff Settings page also
   overrides --brand and --accent at runtime from the database.
   ========================================================================== */
:root {
  --brand: #D93D1F;        /* Laiyan orange-red: main buttons, top bar */
  --brand-ink: #FFFFFF;    /* text on --brand */
  --accent: #15181C;       /* Laiyan charcoal: order ticket, highlights */
  --accent-ink: #FFFFFF;   /* text on --accent */

  --ink: #15181C;          /* body text */
  --ink-soft: #46413D;
  --muted: #6B645F;
  --paper: #FFFFFF;
  --surface: #F5F2EF;
  --line: #E2DBD5;

  --danger: #B42318;
  --ok: #157F3D;
  --info: #1D5FC4;
  --warn: #B26A00;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 26px;
  --tap: 52px;             /* minimum touch target */

  --font-display: 'Archivo Display', 'Arial Narrow', 'Roboto Condensed', 'Helvetica Neue', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@font-face {
  font-family: 'Archivo Display';
  src: url('/assets/fonts/archivo-display.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: var(--tap);
  padding: .75rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  text-align: center;
  line-height: 1.15;
  transition: transform .08s ease, background-color .15s ease;
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-xl { width: 100%; min-height: 60px; font-size: 1.15rem; }
.btn-small { min-height: 44px; padding: .45rem .95rem; font-size: .95rem; }
.btn-grow { flex: 1; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface); }

.link-btn {
  min-height: 44px;
  padding: 0 .25rem;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lang-btn {
  min-width: 52px;
  min-height: 44px;
  padding: 0 .75rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: .04em;
}

/* ---------- form fields ---------- */
.input {
  width: 100%;
  min-height: var(--tap);
  padding: .7rem .9rem;
  border: 2px solid var(--line);
  border-radius: var(--r-s);
  background: #fff;
  font-size: 1rem; /* 16px stops iOS zooming in */
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
textarea.input { min-height: 0; resize: vertical; }
.input-xl { min-height: 64px; font-size: 1.35rem; font-weight: 600; text-align: center; }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field-label { font-weight: 700; font-size: .95rem; }
.field-hint { color: var(--muted); font-size: .85rem; }
.form-error { color: var(--danger); font-weight: 700; min-height: 1.2em; }

.check { display: flex; align-items: center; gap: .65rem; min-height: 48px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--brand); flex: none; }
.check small { color: var(--muted); }

/* Toggle switch built on a real checkbox */
.switch-row { display: inline-flex; align-items: center; gap: .7rem; min-height: 48px; cursor: pointer; font-weight: 700; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 58px;
  height: 34px;
  margin: 0;
  border-radius: 999px;
  background: #B8C3BE;
  transition: background-color .15s ease;
  flex: none;
  cursor: pointer;
}
.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(24px); }
.switch-danger:checked { background: var(--danger); }

/* ---------- small pieces ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .1rem .6rem;
  border-radius: 999px;
  background: var(--surface);
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .8rem; font-weight: 800; }
.tag-soldout { background: var(--danger); color: #fff; }
.muted { color: var(--muted); }

.spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 4px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot { display: grid; place-items: center; min-height: 60vh; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 100;
  max-width: min(92vw, 480px);
  padding: .85rem 1.2rem;
  border-radius: var(--r-m);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-align: center;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.banner {
  margin: .75rem 1rem;
  padding: .9rem 1rem;
  border-radius: var(--r-m);
  font-weight: 700;
}
.banner-closed { background: #FDECEA; color: var(--danger); border: 2px solid #F4B9B2; }
.banner-ready { background: #E3F4E9; color: var(--ok); border: 2px solid #A7DCBA; }
.banner-done { background: var(--surface); color: var(--ink); }

.noscript { padding: 2rem; text-align: center; font-weight: 700; }

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