/* =============================================================================
 *  La Cafeleta — menú digital de cafetería (estilos)
 *  Mobile-first. Tokens del handoff de diseño (hifi). Variantes: dark / cream.
 *  El acento (dorado) se inyecta desde restaurant.js -> --acento (ver app.js).
 * ========================================================================== */

:root {
  --gold: #D4AF37;
  --acento: #D4AF37;          /* lo sobreescribe app.js con brand.colorAcento */

  /* Vars compartidas que usa la página del QR (admin.html) */
  --fondo: #0b0b0b;
  --texto: #EDE7DC;
  --panel: #1b1b1b;
  --panel-2: #222;
  --linea: rgba(212, 175, 55, 0.22);
  --muted: #9a9183;
  --radio: 16px;
  --sombra: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  --max: 1120px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --serif-it: "Cormorant Garamond", Georgia, serif;
  --label: "Montserrat", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* =============================================================================
 *  PÁGINA DEL CLIENTE (lo que abre el QR)
 * ========================================================================== */

/* --- Temas (custom props por variante) --- */
.menu-page.theme-dark {
  --page: #0b0b0b;  --shell: #111;
  --hero-bg: linear-gradient(160deg, #1a1a1a, #0d0d0d);
  --hero-border: rgba(212, 175, 55, 0.25);
  --title: #F8F5F0;  --tagline: var(--gold);  --section: var(--gold);
  --thumb-bg: #1b1b1b;  --thumb-border: rgba(212, 175, 55, 0.22);
  --name: #EDE7DC;  --price: var(--gold);  --desc: #9a9183;
  --dot: rgba(212, 175, 55, 0.32);  --row-border: rgba(212, 175, 55, 0.16);
  --thanks: var(--gold);  --footnote: #7d7468;
  --nav-bg: rgba(17, 17, 17, 0.92);
}
.menu-page.theme-cream {
  --page: #e9e5dd;  --shell: #F8F5F0;
  --hero-bg: #F8F5F0;
  --hero-border: rgba(17, 17, 17, 0.08);
  --title: #111;  --tagline: #6B6B6B;  --section: #111;
  --thumb-bg: #efeae1;  --thumb-border: rgba(17, 17, 17, 0.08);
  --name: #111;  --price: #111;  --desc: #7c756b;
  --dot: rgba(17, 17, 17, 0.28);  --row-border: rgba(17, 17, 17, 0.09);
  --thanks: #6B6B6B;  --footnote: #9A9A9A;
  --nav-bg: rgba(248, 245, 240, 0.92);
}

.menu-page { background: var(--page); }
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--shell); }

/* --- Hero --- */
.cafe-hero { height: 300px; background: var(--hero-bg); border-bottom: 1px solid var(--hero-border); position: relative; }
.cafe-hero-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 28px;
}

/* Foto del carrito como banner bajo el título (brand.heroImg) */
.hero-photo {
  height: 320px;
  background-size: cover;
  background-position: center 33%;
  background-repeat: no-repeat;
  position: relative;
}
.hero-photo[hidden] { display: none; }
.hero-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    var(--shell) 0%,
    rgba(17, 17, 17, 0) 22%,
    rgba(17, 17, 17, 0) 78%,
    var(--shell) 100%);
}
.mono {
  width: 58px; height: 58px; border: 1px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: 1px;
  color: var(--gold); margin-bottom: 18px;
}
.cafe-title {
  font-family: var(--serif); font-weight: 700; font-size: 34px; letter-spacing: 1.5px;
  margin: 0; color: var(--title); text-transform: uppercase;
}
.cafe-tagline {
  font-family: var(--serif-it); font-style: italic; font-size: 18px;
  margin: 9px 0 0; color: var(--tagline);
}

/* --- Separadores ornamentales --- */
.ornament { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.ornament .line { height: 1px; width: 44px; background: var(--gold); }
.ornament .diamond { width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.ornament-short { display: flex; justify-content: center; margin: 10px 0 6px; }
.ornament-short .line { height: 1px; width: 30px; background: var(--gold); }

/* --- Barra sticky de categorías --- */
.cat-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: center; gap: 4px;
  padding: 12px 10px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--row-border);
  overflow-x: auto; scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none; padding: 6px 12px;
  font-family: var(--label); font-weight: 600; font-size: 11px;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--desc); border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.cat-nav a.active, .cat-nav a:hover { color: var(--gold); border-color: var(--gold); }

/* --- Lista de bebidas --- */
.menu-section { padding: 34px 26px 0; scroll-margin-top: 52px; }
.section-label {
  font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: 4px;
  text-align: center; margin: 0; color: var(--section);
}
.drink-list { list-style: none; margin: 10px 0 0; padding: 0; }
.drink { display: flex; align-items: center; gap: 15px; padding: 16px 0; border-bottom: 1px solid var(--row-border); }
.thumb {
  flex: none; width: 58px; height: 58px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--thumb-bg); border: 1px solid var(--thumb-border);
  font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--gold);
  overflow: hidden;
}
.thumb.has-img { background: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drink-body { flex: 1; min-width: 0; }
.drink-top { display: flex; align-items: baseline; gap: 8px; }
.drink-name { font-family: var(--font); font-weight: 600; font-size: 16px; color: var(--name); }
.leader { flex: 1; border-bottom: 1px dotted var(--dot); margin-bottom: 5px; min-width: 8px; }
.drink-price { font-family: var(--font); font-weight: 600; font-size: 16px; color: var(--price); white-space: nowrap; }
.drink-desc { font-family: var(--serif-it); font-style: italic; font-size: 15px; line-height: 1.3; margin: 3px 0 0; color: var(--desc); }

/* Precios con varios tamaños (ej. Milo 9 oz / 12 oz) */
.drink-price.multi { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.drink-price.multi .pl { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.drink-price.multi .tam { font-family: var(--serif-it); font-style: italic; font-weight: 400; font-size: 12.5px; color: var(--desc); }

/* Marca de aperitivo opcional (*) y su nota al final de cada sección */
.aperitivo-mark { color: var(--gold); font-weight: 600; }
.drink-name .aperitivo-mark { margin-left: 3px; font-size: 0.85em; }
.aperitivo-note {
  text-align: center;
  font-family: var(--serif-it); font-style: italic;
  font-size: 16px; line-height: 1.45;
  color: var(--name); margin: 20px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--row-border); border-radius: 12px;
  background: var(--thumb-bg);
}
.aperitivo-note .aperitivo-mark { font-size: 1.15em; }

/* Pistas de que la foto/nombre son interactivos */
.drink-name, .thumb { cursor: pointer; }
.drink-name { transition: color 0.15s ease; }
.drink-name:hover { color: var(--gold); }
.thumb { transition: transform 0.15s ease; }
.thumb:hover { transform: scale(1.05); }

/* --- Lightbox (detalle del producto) --- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.lightbox[hidden] { display: none; }
.lightbox-card {
  position: relative;
  width: min(100%, 360px);
  background: var(--shell);
  border: 1px solid var(--row-border);
  border-radius: 14px;
  padding: 16px 16px 22px;
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
  animation: lb-pop 0.22s ease;
}
.lightbox-close {
  position: absolute; top: 24px; right: 24px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
@keyframes lb-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
.lightbox-media { display: flex; justify-content: center; }
.lightbox-media img { max-width: 100%; max-height: 62vh; width: auto; height: auto; border-radius: 8px; display: block; }
.lightbox-initial {
  width: 100%; height: 200px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--thumb-bg); border: 1px solid var(--thumb-border);
  font-family: var(--serif); font-weight: 600; font-size: 72px; color: var(--gold);
}
.lightbox-name { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--name); margin: 16px 0 0; }
.lightbox-price { font-family: var(--font); font-weight: 600; font-size: 16px; color: var(--price); margin-top: 4px; }
.lightbox-desc { font-family: var(--serif-it); font-style: italic; font-size: 16px; line-height: 1.4; color: var(--desc); margin: 12px 0 0; }

/* --- Footer --- */
.cafe-footer { text-align: center; padding: 36px 26px 44px; }
.cafe-footer .ornament { margin-bottom: 16px; margin-top: 0; }
.thanks { font-family: var(--serif-it); font-style: italic; font-size: 17px; margin: 0; color: var(--thanks); }
.footnote { font-family: var(--label); font-size: 9.5px; letter-spacing: 1.5px; margin: 14px 0 0; color: var(--footnote); }
.panel-link { display: inline-block; font-family: var(--label); font-size: 9px; letter-spacing: 1px; margin-top: 10px; color: var(--footnote); opacity: 0.6; }
.panel-link:hover { opacity: 1; }

/* =============================================================================
 *  CLASES COMPARTIDAS  —  usadas por la página del QR (admin.html)
 * ========================================================================== */
.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }

.nav { position: sticky; top: 0; z-index: 20; background: rgba(17, 17, 17, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--linea); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; letter-spacing: 1px; color: var(--texto); }
.monogram {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%;
  font-family: var(--serif); font-weight: 600; font-size: 14px; color: var(--gold);
}

/* Pestañas de navegación entre las páginas del panel (QR / Carta / Menú) */
.panel-tabs { display: flex; gap: 4px; }
.panel-tab {
  font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: 0.3px;
  padding: 9px 16px; border-radius: 999px; color: var(--muted);
  border: 1px solid transparent; transition: background 0.15s ease, color 0.15s ease;
}
.panel-tab:hover { color: var(--texto); }
.panel-tab.active { background: var(--acento); color: #111; }

.eyebrow { font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--acento); font-weight: 600; }
.section-title { font-family: var(--serif); font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.1; margin: 10px 0 14px; font-weight: 700; color: var(--texto); }
.section-sub { color: var(--muted); max-width: 52ch; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; transition: transform 0.15s ease, opacity 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--acento); color: #111; }
.btn-ghost { background: transparent; border-color: var(--linea); color: var(--texto); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--linea); background: var(--panel); color: var(--texto); }
.form-note { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }
