/* ═══════════ Gold Star Menu (customer) — Styles ═══════════
   Mobile-FIRST: most customers reach this page by scanning the QR code on a
   phone, so the base styles target small screens and we scale UP for tablets
   and desktops with min-width media queries.

   Brand palette matches the staff ordering app.
*/

:root {
  --gold: #c8962a;
  --gold-dark: #a97b1c;
  --ink: #1f2429;
  --muted: #5c6670;
  --line: #d9dee3;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --primary: #1f6feb;
  --primary-dark: #1456c4;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;   /* no font inflation on rotate */
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  -webkit-overflow-scrolling: touch;
}

/* ─────────── Top bar ─────────── */
.top-bar {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  /* Respect iPhone/iPad safe areas (notch, rounded corners). */
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-bar h1 { font-size: 1.2rem; margin: 0; }
.top-bar nav { display: flex; gap: 8px; }
.top-bar nav a {
  color: #fff;
  background: var(--gold);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .92rem;
  min-height: 44px;              /* comfortable tap target */
  display: inline-flex;
  align-items: center;
}
.top-bar nav a:hover { background: var(--gold-dark); }

/* ─────────── Intro + search ─────────── */
.menu-intro {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}
.intro-text { margin: 0 0 14px; color: var(--muted); font-size: .95rem; }
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  /* Keep the search within easy thumb reach by making it sticky under the bar. */
  position: sticky;
  top: 60px;
  z-index: 15;
}
#search {
  width: 100%;
  padding: 14px 44px 14px 16px;
  font-size: 16px;               /* 16px stops iOS Safari zooming on focus */
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
#search:focus { outline: none; border-color: var(--primary); }
.btn-icon {
  position: absolute;
  right: 6px;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
}

/* ─────────── Menu area ─────────── */
.menu-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 10px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}

.category-section { margin-bottom: 24px; }
.category-heading {
  font-size: 1.1rem;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
  color: var(--gold-dark);
}
.category-note {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 10px;
  font-style: italic;
}

/* Single column on phones; auto-fill into more columns on wider screens. */
.item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.menu-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.menu-item .item-name { font-weight: 600; font-size: 1rem; flex: 1 1 auto; }
.menu-item .item-no { color: var(--gold-dark); font-weight: 800; }
.menu-item .item-price {
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  text-align: right;
  flex: 0 0 auto;
}

.empty-msg { color: var(--muted); font-style: italic; padding: 10px 0; }

/* ─────────── Buttons ─────────── */
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 15px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-feedback { background: var(--gold); }
.btn-feedback:hover { background: var(--gold-dark); }

/* ─────────── Feedback call-to-action (bottom) ─────────── */
.feedback-cta {
  max-width: 960px;
  margin: 10px auto 0;
  padding: 24px 16px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  text-align: center;
  background: #fffdf6;
  border-top: 3px solid var(--gold);
}
.feedback-cta h2 { margin: 0 0 6px; font-size: 1.25rem; color: var(--gold-dark); }
.feedback-cta p { margin: 0 0 16px; color: var(--muted); }
.feedback-cta .btn-feedback { width: 100%; max-width: 360px; }

/* ─────────── Footer ─────────── */
.site-footer {
  text-align: center;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-weight: 700;
}
.site-footer p { margin: 0; }

/* Remove the grey tap flash on iOS; we provide our own active states. */
a, button, input { -webkit-tap-highlight-color: rgba(0,0,0,0); }

/* ─────────── Scale up on larger screens ─────────── */

/* Small tablets / large phones in landscape: two columns of dishes. */
@media (min-width: 600px) {
  .top-bar h1 { font-size: 1.35rem; }
  .item-grid { grid-template-columns: 1fr 1fr; }
}

/* Tablets & desktop: three columns, roomier type. */
@media (min-width: 900px) {
  body { font-size: 18px; }
  .item-grid { grid-template-columns: repeat(3, 1fr); }
  .search-box { top: 64px; }
}

/* If the device uses a coarse pointer (touch), keep tap targets generous. */
@media (pointer: coarse) {
  .btn, .top-bar nav a { min-height: 48px; }
}
