/* Motor de menú digital — estilos base reutilizables.
   La paleta real (colores/tipografía) de cada cliente se aplica
   sobreescribiendo estas variables en su propio archivo (ver marca.css
   de cada cliente en salida/), no editando este archivo.

   Dirección actual: "Fuego Criollo" — mercado colombiano, fondo claro,
   achiote/cilantro/maíz, Zilla Slab + Karla.

   Variables pensadas para ajustar por cliente sin tocar este archivo:
   paleta de colores (--bg, --surface, --red-intense, etc.), tipografía
   (--font-display, --font-name, --font-body), color y tamaño de los
   textos de plato (--text-strong, --text-body, --font-size-name,
   --font-size-desc), tamaño de la miniatura (--thumb-size) y forma del
   precio (--price-radius: 999px = óvalo, valor bajo tipo 4px = cuadrado). */

:root {
  --bg: #f2e4c8;
  --surface: #ffffff;
  --surface-2: #f3ead5;
  --white: #2a2118;
  --crisp-white: #1f1710;
  --yellow: #3c5a40;
  --corn: #e8a93c;
  --red: #a8290f;
  --red-intense: #a8290f;
  --red-intense-2: #7a1d0a;
  --muted: #8a7c65;
  --border: #e8dcc8;
  --font-display: 'Zilla Slab', Georgia, serif;
  --font-name: 'Zilla Slab', Georgia, serif;
  --font-body: 'Karla', system-ui, sans-serif;
  --text-strong: #000000;
  --text-body: #000000;
  --font-size-name: 1rem;
  --font-size-desc: 0.8rem;
  --thumb-size: 144px;
  --price-radius: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body { padding-bottom: 5.5rem; min-height: 100vh; }

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Header ---------- */
header.top-bar {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.2rem 1rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
header.top-bar img.logo { max-width: 46%; height: auto; display: block; }

/* ---------- Pills ---------- */
.pills {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.6rem 1rem 0.3rem;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #8a7c65;
  text-transform: uppercase;
}
.pill.active { background: var(--red); border-color: var(--red); color: #fff; }
.pill--info { color: var(--yellow); border-color: var(--yellow); }

/* ---------- Category + cards ---------- */
main { max-width: 520px; margin: 0 auto; padding: 0 0 1rem; }

.cat-wrap { margin: 0 1rem; }
.cat-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--yellow);
  text-transform: uppercase;
  margin: 1.3rem 0 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 3px dashed var(--red);
  display: inline-block;
}
.cat-nota {
  font-size: 0.78rem;
  color: var(--muted);
  margin: -0.4rem 0 0.8rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  margin: 0 0 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
}
.card:active { background: var(--surface-2); }
.card-main { min-width: 0; flex: 1; }
.card-name { font-family: var(--font-name); font-weight: 700; font-size: var(--font-size-name); color: var(--text-strong); }
.card-desc { font-size: var(--font-size-desc); color: var(--text-body); margin-top: 0.2rem; line-height: 1.4; font-weight: 400; }
.card-tags { display: flex; gap: 0.3rem; margin-top: 0.35rem; flex-wrap: wrap; }
.chip { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 0.14rem 0.45rem; border-radius: 999px; background: var(--corn); color: #2a2118; }
.card-media { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; flex: none; }
.card-thumb-wrap {
  width: var(--thumb-size); height: var(--thumb-size); border-radius: 12px; background: var(--surface); flex: none;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-thumb { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.card-price {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--red-intense);
  text-align: center; white-space: nowrap; flex: none; margin-top: 0.5rem;
  display: inline-block; padding: 0.25rem 0.85rem; border: 2px solid var(--red-intense); border-radius: var(--price-radius);
}
.card-price small { display: block; font-family: var(--font-body); font-size: 0.6rem; color: var(--muted); font-weight: 700; }

.foot-note {
  max-width: 520px; margin: 1.5rem auto 0; padding: 0 1.2rem;
  font-size: 0.75rem; color: var(--muted); text-align: center; line-height: 1.5;
}

/* ---------- Modal (detalle de plato) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(42,33,24,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.overlay[hidden] { display: none; }
.sheet {
  position: relative;
  background: var(--surface-2); width: 100%; max-width: 520px;
  border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 1.1rem 1.1rem 1.4rem;
  animation: slide-up 0.2s ease-out;
}
@keyframes slide-up { from { transform: translateY(24px); opacity: 0.5; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 0.9rem; }
.sheet-close {
  position: absolute; top: 0.9rem; right: 0.9rem; z-index: 5; font-size: 1.15rem; color: #fff;
  width: 34px; height: 34px; border-radius: 999px; background: rgba(42,33,24,0.6);
  display: flex; align-items: center; justify-content: center;
}
.sheet-photo-wrap {
  width: 100%; aspect-ratio: 16/10; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 6px 16px rgba(42,33,24,0.14);
  display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 0.9rem;
}
.sheet-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
/* Excepción por ítem (item.foto_ajuste: "contain" en datos-menu.json) para fotos
   donde recortar el marco 16:10 corta parte importante (ej. botellas angostas). */
.sheet-photo-wrap--contain img { object-fit: contain; }
.sheet h2 { font-family: var(--font-name); font-weight: 600; font-size: 1.3rem; color: var(--text-strong); margin: 0 0 0.3rem; }
.sheet .desc { font-size: 0.85rem; color: var(--text-body); line-height: 1.5; margin: 0 0 1rem; }

.section-title {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  font-size: 0.82rem; color: var(--yellow); margin: 1.1rem 0 0.5rem;
}

.option-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--border);
}
.option-row:last-child { border-bottom: none; }

.info-row {
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  font-size: 0.7rem; color: var(--yellow); margin-bottom: 0.2rem;
}
.info-value { font-size: 0.9rem; color: var(--text-body); line-height: 1.5; }
.option-row label { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; flex: 1; cursor: pointer; }
.option-row input[type="checkbox"], .option-row input[type="radio"] {
  width: 19px; height: 19px; flex: none; accent-color: var(--red-intense);
}
.option-price { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--red-intense); white-space: nowrap; }

/* Ingredientes: flujo que se autoajusta al ancho de cada texto (como chips),
   en vez de columnas fijas donde un ítem corto deja hueco vacío al lado. */
.ing-grid {
  display: flex; flex-wrap: wrap;
  gap: 0.15rem 1.1rem; margin-bottom: 0.4rem;
}
.option-row--ing { border-bottom: none; padding: 0.35rem 0; flex: 0 0 auto; }
.option-row--ing label { font-size: 0.85rem; white-space: nowrap; }

.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 1.1rem 0 0.3rem; }
.qty-stepper { display: flex; align-items: center; gap: 0.9rem; }
.qty-btn {
  width: 34px; height: 34px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--crisp-white); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.qty-value { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; min-width: 1.5rem; text-align: center; }

.sheet-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.sheet-total { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--red-intense); }
.sheet-total small { display: block; font-family: var(--font-body); font-size: 0.65rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.btn-primary {
  background: var(--red-intense); color: #fff; font-family: var(--font-display);
  font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.95rem;
  padding: 0.8rem 1.3rem; border-radius: 12px; flex: none;
}
.btn-primary:disabled { opacity: 0.5; }
.btn-secondary {
  background: var(--surface); color: var(--crisp-white); font-family: var(--font-display);
  font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.85rem;
  padding: 0.6rem 1rem; border-radius: 10px;
}

/* ---------- Carrito flotante ---------- */
.cart-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  background: var(--red-intense); color: #fff; border-radius: 999px;
  padding: 0.85rem 1.2rem; display: flex; align-items: center; gap: 0.6rem;
  box-shadow: 0 6px 18px rgba(42,33,24,0.35); font-family: var(--font-display); font-weight: 700;
}
.cart-fab[hidden] { display: none; }
.cart-fab .count {
  background: #fff; color: var(--red-intense); border-radius: 999px;
  min-width: 22px; height: 22px; padding: 0 5px; display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
}
.cart-fab .total { font-size: 0.95rem; }

/* ---------- Carrito (drawer) ---------- */
.cart-line {
  background: var(--surface); border-radius: 12px; padding: 0.7rem 0.8rem; margin-bottom: 0.6rem;
  box-shadow: 0 2px 8px rgba(42,33,24,0.08);
}
.cart-line-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.cart-line-name { font-family: var(--font-name); font-weight: 600; color: var(--crisp-white); font-size: 0.92rem; }
.cart-line-price { font-family: var(--font-display); font-weight: 700; color: var(--red-intense); font-size: 0.92rem; white-space: nowrap; }
.cart-line-detail { font-size: 0.76rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.4; }
.cart-line-remove { font-size: 0.72rem; color: var(--red-intense); text-decoration: underline; margin-top: 0.4rem; display: inline-block; }

.cart-empty { color: var(--muted); text-align: center; padding: 2rem 0; font-size: 0.9rem; }

.form-field { margin-bottom: 0.8rem; }
.form-field label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.02em; }
.form-field input, .form-field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.6rem 0.7rem; color: var(--crisp-white); font-family: var(--font-body); font-size: 0.9rem;
}
.form-field textarea { resize: vertical; min-height: 3rem; }
.form-field--error input { border-color: var(--red-intense); }
.form-error { color: var(--red-intense); font-size: 0.72rem; margin-top: 0.3rem; }

.proto-note {
  font-size: 0.72rem; color: var(--muted); line-height: 1.4; margin: -0.4rem 0 0.9rem;
  padding: 0.5rem 0.6rem; background: var(--surface); border-radius: 8px;
}

.grand-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin: 1rem 0; padding-top: 0.8rem; border-top: 1px dashed var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.grand-total-row .amount { color: var(--red-intense); font-size: 1.35rem; }
