/* ─────────────────────────────────────────
   ARMenu — main.css
   Design tokens → layout → components
   ───────────────────────────────────────── */

/* ── TOKENS ── */
:root {
  --brand:          #1B2B4B;
  --brand-mid:      #2E4A7A;
  --gold:           #C9963A;
  --gold-light:     #E8B85A;
  --cream:          #FAF7F2;
  --surface:        #FFFFFF;
  --text-primary:   #1B2B4B;
  --text-secondary: #6B7A99;
  --text-muted:     #A0AABF;
  --border:         #EAE8E4;
  --radius:         16px;
  --radius-sm:      10px;
  --shadow-card:    0 2px 12px rgba(27,43,75,0.06);
  --shadow-float:   0 4px 20px rgba(27,43,75,0.2);
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body { width: 100%; overflow-x: hidden; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── HEADER ── */
.header {
  background: var(--brand);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 24px rgba(27,43,75,0.35);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700; font-size: 17px;
  color: var(--brand);
}
.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700;
  color: #fff;
}
.logo-text span { color: var(--gold-light); }
.ar-pill {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--brand);
  font-size: 10px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── HERO ── */
.hero {
  background: var(--brand);
  padding: 24px 20px 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(201,150,58,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; bottom: -40px; left: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(201,150,58,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.restaurant-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px; font-weight: 700;
  color: #fff; line-height: 1.05;
  margin-bottom: 4px;
}
.restaurant-tag {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px; font-style: italic;
  color: var(--gold-light);
  margin-bottom: 18px;
}
.hero-meta { display: flex; gap: 16px; align-items: center; }
.meta-item { color: rgba(255,255,255,0.65); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.meta-sep  { color: rgba(255,255,255,0.2); }

/* ── AR BANNER ── */
.ar-banner {
  margin: 18px 20px 0;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(201,150,58,0.25);
  box-shadow: var(--shadow-float);
}
.ar-banner-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  background: rgba(201,150,58,0.15);
  border: 1px solid rgba(201,150,58,0.3);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.ar-banner h3 { color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.ar-banner p  { color: rgba(255,255,255,0.55); font-size: 11px; line-height: 1.4; }
.pulse {
  margin-left: auto; flex-shrink: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold-light);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,184,90,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(232,184,90,0); }
}

/* ── CATEGORIES ── */
.cats {
  padding: 20px 20px 0;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex-shrink: 0;
  padding: 7px 16px; border-radius: 30px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all 0.18s ease;
  font-family: 'DM Sans', sans-serif;
}
.cat.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── SECTION LABEL ── */
.section-label { padding: 22px 20px 10px; }
.section-label h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px; font-weight: 700;
  color: var(--brand);
}
.section-label p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── MENU CARDS ── */
.card-list {
  padding: 0 20px;
  display: flex; flex-direction: column; gap: 12px;
  padding-bottom: 70px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:active { transform: scale(0.985); }

.card-thumb-wrap {
  width: 108px; flex-shrink: 0;
  background: linear-gradient(145deg, #f2ede4, #e8e0d0);
  position: relative;
}
.card-thumb {
  width: 108px; height: 108px;
  display: block;
  --poster-color: transparent;
}
.ar-tag {
  position: absolute; bottom: 7px; left: 7px;
  background: var(--brand); color: var(--gold-light);
  font-size: 8.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  letter-spacing: 0.07em;
  pointer-events: none;
}
.card-body {
  flex: 1; padding: 13px 13px 11px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; font-weight: 600;
  color: var(--brand); margin-bottom: 3px; line-height: 1.2;
}
.card-desc {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; }
.card-price { font-size: 15px; font-weight: 600; color: var(--gold); }
.card-price small { font-size: 10px; color: var(--text-muted); font-weight: 400; }
.btn-view {
  display: flex; align-items: center; gap: 4px;
  background: var(--brand); color: #fff;
  border: none; padding: 6px 11px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}
.btn-view:hover { background: var(--brand-mid); }

/* ── OVERLAY ── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(8,14,30,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: flex-end;
}
.overlay.open { display: flex; }

/* ── MODAL ── */
.modal {
  width: 100%; background: var(--surface);
  border-radius: 24px 24px 0 0;
  overflow: hidden; max-height: 93vh;
  display: flex; flex-direction: column;
  animation: slideUp 0.32s cubic-bezier(0.32,0.72,0,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle {
  width: 38px; height: 4px;
  background: var(--border); border-radius: 2px;
  margin: 11px auto 0; flex-shrink: 0;
}
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 20px 0; flex-shrink: 0;
}
.modal-dish-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
  color: var(--brand); line-height: 1.15;
}
.modal-dish-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.btn-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--cream); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  font-size: 16px; flex-shrink: 0;
  margin-left: 10px; margin-top: 4px;
  transition: background 0.15s;
}
.btn-close:hover { background: var(--border); }

/* ── 3D VIEWER (MODAL) ── */
.viewer-wrap {
  margin: 14px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f2ede4, #e8e0d0);
  border: 1px solid var(--border);
  position: relative; flex-shrink: 0; overflow: hidden;
}
#modalViewer {
  width: 100%; height: 280px; display: block;
  --poster-color: transparent;
  border-radius: 16px;
}
.viewer-label {
  position: absolute; top: 10px; left: 10px;
  background: rgba(27,43,75,0.8); color: #fff;
  font-size: 9.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  letter-spacing: 0.06em; text-transform: uppercase;
  pointer-events: none; backdrop-filter: blur(4px);
}
.viewer-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(27,43,75,0.7); color: rgba(255,255,255,0.8);
  font-size: 10px; padding: 4px 12px; border-radius: 20px;
  pointer-events: none; white-space: nowrap;
}
.viewer-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 11px; color: var(--text-muted); }

/* ── DISH INFO ── */
.dish-info { padding: 0 20px 12px; overflow-y: auto; flex: 1; }
.dish-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 12px; }
.dish-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tag {
  display: flex; align-items: center; gap: 4px;
  background: var(--cream); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
}

/* ── ACTION BUTTONS ── */
.actions { display: flex; gap: 9px; flex-shrink: 0; padding: 12px 20px 20px; }
.btn-ar {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  color: #fff; border: none; padding: 14px; border-radius: 12px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 4px 16px rgba(27,43,75,0.28);
  transition: opacity 0.15s;
}
.btn-ar:hover   { opacity: 0.9; }
.btn-ar:disabled { opacity: 0.5; cursor: not-allowed; }
/* btn-order removed — viewer only mode */
.btn-ar--full { flex: 1; }

/* ── AR FULLSCREEN ── */
.ar-fs {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: #000; flex-direction: column;
}
.ar-fs.open { display: flex; }
.ar-fs-viewer { flex: 1; width: 100%; --poster-color: #000; }
.ar-fs-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; z-index: 10;
}
.ar-fs-tag {
  background: rgba(27,43,75,0.85); color: var(--gold-light);
  font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid rgba(201,150,58,0.3);
  backdrop-filter: blur(6px);
}
.ar-fs-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: none;
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ar-fs-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px; z-index: 10;
}
.ar-fs-card {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 16px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.ar-fs-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700; color: #fff;
}
.ar-fs-price { font-size: 18px; font-weight: 700; color: var(--gold-light); }
.ar-fs-meta  { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }
/* btn-fs-order removed — viewer only mode */

/* ── TOAST ── */
.toast {
  position: fixed; top: 76px; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--brand); color: #fff;
  padding: 9px 18px; border-radius: 24px;
  font-size: 12.5px; font-weight: 500;
  border: 1px solid rgba(201,150,58,0.3);
  box-shadow: 0 4px 20px rgba(27,43,75,0.4);
  opacity: 0; pointer-events: none;
  transition: all 0.25s ease;
  white-space: nowrap; z-index: 600;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════
   POLISH ADDITIONS
   ═══════════════════════════════════════════ */

/* ── POLISH #1: SPLASH SCREEN ── */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: splashIn 0.6s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes splashIn {
  from { opacity: 0; transform: scale(0.85) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.splash-logo-mark {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700; font-size: 28px; color: var(--brand);
  box-shadow: 0 8px 32px rgba(201,150,58,0.4);
  margin-bottom: 4px;
}
.splash-logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 700; color: #fff;
  letter-spacing: 0.02em;
}
.splash-logo-text span { color: var(--gold-light); }
.splash-tagline {
  font-size: 12px; font-weight: 400;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-top: 2px;
}

/* ── POLISH #2: AR ONBOARDING ── */
.onboarding {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(8,14,30,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.onboarding.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.onboarding-card {
  background: var(--surface);
  border-radius: 24px 24px 20px 20px;
  padding: 32px 28px 28px;
  width: 100%; max-width: 420px;
  text-align: center;
  animation: slideUp 0.4s cubic-bezier(0.32,0.72,0,1) both;
  animation-delay: 0.1s;
}
.onboarding-icon { font-size: 44px; margin-bottom: 14px; line-height: 1; }
.onboarding-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 700;
  color: var(--brand); line-height: 1.2;
  margin-bottom: 12px;
}
.onboarding-body {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 24px;
}
.onboarding-steps {
  display: flex; gap: 8px; margin-bottom: 24px;
}
.onboarding-step {
  flex: 1; background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.os-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.os-text { font-size: 11px; font-weight: 500; color: var(--text-secondary); text-align: center; line-height: 1.3; }
.onboarding-btn {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  color: #fff; border: none; border-radius: 12px;
  font-size: 14px; font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(27,43,75,0.3);
  transition: opacity 0.15s;
}
.onboarding-btn:hover { opacity: 0.9; }

/* ── POLISH #5: CARD ENTRANCE ANIMATION ── */
.card {
  opacity: 0;
  transform: translateY(20px);
}
.card.visible {
  animation: cardIn 0.4s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── POLISH #7: HEADER RESTAURANT NAME ── */
.header-right {
  display: flex; align-items: center; gap: 10px;
}
.header-restaurant {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── POLISH #3 + #10: LAZY LOAD PLACEHOLDER & SMOOTH TRANSITION ── */
.card-thumb-wrap { position: relative; }

/* Emoji placeholder — always visible until model loads */
.card-thumb-placeholder {
  width: 108px; height: 108px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #f2ede4, #e8e0d0);
  position: absolute; inset: 0;
  z-index: 1;
}
.card-thumb-emoji {
  font-size: 42px; line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(27,43,75,0.1));
}

/* model-viewer loading state — invisible, on top of placeholder */
.card-thumb--loading {
  opacity: 0;
  position: absolute; inset: 0;
  z-index: 2;
  transition: opacity 0.4s ease;
}

/* model-viewer loaded state — fade in smoothly */
.card-thumb--loaded {
  opacity: 1;
  position: absolute; inset: 0;
  z-index: 2;
  transition: opacity 0.4s ease;
}