/* ============================================================
   MiraLaCarta — Menú público del cliente (index.html / menu.html)
   Se apoya en las variables y componentes de /css/theme.css
   (paleta cálida terracota/crema, Newsreader + Work Sans).
   Colores --accent / --bg pueden ser sobreescritos por JS con los
   colores propios de cada local (color_primary, color_bg, etc.)
   ============================================================ */

body { -webkit-font-smoothing: antialiased; }

.page-wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }

/* ── Splash / landing / error screens (compartidas index+menu) ── */
.splash-screen {
  position: fixed; inset: 0; z-index: 500; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.splash-ring-wrap { position: relative; width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; }
.splash-mark {
  width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-family: 'Newsreader', serif;
  font-size: 24px; font-weight: 600; position: relative; z-index: 2; overflow: hidden;
}
.splash-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); animation: splashRingSpin 1s linear infinite; }
.splash-ring-track { fill: none; stroke: var(--line); stroke-width: 5; }
.splash-ring-arc { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 72 205; }
@keyframes splashRingSpin { to { transform: rotate(270deg); } }
.splash-text { font-size: 13px; color: var(--ink-soft); }

.center-screen {
  display: none; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 28px; gap: 10px;
}
.center-screen.show { display: flex; }
.center-icon { font-size: 40px; margin-bottom: 4px; }
.center-title { font-family: 'Newsreader', serif; font-size: 21px; font-weight: 600; }
.center-desc { font-size: 13.5px; color: var(--ink-soft); max-width: 320px; line-height: 1.5; }
.center-desc code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

/* ── Inicio del local (index.html) ────────────────────────────── */
/* Portada: foto de fondo del local, con degradé + logo y nombre
   superpuestos abajo a la izquierda (estilo "perfil de app"). */
.local-hero {
  height: 220px; background: var(--accent); background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.local-hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 35%, rgba(0,0,0,0.55) 100%);
}
.local-hero-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px;
  display: flex; align-items: center; gap: 12px; color: #fff;
}
.local-hero-mark {
  width: 52px; height: 52px; border-radius: 15px; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-family: 'Newsreader', serif;
  font-size: 21px; font-weight: 600; flex: 0 0 auto; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.85); box-shadow: 0 6px 16px -6px rgba(0,0,0,0.5);
}
.local-hero-name { font-family: 'Newsreader', serif; font-size: 20px; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 6px rgba(0,0,0,0.35); }
.local-hero-tag { font-size: 12.5px; opacity: 0.92; margin-top: 2px; text-shadow: 0 1px 6px rgba(0,0,0,0.35); }

.local-body { padding: 20px 18px 8px; }
.local-reserve-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 13px; margin-bottom: 14px; border-radius: 999px; border: 1.5px solid var(--accent);
  background: oklch(97% 0.02 45 / 0.55); color: var(--accent); font-family: inherit; font-size: 14px;
  font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.local-reserve-btn:active { transform: scale(0.98); }
.local-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 22px; }
.local-section-title { font-family: 'Newsreader', serif; font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.local-section { margin-bottom: 24px; }

.local-details-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 460px) { .local-details-grid { grid-template-columns: 1fr 1fr; } }
.local-detail-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 3px 0; color: var(--ink); text-decoration: none;
}
.ld-ic { font-size: 17px; flex: 0 0 auto; width: 24px; text-align: center; line-height: 1.3; }
.ld-ic img { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.local-detail-row b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.local-detail-row span { display: block; font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; margin-top: 1px; }

.local-horarios { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.horario-item {
  display: flex; justify-content: space-between; padding: 9px 14px; font-size: 12.5px;
  border-bottom: 1px solid var(--line); color: var(--ink-soft);
}
.horario-item:last-child { border-bottom: none; }
.horario-item.today { background: oklch(97% 0.02 45); color: var(--ink); font-weight: 700; }

.local-map-wrap { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); margin-bottom: 10px; }
.local-map-wrap iframe { width: 100%; height: 220px; border: 0; display: block; }
.local-address { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; margin: 0 0 6px; }
.local-address:not(:empty)::before { content: '📍'; font-size: 11px; }
.local-directions-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; margin-bottom: 24px; }

.local-social-list { display: flex; flex-direction: column; gap: 2px; }
.local-social-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 4px; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.local-social-row:last-child { border-bottom: none; }
.ls-ic {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.ls-ic img { width: 24px; height: 24px; object-fit: contain; }
.local-social-row b { display: block; font-size: 13px; font-weight: 600; }
.local-social-row span { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 1px; }

.hero-foot { text-align: center; padding: 26px 20px 100px; font-size: 11.5px; color: var(--ink-soft); }
.hero-foot a { color: var(--ink-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ── Header (menu.html — banner del negocio) ─────────────────── */
.menu-header { background: var(--accent); color: var(--accent-ink); padding: 26px 22px 22px; position: relative; overflow: hidden; }
.menu-header::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(165deg, transparent 30%, rgba(0,0,0,0.4));
  pointer-events: none;
}
.menu-header > * { position: relative; }
.menu-header-top { display: flex; align-items: center; gap: 12px; }
.menu-mark {
  width: 46px; height: 46px; border-radius: 14px; background: oklch(99% 0.006 75 / 0.92); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-family: 'Newsreader', serif;
  font-size: 19px; font-weight: 600; flex: 0 0 auto; overflow: hidden;
}
.menu-header-info { flex: 1; min-width: 0; }
.menu-header-name { font-family: 'Newsreader', serif; font-size: 21px; font-weight: 600; line-height: 1.2; }
.menu-header-tag { font-size: 12.5px; opacity: 0.9; margin-top: 2px; }
.menu-header-links { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hlink {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: oklch(99% 0.006 75 / 0.16); font-size: 12px; font-weight: 600;
}
.hlink-ic { width: 16px; height: 16px; object-fit: contain; flex: 0 0 auto; display: block; }

/* ── Selector de idioma (arriba a la derecha del header) ──────── */
.lang-switcher { position: relative; flex: 0 0 auto; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 999px;
  background: oklch(99% 0.006 75 / 0.16); border: none; color: var(--accent-ink); font-size: 12px;
  font-weight: 700; font-family: inherit; cursor: pointer;
}
.lang-caret { font-size: 8px; opacity: 0.85; margin-left: 1px; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 148px; padding: 5px; z-index: 45;
  display: none; flex-direction: column; gap: 2px;
}
.lang-menu.open { display: flex; }
.lang-menu button {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; border: none; background: none;
  color: var(--ink); font-size: 12.5px; font-weight: 600; font-family: inherit; text-align: left; cursor: pointer;
}
.lang-menu button:hover { background: var(--surface-2); }
.lang-menu button.active { color: var(--accent); background: oklch(97% 0.02 45); }

/* ── Search + categorías (sticky) ─────────────────────────────── */
.sticky-controls { position: sticky; top: 0; z-index: 40; background: var(--bg); padding: 14px 18px 0; border-bottom: 1px solid var(--line); }
.search-box { position: relative; margin-bottom: 12px; }
.search-box input {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-family: inherit;
}
.search-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-box .s-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: 14px; }

.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.cat-pill.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ── Productos ────────────────────────────────────────────────── */
.menu-main { padding: 18px 18px 110px; }
.cat-section-title { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 600; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.cat-section-title:first-child { margin-top: 4px; }

.products-carousel {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.products-carousel::-webkit-scrollbar { display: none; }
.products-carousel .product-card { flex: 0 0 62%; scroll-snap-align: start; }
@media (min-width: 420px) {
  .products-carousel .product-card { flex: 0 0 220px; }
}
.product-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.product-card.unavailable { opacity: 0.55; }
.product-photo { aspect-ratio: 4/3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.product-name { font-family: 'Newsreader', serif; font-size: 14px; font-weight: 600; line-height: 1.25; }
.product-desc { font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; }
.product-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.product-price { font-weight: 700; font-size: 13.5px; }
.product-price-wrap { display: flex; align-items: baseline; gap: 6px; }
.product-price-old { font-size: 11px; color: var(--ink-soft); text-decoration: line-through; }
.product-price-wrap .product-price { color: var(--accent); }
.product-combo-note { font-size: 10.5px; color: var(--ink-soft); font-style: italic; line-height: 1.35; }
.product-add-btn {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  border: none; font-size: 16px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.qty-badge {
  position: absolute; top: 8px; right: 8px; background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.unavailable-tag {
  position: absolute; top: 8px; left: 8px; background: var(--ink); color: var(--bg); font-size: 9.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 7px; border-radius: 5px; z-index: 2;
}

/* ── Modal detalle de producto ───────────────────────────────── */
#product-modal-body { position: relative; }
.pd-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 13px;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.pd-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 14px; background: var(--surface-2); }
.pd-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.pd-name { font-family: 'Newsreader', serif; font-size: 19px; font-weight: 600; margin: 0; }
.pd-agotado-tag { display: inline-block; vertical-align: middle; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 5px; }
.pd-price { font-size: 17px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.pd-price-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.pd-price-old { font-size: 12px; color: var(--ink-soft); text-decoration: line-through; }
.pd-combo-note { font-size: 12.5px; color: var(--ink-soft); font-style: italic; margin: -10px 0 18px; }
.pd-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 18px; }
.pd-addons { margin: -4px 0 16px; }
.pd-addons-title { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 6px; }
.pd-addon-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.pd-addon-row:last-child { border-bottom: none; }
.pd-addon-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.pd-addon-name { flex: 1; }
.pd-addon-price { font-weight: 600; color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; }
.pd-live-total { display: flex; justify-content: flex-end; font-weight: 700; font-size: 14px; margin: 2px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.qty-stepper { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border-radius: 999px; padding: 6px 8px; }
.qty-stepper button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.qty-stepper .qty-val { font-weight: 700; min-width: 16px; text-align: center; }
.pd-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.pd-actions .btn-primary { flex: 1; justify-content: center; padding: 13px; border-radius: 999px; font-size: 14px; }
.pd-actions .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Barra flotante Inicio / Menú / Tu pedido (index.html + menu.html) ── */
.floating-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 4px; background: var(--ink); color: var(--bg);
  border-radius: 999px; padding: 6px; box-shadow: var(--shadow-lg);
}
.floating-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 8px 18px; border-radius: 999px; border: none; background: none; color: oklch(85% 0.012 75 / 0.72);
  font-family: inherit; font-size: 10px; font-weight: 700; cursor: pointer; position: relative;
  text-decoration: none; min-width: 62px; -webkit-tap-highlight-color: transparent;
}
.floating-nav-item.active { background: var(--accent); color: var(--accent-ink); }
.fn-ic { font-size: 17px; line-height: 1; position: relative; }
.fn-label { line-height: 1; }
.fn-badge {
  position: absolute; top: -7px; right: -11px; background: oklch(55% 0.18 25); color: #fff;
  border-radius: 999px; min-width: 15px; height: 15px; padding: 0 4px; font-size: 9px; font-weight: 700;
  display: none; align-items: center; justify-content: center; line-height: 1;
}
.fn-badge.show { display: flex; }

/* ── Carrito / checkout dentro del modal ─────────────────────── */
.cart-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: none; }
.cart-row-img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: 0 0 auto; }
.cart-row-info { flex: 1; min-width: 0; }
.cart-row-name { font-size: 13px; font-weight: 600; }
.cart-row-price { font-size: 11.5px; color: var(--ink-soft); }
.cart-row-addons { font-size: 10.5px; color: var(--ink-soft); margin-top: 1px; }
.cart-row-qty { display: flex; align-items: center; gap: 8px; }
.cart-row-qty button { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--ink-soft); }
.cart-summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); }

.opt-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); margin-bottom: 8px; font-size: 13px; font-weight: 600;
}
.opt-row.selected { border-color: var(--accent); background: oklch(97% 0.02 45); }
.opt-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.opt-row.selected .opt-radio { border-color: var(--accent); background: var(--accent); }

/* ── Toast, empty state ──────────────────────────────────────── */
.no-results { text-align: center; padding: 50px 20px; color: var(--ink-soft); font-size: 13.5px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

@media (max-width: 340px) {
  .products-carousel .product-card { flex-basis: 72%; }
}
