/*
 * QR / mobile menu. Everything is scoped under .menu-content so the same
 * component can sit inside the dashboard preview and the homepage mockups;
 * only body.public-menu styles the standalone page.
 */

body.public-menu {
  margin: 0;
  background: #fbf7f0;
  color: #1e2327;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.menu-content {
  --menu-bg: #fbf7f0;
  --menu-ink: #1e2327;
  --menu-soft: #535a62;
  --menu-line: #eadfcd;
  --menu-accent: color-mix(in srgb, var(--brand-primary, #0f766e) 82%, #000);
  --menu-heading: color-mix(in srgb, var(--brand-secondary, #134e4a) 88%, #000);
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  color: var(--menu-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}
.menu-content *, .menu-content *::before, .menu-content *::after { box-sizing: border-box; }
/* Owners pick any brand colors. Cap their lightness so text in those colors
   (and white text on them) always stays readable on the light page. */
@supports (color: oklch(from red l c h)) {
  .menu-content {
    --menu-accent: oklch(from var(--brand-primary, #0f766e) min(l, 0.5) c h);
    --menu-heading: oklch(from var(--brand-secondary, #134e4a) min(l, 0.42) c h);
  }
}

.menu-header { text-align: center; margin-bottom: 20px; }
.menu-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 16px; margin-bottom: 10px; background: #fff; }
.menu-header .menu-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  font-size: 1.85rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--menu-heading);
}
.menu-header .menu-name {
  margin: 8px 0 0;
  color: var(--menu-soft);
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Sticky, horizontally scrolling section links. */
.menu-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -20px 8px;
  padding: 10px 0;
  background: color-mix(in srgb, var(--menu-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--menu-line);
}
.menu-nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.menu-nav ul::-webkit-scrollbar { display: none; }
/* More tabs off to one side: fade that edge so it reads as scrollable.
   public-menu.js sets these classes from the scroll position. */
.menu-nav ul.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.menu-nav ul.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.menu-nav ul.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.menu-nav a {
  display: block;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--menu-line);
  background: #fff;
  color: var(--menu-ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.menu-nav a:hover { border-color: var(--menu-accent); }
.menu-nav a:focus-visible { outline: 3px solid var(--menu-accent); outline-offset: 2px; }
.menu-nav a.is-active { background: var(--menu-accent); border-color: var(--menu-accent); color: #fff; }

.menu-category { padding-top: 22px; scroll-margin-top: 64px; }
.menu-category .menu-category-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  font-size: 1.4rem;
  color: var(--menu-heading);
}
.menu-category .menu-category-name::after { content: ""; flex: 1; height: 2px; background: var(--menu-line); border-radius: 2px; }

.menu-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--menu-line); }
.menu-item:last-child { border-bottom: none; }
.menu-item-body { flex: 1; min-width: 0; }
.menu-item-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; align-items: baseline; }
/* When the row is too narrow for the name beside the price, the price drops
   below it. Long single words (or URLs) break rather than run under the photo. */
.menu-item-name { flex: 1 1 9em; min-width: 0; overflow-wrap: anywhere; font-weight: 650; font-size: 1.05rem; line-height: 1.3; }
.menu-item-price { flex-shrink: 0; font-weight: 700; font-size: 1.05rem; color: var(--menu-accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.menu-item-desc { overflow-wrap: anywhere; margin: 4px 0 0; color: var(--menu-soft); font-size: 0.92rem; line-height: 1.45; }
.menu-item-variants { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; padding: 0; }
.variant-pill {
  display: inline-flex; gap: 6px; align-items: baseline;
  background: #fff; border: 1px solid var(--menu-line); border-radius: 999px;
  padding: 4px 11px; font-size: 0.86rem;
}
.variant-pill span { color: var(--menu-soft); }
.variant-pill strong { color: var(--menu-accent); font-weight: 700; }
.menu-item-photo { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--menu-line); }
@media (max-width: 359px) { .menu-content .menu-item .menu-item-photo { width: 64px; height: 64px; border-radius: 12px; } }

.sold-out-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #c73e1d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Drink details: tap-number badge and a style / ABV / IBU line. */
.menu-tap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6em; height: 1.6em; padding: 0 0.35em; margin-right: 0.5em;
  border-radius: 6px; vertical-align: 0.1em;
  background: var(--menu-accent); color: var(--menu-bg);
  font-size: 0.72rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.menu-item-meta { display: block; margin-top: 3px; color: var(--menu-accent); font-size: 0.86rem; font-weight: 600; }
.drink-meta > span + span::before { content: "·"; margin: 0 0.4em; opacity: 0.6; }
.menu-item.is-sold-out .menu-item-meta { color: var(--menu-soft); }
.menu-item.is-sold-out .menu-tap { background: var(--menu-soft); }

/* Sold out: muted but still readable (explicit colors, not opacity). */
.menu-item.is-sold-out .menu-item-name { color: var(--menu-soft); }
.menu-item.is-sold-out .menu-item-price,
.menu-item.is-sold-out .variant-pill strong { color: var(--menu-soft); text-decoration: line-through; }
.menu-item.is-sold-out .menu-item-photo { opacity: 0.6; filter: grayscale(70%); }

.menu-empty, .menu-category-empty { text-align: center; color: var(--menu-soft); padding: 40px 0; }
.menu-category-empty { padding: 12px 0; text-align: left; font-size: 0.9rem; }

.menu-footer { text-align: center; padding: 8px 0 36px; font-size: 0.8rem; }
.menu-footer a { color: #6a6f76; text-decoration: none; }
.menu-footer a:hover { text-decoration: underline; }

.menu-banner {
  background: #0c3b3d; color: #fbf5ea; text-align: center;
  padding: 10px 16px; font-size: 0.88rem; line-height: 1.4;
}
.menu-banner a { color: #f9a68e; margin-left: 6px; font-weight: 600; }
.menu-banner.is-draft { background: #fcefd6; color: #6d3f00; }

.unavailable-page { max-width: 420px; margin: 0 auto; padding: 18vh 24px 40px; text-align: center; }
.unavailable-page h1 { font-family: "Fraunces", Georgia, serif; font-weight: 650; font-size: 1.6rem; margin: 0 0 10px; color: #0c3b3d; }
.unavailable-page p { color: #535a62; margin: 0; }

/* ---------- Themes (Menu.mobile_theme) ----------
 * Classic is the default design above. Elegant, Cards and Clean list mirror
 * the TV templates in tv.css. Each theme mostly swaps the --menu-* palette;
 * the page background follows via body.theme-* on the standalone page and
 * .menu-content's own background in previews and mockups. */
.menu-content { background: var(--menu-bg); }

/* Elegant: dark and warm, serif, light brand accent. */
.menu-content.theme-elegant {
  --menu-bg: color-mix(in srgb, var(--brand-secondary, #134e4a) 45%, #120e0b);
  --menu-ink: #fff6e8;
  --menu-soft: #c9bdae;
  --menu-line: rgba(255, 246, 232, 0.14);
  --menu-accent: color-mix(in srgb, var(--brand-primary, #0f766e) 55%, #fff4e0);
  --menu-heading: var(--menu-accent);
  --menu-pill: rgba(255, 246, 232, 0.07);
}
.theme-elegant .menu-header .menu-name { font-family: "Fraunces", Georgia, serif; font-style: italic; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--menu-accent); }
.theme-elegant .menu-category .menu-category-name::after { height: 1px; background: color-mix(in srgb, var(--menu-accent) 35%, transparent); }
.theme-elegant .menu-nav a.is-active { color: #1b140f; }

/* Cards: bright, each category a white card with a brand-colored header. */
.menu-content.theme-grid {
  --menu-bg: #f6efe3;
  --menu-line: #ece3d4;
  --menu-soft: #4b535c;
  /* --menu-heading stays the base one: the secondary color, kept dark. */
}
.theme-grid .menu-header .menu-title { font-family: "Inter", system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.theme-grid .menu-category { padding-top: 18px; }
.theme-grid .menu-category > .menu-category-name {
  margin: 0; padding: 12px 16px; border-radius: 16px 16px 0 0;
  background: var(--menu-accent); color: #fff;
  font-family: "Inter", system-ui, sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em;
}
.theme-grid .menu-category > .menu-category-name::after { display: none; }
.theme-grid .menu-item { background: #fff; padding: 14px 16px; margin: 0; }
.theme-grid .menu-category > .menu-item:last-child { border-radius: 0 0 16px 16px; box-shadow: 0 6px 14px rgba(60, 40, 20, 0.07); }
.theme-grid .menu-item-name { font-weight: 700; }
.theme-grid .menu-item-price { font-weight: 800; }
.theme-grid .menu-item-photo { width: 96px; height: 96px; }
.theme-grid .variant-pill { background: #f6efe3; }

/* Clean list: white, high contrast, ruled headings, left-aligned header. */
.menu-content.theme-minimal {
  --menu-bg: #ffffff;
  --menu-ink: #111318;
  --menu-soft: #4b535c;
  --menu-line: #e6e6e6;
  /* --menu-heading stays the base one: the secondary color, kept dark,
     for the business name, heading rules and the active tab. */
}
.theme-minimal .menu-header { text-align: left; border-left: 5px solid var(--menu-accent); padding: 2px 0 2px 14px; }
.theme-minimal .menu-header .menu-title { font-family: "Inter", system-ui, sans-serif; font-weight: 800; letter-spacing: -0.03em; }
.theme-minimal .menu-category .menu-category-name {
  font-family: "Inter", system-ui, sans-serif; font-weight: 800; font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--menu-accent);
  border-bottom: 3px solid var(--menu-heading); padding-bottom: 8px;
}
.theme-minimal .menu-category .menu-category-name::after { display: none; }
.theme-minimal .menu-item-price { color: #111318; font-weight: 800; }
.theme-minimal .variant-pill strong { color: #111318; }
.theme-minimal .menu-nav a { border-radius: 6px; }
.theme-minimal .menu-nav a.is-active { background: var(--menu-heading); border-color: var(--menu-heading); }

/* Pills and nav links on the dark theme. */
.theme-elegant .menu-nav a, .theme-elegant .variant-pill { background: var(--menu-pill); }
.theme-elegant .menu-nav a.is-active { background: var(--menu-accent); border-color: var(--menu-accent); color: #1b140f; }

/* Brand colors are clamped per theme so text in them stays readable. */
@supports (color: oklch(from red l c h)) {
  .menu-content.theme-elegant { --menu-accent: oklch(from color-mix(in srgb, var(--brand-primary, #0f766e) 55%, #fff4e0) max(l, 0.78) c h); }
  .menu-content.theme-minimal { --menu-accent: oklch(from var(--brand-primary, #0f766e) min(l, 0.45) c h); }
}

/* Standalone page background matches the theme. */
/* menu_mobile.html sets the brand colors on <body> too, so this matches. */
body.public-menu.theme-elegant { background: #1b1612; color: #fff6e8; }
body.public-menu.theme-elegant { background: color-mix(in srgb, var(--brand-secondary, #134e4a) 45%, #120e0b); }
body.public-menu.theme-grid { background: #f6efe3; }
body.public-menu.theme-minimal { background: #ffffff; }
body.theme-elegant .menu-footer a { color: #b3a899; }

/* ---------- Phone mockup (homepage, dashboard theme chooser) ----------
   A real .menu-content rendered at phone width (375px) and scaled by --s. */

.device-phone {
  --s: 0.58;
  width: calc(375px * var(--s) + 16px);
  padding: 8px;
  background: #121516;
  border-radius: 36px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
}
.device-phone::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 26%;
  height: 12px;
  transform: translateX(-50%);
  background: #121516;
  border-radius: 999px;
  z-index: 2;
}
.device-phone-screen {
  width: calc(375px * var(--s));
  height: calc(790px * var(--s));
  overflow: hidden;
  border-radius: 28px;
  /* The bezel color, so the scaled menu's anti-aliased edges blend into the
     frame instead of showing a light hairline around dark themes. */
  background: #121516;
}
.device-phone-screen > .menu-content {
  width: 375px;
  min-height: 790px;
  padding-top: 40px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  background: var(--menu-bg);
}
