/* =====================================================================
   NFKings · Estilos del menú público
   Los colores llegan como variables desde el panel (--brand, --accent, --bg).
   Cada variante (.v-clasico, .v-elegante, .v-urbano, .v-fresco) cambia forma
   y personalidad sin tocar el HTML.
   ===================================================================== */
:root {
  --brand: #c2410c; --brand-ink: #fff;
  --accent: #15803d; --accent-ink: #fff;
  --bg: #fff7ed; --ink: #111;
  --font-head: system-ui, sans-serif;
  --font-body: system-ui, sans-serif;
  --surface: color-mix(in srgb, var(--bg) 86%, #fff);
  --muted: color-mix(in srgb, var(--ink) 66%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --radius: 16px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 18px rgb(0 0 0 / .06);
  --wa: #1fa855;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body.is-loading #app > :not(.loader) { visibility: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
/* Fuentes de títulos que solo tienen un grosor: se muestran tal cual, sin negrita falsa */
.head-single :is(h1, h2, h3, .logo-text, .cat-num) { font-synthesis: none; }
#app { max-width: 760px; margin: 0 auto; min-height: 100dvh; padding-bottom: 96px; }
.ico { width: 1.2em; height: 1.2em; flex: none; }
.muted { color: var(--muted); }

.loader { display: grid; place-items: center; gap: 12px; min-height: 70dvh; color: var(--muted); }
.loader span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.home, .message { min-height: 80dvh; display: grid; place-content: center; text-align: center; padding: 24px; gap: 8px; }
.home h1 { font-size: 3.2rem; color: var(--brand); letter-spacing: .02em; }
.home-links { display: grid; gap: 10px; width: min(280px, 100%); margin: 8px auto 0; }
.home-links .btn { text-decoration: none; }
.home-admin { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.home .home-note { font-size: .82rem; margin-top: 10px; }
.home p, .message p { color: var(--muted); max-width: 32ch; margin: 0 auto 12px; }

.preview-banner {
  position: sticky; top: 0; z-index: 30; text-align: center; font: 600 13px/1 system-ui, sans-serif;
  padding: 9px 12px; background: repeating-linear-gradient(45deg, #fde047 0 12px, #facc15 12px 24px); color: #111;
}

/* ---------- Encabezado ---------- */
.hero { position: relative; padding: 28px 18px 20px; }
.hero.has-cover { padding-top: 150px; }
.hero-cover {
  position: absolute; inset: 0 0 auto 0; height: 210px; width: 100%;
  object-fit: cover; object-position: center;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
          mask-image: linear-gradient(#000 55%, transparent);
}
.hero-inner { position: relative; display: flex; gap: 16px; align-items: center; }
.logo {
  width: 88px; height: 88px; border-radius: 50%; flex: none; object-fit: cover;
  background: #fff; box-shadow: 0 0 0 4px var(--bg), var(--shadow);
}
.logo-text {
  display: grid; place-items: center; background: var(--brand); color: var(--brand-ink);
  font: 700 1.9rem/1 var(--font-head);
}
.eyebrow { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.hero h1 { font-size: clamp(1.8rem, 7vw, 2.6rem); }
.desc { margin: 6px 0 0; color: var(--muted); }
.hours { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .9rem; color: var(--muted); }

.notice {
  margin: 4px 18px 12px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg)); border-left: 4px solid var(--accent);
  font-weight: 600;
}

/* ---------- Botones de contacto ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 18px 14px; }
.action {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .95rem;
  background: var(--surface); border: 1px solid var(--line);
}
.action-wa { background: var(--wa); color: #fff; border-color: transparent; }
.action-icon { width: 46px; padding: 0; justify-content: center; }

/* ---------- Navegación por categorías ---------- */
.cat-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.preview-banner ~ .cat-nav { top: 31px; }
.cat-nav-inner { display: flex; gap: 8px; overflow-x: auto; padding: 10px 18px; scrollbar-width: none; }
.cat-nav-inner::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .92rem;
  background: var(--surface); border: 1px solid var(--line); white-space: nowrap;
}
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* ---------- Productos ---------- */
.menu { padding: 8px 18px 0; }
.cat { padding-top: 22px; }
.cat-head { margin-bottom: 12px; }
.cat-head h2 { font-size: 1.55rem; }
.cat-head p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }

.card {
  display: flex; gap: 12px; align-items: stretch; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); cursor: default;
}
button.card { cursor: pointer; transition: transform .12s ease; }
button.card:active { transform: scale(.985); }
button.card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-title { display: flex; align-items: baseline; gap: 8px; }
.card h3 { font-size: 1.08rem; flex: 0 1 auto; min-width: 0; }
.leader { flex: 1; min-width: 12px; }
.card-title .price { flex: none; margin-left: auto; }
.cat-num { display: none; }
.hero-deco { display: none; }
.hero > :not(.hero-deco):not(.hero-cover) { position: relative; }
.card-desc { margin: 4px 0 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.add-label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.price { font-weight: 800; font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.add {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 1.3rem; line-height: 1;
}
.card-photo { flex: none; width: 108px; aspect-ratio: 1; border-radius: calc(var(--radius) - 6px); overflow: hidden; background: var(--line); }
.card-photo { align-self: center; }
/* Con foto al lado hay menos espacio: nombre arriba y precio abajo */
.card.has-photo .card-title { flex-direction: column; align-items: flex-start; gap: 4px; }
.card.has-photo .leader { display: none; }
.card.has-photo .card-title .price { margin-left: 0; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
/* Sin foto: tarjeta tipográfica con una franja de color, sin imagen inventada. */
.card.no-photo { position: relative; padding-left: 20px; overflow: hidden; }
.card.no-photo::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 0 4px 4px 0; background: var(--accent); }

.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.foot { text-align: center; font-size: .8rem; color: var(--muted); padding: 40px 18px 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 1rem;
}
.btn-block { width: 100%; }
.btn-brand { background: var(--brand); color: var(--brand-ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); min-height: 44px; }

/* ---------- Carrito flotante ---------- */
.cart-fab {
  position: fixed; z-index: 40; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(560px, calc(100% - 28px));
  display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 20px;
  border: 0; border-radius: 18px; background: var(--brand); color: var(--brand-ink);
  font-weight: 700; box-shadow: 0 10px 30px rgb(0 0 0 / .28); cursor: pointer;
}
.cart-fab strong { margin-left: auto; }
.cart-fab[hidden] { display: none; }

/* ---------- Hojas inferiores ---------- */
.sheet {
  width: 100%; max-width: 620px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 22px 22px 0 0; background: var(--bg); color: var(--ink); overflow: auto;
  animation: up .22s ease-out;
}
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 22px; } }
.sheet::backdrop { background: rgb(0 0 0 / .5); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-close {
  position: sticky; top: 10px; float: right; margin: 10px 10px -54px 0; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 85%, transparent); cursor: pointer; box-shadow: var(--shadow);
}
.sheet-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.sheet-body, .cart { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.sheet-body h2, .cart h2 { font-size: 1.6rem; padding-right: 48px; }
.sheet-body p { margin: 0; }
.price.big { font-size: 1.35rem; }
.label { font-weight: 700; font-size: .9rem; margin-top: 6px; }
.sheet input[type=text], .sheet textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px;
}
.sheet input:focus, .sheet textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
.qty { display: flex; align-items: center; gap: 14px; margin: 6px 0; }
.qty-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 1.4rem; font-weight: 700; cursor: pointer;
}
.qty-n { min-width: 2ch; text-align: center; font-weight: 800; font-size: 1.2rem; }
.qty.small { gap: 6px; margin: 0; }
.qty.small .qty-btn { width: 40px; height: 40px; font-size: 1.15rem; }

.lines { list-style: none; margin: 0; padding: 0; }
.line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.line-main .muted { font-size: .85rem; }
.line-note.line-note { min-height: 40px; padding: 8px 10px; font-size: .9rem; margin-top: 6px; }
.line-side { display: grid; justify-items: end; align-content: space-between; gap: 8px; }
.line-sub { font-variant-numeric: tabular-nums; }
.who { border: 0; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.who legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.radios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio {
  display: flex; align-items: center; gap: 8px; padding: 12px; min-height: 50px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer;
}
.radio:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.radio input { accent-color: var(--brand); width: 20px; height: 20px; margin: 0; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 10px 0 0; padding: 14px; border-radius: 14px; background: var(--surface); }
.totals dt, .totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals dd { text-align: right; font-weight: 600; }
.totals .total { font-weight: 800; font-size: 1.15rem; padding-top: 6px; border-top: 1px solid var(--line); }
.form-error { color: #dc2626; font-weight: 700; margin: 0; min-height: 1em; }
.fine { font-size: .82rem; color: var(--muted); text-align: center; margin: 0; }

.toast {
  position: fixed; z-index: 60; left: 50%; top: 16px; transform: translate(-50%, -150%);
  width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: #111; color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / .3);
  transition: transform .25s ease; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

/* Los estilos de cada tipo de negocio están en estilos.css */
