/* Paleta Macaí Bowls: naranja + turquesa sobre crema cálido */
:root {
  --orange: #fe914e;
  --orange-strong: #f57a2f;
  --orange-soft: #fff0e5;
  --cyan: #0dc0e0;
  --cyan-ink: #087a91;
  --cyan-soft: #e4f8fc;
  --navy: #12304a;
  --bg: #fff8f1;
  --card: #ffffff;
  --text: #12304a;
  --muted: #6b7a87;
  --line: #f0e6dc;
  --danger: #d64534;
  --warn-bg: #fff1e3;
  --warn: #a2520f;
  --radius: 20px;
  --shadow: 0 2px 6px rgba(18, 48, 74, 0.04), 0 8px 24px rgba(18, 48, 74, 0.06);
  --shadow-lg: 0 16px 48px rgba(18, 48, 74, 0.18);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.01em; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan-ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 20px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-strong) 100%);
  color: #fff; font-weight: 800; letter-spacing: .01em;
  text-decoration: none; transition: filter .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(245, 122, 47, 0.28);
}
.btn:hover { filter: brightness(1.04) saturate(1.05); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; }
.btn-light { background: var(--cyan-soft); color: var(--cyan-ink); box-shadow: none; }
.btn-light:hover { background: #d3f3f9; filter: none; }
.btn-ghost { background: #fff; color: var(--text); border: 1.5px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: #e2d4c6; filter: none; }
.btn-wa { background: #25d366; color: #fff; box-shadow: 0 4px 14px rgba(37, 211, 102, .3); }
.btn-lg { padding: 15px 22px; font-size: 1.05rem; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.96); display: grid; place-items: center;
  font-size: 1.3rem; box-shadow: var(--shadow); color: var(--text); flex-shrink: 0;
}

/* ---------- Encabezado ---------- */
.hero {
  position: relative; overflow: hidden; padding: 34px 16px 26px; text-align: center;
  background:
    radial-gradient(circle at 8% 20%, rgba(254, 145, 78, .22) 0, rgba(254, 145, 78, 0) 38%),
    radial-gradient(circle at 92% 10%, rgba(13, 192, 224, .22) 0, rgba(13, 192, 224, 0) 40%),
    radial-gradient(circle at 80% 110%, rgba(254, 145, 78, .14) 0, rgba(254, 145, 78, 0) 40%),
    var(--bg);
}
.hero-inner { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.hero-logo { width: min(300px, 76vw); height: auto; }
.hero p { margin: 12px 0 0; color: var(--muted); font-size: 1.02rem; font-weight: 600; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 700;
  box-shadow: 0 1px 3px rgba(18,48,74,.08); text-decoration: none;
}
.pill.accent { background: var(--cyan); color: var(--navy); }

.closed-banner {
  background: var(--warn-bg); color: var(--warn); text-align: center;
  padding: 12px 16px; font-weight: 800;
}

/* ---------- Categorías ---------- */
.cats {
  position: sticky; top: 0; z-index: 20; background: rgba(255, 248, 241, .94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cats-inner {
  max-width: 960px; margin: 0 auto; display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px 12px; scrollbar-width: none;
}
.cats-inner::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1.5px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .92rem; transition: all .15s;
}
.chip.active { background: var(--cyan); color: var(--navy); border-color: var(--cyan); }

/* ---------- Productos ---------- */
main { max-width: 960px; margin: 0 auto; padding: 4px 16px 130px; }
.section-title {
  font-size: 1.45rem; margin: 26px 0 12px; scroll-margin-top: 72px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--line), transparent); }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }

.product {
  display: flex; gap: 14px; background: var(--card); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); border: 0; text-align: left; width: 100%;
  color: inherit; align-items: stretch; transition: transform .15s, box-shadow .15s;
}
.product:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(18,48,74,.05), 0 14px 30px rgba(18,48,74,.09); }
.product-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 2px 0 0 2px; }
.product h3 { margin: 0 0 4px; font-size: 1.08rem; font-weight: 700; }
.product p {
  margin: 0; color: var(--muted); font-size: .87rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 800; color: var(--text); }
.add-badge {
  width: 34px; height: 34px; border-radius: 50%; background: var(--cyan); color: var(--navy);
  display: grid; place-items: center; font-size: 1.35rem; line-height: 1; font-weight: 800;
}
.thumb {
  width: 104px; height: 104px; border-radius: 16px; flex-shrink: 0; object-fit: cover;
  background: linear-gradient(140deg, var(--orange-soft), var(--cyan-soft));
}
.thumb-ph { display: grid; place-items: center; font-size: 2.4rem; }
.tag {
  display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--orange-strong); background: var(--orange-soft);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 5px; align-self: flex-start;
}

/* ---------- Barra del carrito ---------- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 65%, rgba(255,248,241,0));
}
.cart-bar .btn { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; box-shadow: 0 10px 30px rgba(245,122,47,.35); }
.count {
  background: rgba(255,255,255,.28); border-radius: 999px; min-width: 26px; height: 26px;
  padding: 0 8px; display: inline-grid; place-items: center; font-size: .85rem;
}

/* ---------- Hoja inferior (modal) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(18, 48, 74, .45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
@media (min-width: 720px) { .sheet-backdrop { align-items: center; } }
.sheet {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  border-radius: 26px 26px 0 0; display: flex; flex-direction: column; overflow: hidden;
  animation: up .22s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 720px) { .sheet { border-radius: 26px; } }
.sheet-head { position: relative; }
.sheet-img { width: 100%; height: 220px; object-fit: cover; background: linear-gradient(140deg, var(--orange-soft), var(--cyan-soft)); }
.sheet-img.thumb-ph { font-size: 3.5rem; height: 130px; }
.sheet-close { position: absolute; top: 12px; right: 12px; }
.sheet-title { padding: 18px 18px 6px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-title h2 { margin: 0; font-size: 1.4rem; }
.sheet-body { padding: 0 18px 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; background: #fff;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Opciones / toppings ---------- */
.group { margin-top: 20px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 8px; }
.group-head h4 { margin: 0; font-size: 1.02rem; font-weight: 800; }
.req { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f4efe9; color: var(--muted); white-space: nowrap; }
.req.need { background: var(--orange-soft); color: var(--orange-strong); }
.req.ok { background: var(--cyan-soft); color: var(--cyan-ink); }
.option {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 600;
}
.option:last-child { border-bottom: 0; }
.option input { width: 22px; height: 22px; accent-color: var(--cyan); flex-shrink: 0; margin: 0; }
.option span { flex: 1; }
.option span.muted { flex: 0 0 auto; font-weight: 700; }
.option.disabled { opacity: .45; cursor: not-allowed; }

.stepper { display: inline-flex; align-items: center; background: #f6f1eb; border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.stepper button { width: 42px; height: 46px; border: 0; background: transparent; font-size: 1.25rem; color: var(--navy); font-weight: 800; }
.stepper button:hover { background: #efe6dc; }
.stepper span { min-width: 26px; text-align: center; font-weight: 800; }
.stepper.sm button { width: 32px; height: 34px; font-size: 1.05rem; }

/* ---------- Formularios ---------- */
.field { margin-top: 14px; }
.field label, .label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: #fff; font-size: 16px; /* evita zoom en iOS */
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(13,192,224,.15); }
textarea.input { resize: vertical; min-height: 70px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; background: #fff;
  text-align: left; display: flex; flex-direction: column; gap: 2px; color: inherit; transition: all .15s;
}
.choice strong { font-size: .98rem; }
.choice small { color: var(--muted); font-weight: 600; }
.choice.active { border-color: var(--cyan); background: var(--cyan-soft); }
.choice .ico { font-size: 1.4rem; }

/* ---------- Carrito ---------- */
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item h4 { margin: 0; font-size: 1rem; font-weight: 800; }
.cart-item .extra { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.cart-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.link-btn { background: none; border: 0; color: var(--danger); font-size: .84rem; font-weight: 700; padding: 0; }
.totals { margin-top: 14px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-weight: 600; }
.totals .row.total { font-weight: 800; font-size: 1.2rem; border-top: 1.5px dashed var(--line); margin-top: 6px; padding-top: 10px; }
.box {
  background: var(--cyan-soft); border-radius: 16px; padding: 12px 14px; margin-top: 10px;
  font-size: .9rem; white-space: pre-line;
}
.box.warn { background: var(--warn-bg); color: var(--warn); }
.error-msg { color: var(--danger); font-weight: 700; margin-top: 10px; font-size: .92rem; }
.steps-title { display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty .big { font-size: 3rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 999px; font-weight: 700;
  z-index: 100; font-size: .92rem; box-shadow: var(--shadow-lg); animation: up .2s ease-out;
  max-width: calc(100% - 32px);
}

/* ---------- Página de seguimiento ---------- */
.track { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
.track-logo { display: block; width: 150px; margin: 4px auto 6px; }
.card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-top: 14px; }
.card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.success-head { text-align: center; padding: 26px 18px; }
.success-head .big { font-size: 3rem; }
.success-head h1 { margin: 6px 0 4px; font-size: 1.6rem; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 8px 0; color: var(--muted); font-weight: 600; }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; flex-shrink: 0; background: #fff; font-weight: 800; }
.timeline li.done { color: var(--text); }
.timeline li.done .dot { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.timeline li.current { color: var(--text); font-weight: 800; }
.timeline li.current .dot { border-color: var(--orange); color: var(--orange-strong); box-shadow: 0 0 0 5px var(--orange-soft); }
.line-item { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.line-item .extra { font-size: .84rem; color: var(--muted); }
.actions { display: grid; gap: 10px; margin-top: 14px; }

.spinner { width: 30px; height: 30px; border: 3px solid var(--orange-soft); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Opciones incluidas y cuadrícula ---------- */
.included-box {
  margin-top: 14px; padding: 12px 14px; border-radius: 16px; font-size: .92rem;
  background: var(--orange-soft); color: #8a4a17; border: 1.5px dashed rgba(254,145,78,.55);
}
.included-box.done { background: var(--cyan-soft); color: var(--cyan-ink); border-color: rgba(13,192,224,.45); }
.option .opt-name { flex: 1; min-width: 0; }
.option .opt-name small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; margin-top: 1px; }
.option .opt-price { flex: 0 0 auto; color: var(--muted); font-weight: 700; font-size: .88rem; white-space: nowrap; }
.option .opt-price.inc { color: var(--cyan-ink); }
.opts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opts-grid .option {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; gap: 8px; align-items: flex-start;
  flex-wrap: wrap; transition: border-color .15s, background .15s;
}
.opts-grid .option:last-child { border-bottom: 1.5px solid var(--line); }
.opts-grid .option input { width: 18px; height: 18px; margin-top: 1px; }
.opts-grid .option .opt-name { font-size: .9rem; line-height: 1.25; flex-basis: calc(100% - 28px); }
.opts-grid .option .opt-price { flex-basis: 100%; padding-left: 26px; font-size: .8rem; }
.opts-grid .option:has(input:checked) { border-color: var(--cyan); background: var(--cyan-soft); }

/* ---------- Mapa de entrega ---------- */
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; min-width: 0; }
.search-results { display: grid; gap: 4px; margin-top: 8px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.search-results button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 10px; font-size: .9rem; color: var(--text); }
.search-results button:hover, .search-results button:focus-visible { background: var(--cyan-soft); }
.map-box { position: relative; z-index: 0; height: 260px; margin-top: 10px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--cyan-soft); }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; }
.map-actions .link-btn { color: var(--cyan-ink); font-size: .9rem; }
.quote-box { margin-top: 10px; padding: 11px 14px; border-radius: 14px; background: var(--cyan-soft); color: var(--navy); font-size: .92rem; }
.quote-box.ok { background: var(--cyan-soft); }
.quote-box.warn { background: var(--warn-bg); color: var(--warn); }
.map-pin { width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(18, 48, 74, .3); }
.map-pin span { transform: rotate(45deg); font-size: 16px; line-height: 1; }
.map-pin.home { background: var(--orange); }
.map-pin.store { background: var(--cyan); }
.leaflet-container { font-family: var(--font-body); }

/* ---------- Modo mesero (/mesero/) ---------- */
.staff-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px;
  max-width: 960px; margin: 0 auto;
}
.staff-logo { height: 28px; width: auto; flex-shrink: 0; }
.staff-spacer { flex: 1; }
.staff-btn {
  border: 0; background: #fff; color: var(--text); font-weight: 800; font-size: .85rem;
  padding: 8px 11px; border-radius: 999px; box-shadow: 0 1px 3px rgba(18,48,74,.1);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0;
}
#waiter-btn { flex-shrink: 1; }
.staff-btn.ghost { background: transparent; box-shadow: none; color: var(--muted); padding: 8px 4px; }
.staff-login { max-width: 360px; margin: 40px auto; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.staff-login h2 { margin: 0; }
.staff-login p { margin: 0 0 6px; }
.staff-login-logo { width: 200px; height: auto; margin: 0 auto 6px; }
.paid-option { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.staff-sent { text-align: center; padding-top: 28px; }
.staff-sent .big { font-size: 3rem; }
.staff-sent h2 { margin: 8px 0 4px; }
.staff-order { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.staff-order.s-listo { outline: 2px solid #34c77b; }
.staff-order-head { display: flex; align-items: center; gap: 10px; }
.staff-order-head span:nth-child(2) { flex: 1; font-weight: 700; }
.staff-order .btn { justify-self: start; margin-top: 6px; }
.status-pill { font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-strong); }
.status-pill.s-preparando { background: #fff3c4; color: #8a6200; }
.status-pill.s-listo { background: #d8f7e6; color: #137a45; }
.status-pill.s-en_camino { background: var(--cyan-soft); color: var(--cyan-ink); }
