/* ==========================================================================
   Antioquia Gourmet — sistema de diseño
   Paleta de marca: bosque #3C5F3D · arcilla #94472F · hoja #57B253
   Tipografía: Bricolage Grotesque (títulos) + Figtree (texto)
   Mobile first. Breakpoints: 640 · 900 · 1200
   ========================================================================== */

:root {
  --forest: #3c5f3d;
  --forest-900: #1f3321;
  --forest-700: #2e4a2f;
  --forest-100: #e3ede1;
  --forest-50: #f0f5ef;
  --clay: #94472f;
  --clay-700: #7a3924;
  --clay-100: #f5e6e0;
  --leaf: #57b253;
  --leaf-100: #e2f3e1;

  --bg: #f4f7f3;
  --surface: #ffffff;
  --line: #dfe7dc;
  --line-strong: #c9d6c5;
  --text: #1f2d20;
  --text-2: #55665a;
  --text-3: #7d8c80;
  --danger: #b3261e;
  --danger-100: #fbe9e7;
  --warn-100: #fff1d6;
  --warn: #7a5200;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --topbar-h: 64px;
  --bottom-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-h) + var(--safe-b));
}
img { max-width: 100%; display: block; }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--forest-700); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--forest); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--fill { fill: currentColor; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: var(--r-sm);
  font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: background-color 0.18s, transform 0.12s, box-shadow 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--clay); color: #fff; }
.btn--primary:hover { background: var(--clay-700); color: #fff; }
.btn--forest { background: var(--forest); color: #fff; }
.btn--forest:hover { background: var(--forest-700); color: #fff; }
.btn--ghost { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn--ghost:hover { background: var(--forest-50); color: var(--forest-700); }
.btn--light { background: #fff; color: var(--forest-900); }
.btn--light:hover { background: var(--forest-100); color: var(--forest-900); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 0.9rem; border-radius: 10px; }
.btn--block { width: 100%; }
.btn--danger { background: var(--danger-100); color: var(--danger); }
.btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--r-pill); background: var(--forest-50); color: var(--forest);
  transition: background-color 0.15s;
}
.icon-btn:hover { background: var(--forest-100); }

/* ---------- Skeletons ---------- */
.sk {
  position: relative; overflow: hidden; display: block;
  background: #e6ede3; border-radius: var(--r-xs);
}
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.65) 50%, transparent 80%);
  transform: translateX(-100%); animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk--line { height: 12px; }
.sk--title { height: 20px; width: 70%; }
.sk--pill { height: 40px; width: 96px; border-radius: var(--r-pill); }
.sk--img { aspect-ratio: 4 / 3; border-radius: var(--r-md); }
.sk--circle { border-radius: 50%; }
.sk--w40 { width: 40%; } .sk--w60 { width: 60%; } .sk--w80 { width: 80%; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60; height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; height: 100%; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 48px; width: auto; }
.topbar__search { display: none; }
.topbar__nav { display: none; }
.topbar__back { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }

.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cart-pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--forest); color: #fff; text-decoration: none; font-weight: 700;
}
.cart-pill:hover { background: var(--forest-700); color: #fff; }
.cart-pill__count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--leaf); color: var(--forest-900); border-radius: var(--r-pill); font-size: 0.8rem;
}
.cart-pill__total { display: none; }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 70;
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end;
  height: calc(var(--bottom-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: #fff; border-top: 1px solid var(--line);
}
.bottom-nav__item {
  display: grid; justify-items: center; align-content: center; gap: 2px; height: var(--bottom-h);
  color: var(--text-3); font-size: 0.72rem; font-weight: 600; text-decoration: none;
}
.bottom-nav__item.is-active { color: var(--forest); }
.bottom-nav__fab {
  position: relative; justify-self: center; margin-bottom: 16px;
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--clay); color: #fff; box-shadow: 0 6px 16px rgba(148, 71, 47, 0.35);
}
.bottom-nav__fab:hover { color: #fff; background: var(--clay-700); }
.bottom-nav__badge {
  position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--forest); color: #fff; font-size: 0.75rem; font-weight: 700; border: 2px solid #fff;
}

/* ---------- Layout común ---------- */
main { display: block; min-height: 60vh; }
.page { padding: 20px 0 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: clamp(1.7rem, 4.5vw, 2.4rem); font-weight: 800; }
.page-sub { color: var(--text-2); margin-top: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 600; text-decoration: none; color: var(--text-2); }
.back-link:hover { color: var(--forest); }

.section { padding: 28px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(1.3rem, 3.4vw, 1.7rem); font-weight: 800; }
.section-head a { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--forest); color: #fff;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.hero .ridge, .footer__ridge .ridge, .auth__aside .ridge { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; fill: none; stroke: rgba(255, 255, 255, 0.11); stroke-width: 1.5; }
.hero__inner { display: grid; gap: 24px; padding-block: 28px 32px; }
.hero__copy { display: grid; gap: 14px; align-content: center; }
.hero__badge {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill); background: var(--clay); color: #fff; font-size: 0.85rem; font-weight: 700;
}
.hero h1 { font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 800; max-width: 14ch; text-wrap: balance; }
.hero p { color: rgba(255, 255, 255, 0.85); max-width: 46ch; font-size: 1.05rem; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.hero__price { font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.hero__price b { font-family: var(--font-display); font-size: 1.4rem; color: #fff; }
.hero__media { position: relative; }
.hero__media img { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; border-radius: var(--r-lg); border: 4px solid rgba(255, 255, 255, 0.9); }
.hero__tag {
  position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: #fff; color: var(--forest-900); border-radius: var(--r-pill); font-weight: 700; font-size: 0.9rem;
}
.hero__tag .icon { color: var(--leaf); }

.info-strip { display: grid; gap: 10px; margin-top: 16px; }
.info-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.info-chip__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--forest-50); color: var(--forest); flex: none; }
.info-chip strong { display: block; font-size: 0.95rem; }
.info-chip span { color: var(--text-2); font-size: 0.85rem; }

/* ---------- Buscador móvil + chips ---------- */
.m-search { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 0 14px; min-height: 48px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md); }
.m-search:focus-within { border-color: var(--forest); }
.m-search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; }
.m-search .icon { color: var(--text-3); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-pill);
  font-weight: 600; font-size: 0.95rem; color: var(--text); transition: background-color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--forest); }
.chip[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ---------- Tarjetas de menú ---------- */
.dish-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dish {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.dish:hover { border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(31, 51, 33, 0.08); }
.dish__media { position: relative; aspect-ratio: 4 / 3; background: var(--forest-50); overflow: hidden; }
.dish__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.dish:hover .dish__media img { transform: scale(1.04); }
.dish__badge {
  position: absolute; left: 8px; top: 8px; z-index: 1; padding: 4px 10px;
  background: var(--clay); color: #fff; border-radius: var(--r-pill); font-size: 0.75rem; font-weight: 700;
}
.dish__add {
  position: absolute; right: 10px; bottom: 10px; z-index: 1;
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #fff; color: var(--clay); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s, background-color 0.15s, color 0.15s;
}
.dish__add:hover { background: var(--clay); color: #fff; transform: scale(1.06); }
.dish__body { display: flex; flex-direction: column; gap: 6px; padding: 12px; flex: 1; }
.dish__body h3 { font-size: 1rem; font-weight: 700; }
.dish__desc { color: var(--text-2); font-size: 0.88rem; display: none; }
.dish__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.85rem; color: var(--text-2); }
.rating .icon { color: #e0a100; }

.dish--skeleton .dish__body { gap: 10px; }
.empty {
  display: grid; justify-items: center; gap: 10px; text-align: center; padding: 40px 20px;
  background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2);
}
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--forest-50); color: var(--forest); }
.empty h3 { color: var(--text); font-size: 1.15rem; }
.empty p { max-width: 38ch; }

/* ---------- Tira de pedidos recientes (home) ---------- */
.recent { display: flex; gap: 12px; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.recent__item {
  flex: none; width: min(78vw, 300px); scroll-snap-align: start; display: grid; gap: 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.recent__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recent__name { font-weight: 700; }
.recent__meta { color: var(--text-2); font-size: 0.85rem; }

/* ---------- Estados de pedido ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--r-pill); font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--recibido, .status--preparando, .status--pendiente_pago { background: var(--warn-100); color: var(--warn); }
.status--pagado { background: #e3eefb; color: #1d4f91; }
.status--expirado { background: #eceeed; color: var(--text-2); }
.status--camino, .status--en_camino { background: var(--forest-100); color: var(--forest-700); }
.status--entregado { background: var(--leaf-100); color: #1f6b1c; }
.status--cancelado { background: var(--danger-100); color: var(--danger); }

/* ---------- Modal / sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center;
  background: rgba(20, 32, 22, 0.55); backdrop-filter: blur(2px);
}
.overlay.is-visible { display: flex; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden;
  animation: sheet-in 0.28s var(--ease);
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__head { position: relative; display: grid; }
.sheet__head img { width: 100%; height: 180px; object-fit: cover; }
.sheet__close { position: absolute; top: 12px; right: 12px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.sheet__title { padding: 16px 20px 8px; display: grid; gap: 4px; }
.sheet__title h3 { font-size: 1.4rem; font-weight: 800; }
.sheet__title p { color: var(--text-2); font-size: 0.92rem; }
.sheet__groups { overflow-y: auto; padding: 4px 20px 12px; display: grid; gap: 18px; flex: 1; overscroll-behavior: contain; }
.sheet__foot { display: grid; gap: 10px; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; }
.sheet__hint { color: var(--danger); font-size: 0.88rem; font-weight: 600; display: none; align-items: center; gap: 6px; }
.sheet__hint.is-visible { display: flex; }
.sheet__actions { display: flex; align-items: center; gap: 12px; }
.sheet__actions .btn { flex: 1; }

.opt-group__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.opt-group__head h4 { font-size: 1.05rem; }
.opt-group__tag { padding: 3px 10px; border-radius: var(--r-pill); background: var(--forest-50); color: var(--forest-700); font-size: 0.78rem; font-weight: 700; }
.opt-group__tag--req { background: var(--clay-100); color: var(--clay-700); }
.opt {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; margin-bottom: 6px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.opt:hover { border-color: var(--line-strong); }
.opt:has(input:checked) { border-color: var(--forest); background: var(--forest-50); }
.opt:has(input:focus-visible) { outline: 3px solid var(--leaf); outline-offset: 2px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__mark {
  display: grid; place-items: center; width: 22px; height: 22px; flex: none;
  border: 2px solid var(--line-strong); background: #fff; color: transparent; transition: all 0.15s;
}
.opt__mark--radio { border-radius: 50%; }
.opt__mark--check { border-radius: 6px; }
.opt:has(input:checked) .opt__mark { background: var(--forest); border-color: var(--forest); color: #fff; }
.opt__mark--radio .icon { display: none; }
.opt:has(input:checked) .opt__mark--radio { box-shadow: inset 0 0 0 4px #fff; }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; background: var(--forest-50); border-radius: var(--r-pill); }
.stepper button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: var(--forest); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.stepper button:hover { background: var(--forest); color: #fff; }
.stepper span { min-width: 28px; text-align: center; font-weight: 800; font-family: var(--font-display); }

.dialog-card { width: min(92vw, 420px); margin: auto; padding: 28px 24px; text-align: center; display: grid; justify-items: center; gap: 10px; background: #fff; border-radius: var(--r-lg); animation: sheet-in 0.28s var(--ease); }
.overlay--center { align-items: center; padding: 16px; }
.dialog-card__icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--leaf-100); color: #1f6b1c; }
.dialog-card h3 { font-size: 1.35rem; }
.dialog-card p { color: var(--text-2); }
.dialog-card .btn { margin-top: 6px; width: 100%; }

/* ---------- Toast ---------- */
.toast-region { position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-h) + var(--safe-b) + 14px); z-index: 150; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; max-width: 460px; padding: 12px 16px;
  background: var(--forest-900); color: #fff; border-radius: var(--r-sm); font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); animation: toast-in 0.25s var(--ease);
}
.toast .icon { color: var(--leaf); }
.toast--error .icon { color: #ffb4ab; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Formularios ---------- */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 14px; }
.field > label, .field__label { font-weight: 700; font-size: 0.92rem; }
.field__hint { color: var(--text-3); font-size: 0.82rem; }
.input {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(87, 178, 83, 0.25); }
.input > .icon { color: var(--text-3); }
.input input, .input select, .input textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 12px 0; }
.input--area { align-items: flex-start; padding-block: 2px; }
.input textarea { resize: vertical; min-height: 84px; }
.input__toggle { display: grid; place-items: center; width: 36px; height: 36px; margin-right: -8px; border: 0; background: transparent; color: var(--text-3); border-radius: 50%; }
.input__toggle:hover { color: var(--forest); background: var(--forest-50); }
.field.error .input { border-color: var(--danger); background: #fffafa; }
.field__error { display: none; align-items: center; gap: 6px; color: var(--danger); font-size: 0.85rem; font-weight: 600; }
.field.error .field__error { display: flex; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.93rem; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--forest); flex: none; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i { height: 5px; border-radius: 3px; background: var(--line); transition: background-color 0.2s; }
.strength[data-level="1"] i:nth-child(-n + 1) { background: var(--danger); }
.strength[data-level="2"] i:nth-child(-n + 2) { background: #e0a100; }
.strength[data-level="3"] i:nth-child(-n + 3) { background: var(--leaf); }
.strength[data-level="4"] i { background: var(--forest); }
.strength-label { font-size: 0.82rem; color: var(--text-2); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); font-size: 0.92rem; }
.alert--info { background: var(--forest-50); color: var(--forest-900); }
.alert--ok { background: var(--leaf-100); color: #1d5a1a; }
.alert--warn { background: var(--warn-100); color: var(--warn); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--forest-50); border-radius: var(--r-sm); margin-bottom: 16px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--forest); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

/* ---------- Autenticación (pantalla inmersiva, mobile first) ---------- */
body.page-auth { padding-bottom: 0; background: var(--forest-900); }
.auth { display: flex; flex-direction: column; min-height: 100dvh; background: var(--forest-900); }

.auth__stage {
  position: relative; overflow: hidden; isolation: isolate; color: #fff; text-align: center;
  background:
    radial-gradient(90% 70% at 92% 4%, rgba(148, 71, 47, 0.30), transparent 60%),
    linear-gradient(175deg, #46704a 0%, var(--forest) 45%, var(--forest-700) 100%);
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 20px 78px;
}
.auth__stage::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0.16; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth__stage .ridge { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 1.4; }
.auth__scene { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; aspect-ratio: 800 / 420; z-index: -1; }
.auth__sun { transform-origin: 600px 168px; animation: sun-float 9s ease-in-out infinite alternate; }
@keyframes sun-float { from { transform: translateY(6px); } to { transform: translateY(-6px); } }

.auth__back {
  position: absolute; left: 14px; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 4;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #fff; backdrop-filter: blur(6px);
  transition: background-color 0.15s, transform 0.15s;
}
.auth__back:hover { background: rgba(255, 255, 255, 0.26); color: #fff; transform: translateX(-2px); }

.auth__brand { position: relative; z-index: 2; display: grid; justify-items: center; gap: 8px; padding-top: 18px; animation: rise 0.7s var(--ease) both; }
.auth__logo { width: min(230px, 62vw); height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28)); }
.auth__tagline { font-size: 0.92rem; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.82); }
.auth__pitch { display: none; }
.auth__stage.is-compact { padding-bottom: 64px; }
.auth__stage.is-compact .auth__logo { width: min(180px, 52vw); }
.auth__stage.is-compact .auth__tagline { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth__main { position: relative; z-index: 4; flex: 1; display: flex; margin-top: -34px; }
.auth__sheet {
  width: 100%; padding: 26px 20px calc(36px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-radius: 30px 30px 0 0; box-shadow: 0 -14px 40px rgba(15, 28, 17, 0.28);
  animation: sheet-up 0.6s var(--ease) 0.08s both;
}
@keyframes sheet-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.auth__sheet > * { max-width: 460px; margin-inline: auto; }
.auth__sheet form, .auth__sheet .auth-tabs, .auth__sheet .auth__alt, .auth__sheet .auth__guest, .auth__sheet .back-link { max-width: 460px; margin-inline: auto; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--forest-100); border-radius: 16px; }
.auth-tabs a { display: grid; place-items: center; min-height: 46px; border-radius: 12px; font-weight: 700; color: var(--forest-700); text-decoration: none; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }
.auth-tabs a:hover { color: var(--forest-900); }
.auth-tabs a.is-active { background: #fff; color: var(--forest-900); box-shadow: 0 2px 8px rgba(31, 51, 33, 0.14); }

.auth__title { font-size: clamp(1.7rem, 6vw, 2.15rem); font-weight: 800; margin-bottom: 4px; max-width: 460px; margin-inline: auto; }
.auth__lead { color: var(--text-2); margin: 0 auto 22px; max-width: 460px; }
.auth__alt { margin-top: 20px; text-align: center; color: var(--text-2); }
.auth__alt a { font-weight: 700; }
.auth__guest { display: block; margin-top: 10px; text-align: center; color: var(--text-3); font-size: 0.9rem; text-underline-offset: 4px; }
.field-row { display: grid; gap: 0 12px; }

/* Campos con etiqueta flotante */
.fl {
  position: relative; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 14px;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: 16px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.fl:hover { border-color: var(--forest); }
.fl:focus-within { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(87, 178, 83, 0.22); }
.fl > .icon { color: var(--text-3); transition: color 0.18s; }
.fl:focus-within > .icon { color: var(--forest); }
.fl input { flex: 1; min-width: 0; height: 100%; padding: 20px 0 4px; border: 0; outline: 0; background: transparent; font-size: 1rem; }
.fl label {
  position: absolute; left: 46px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-3);
  font-size: 1rem; transform-origin: left center; transition: transform 0.18s var(--ease), color 0.18s, top 0.18s var(--ease);
  white-space: nowrap; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;
}
.fl--plain label { left: 14px; max-width: calc(100% - 28px); }
.fl input:focus + label, .fl input:not(:placeholder-shown) + label { top: 19px; transform: translateY(-50%) scale(0.76); color: var(--forest-700); font-weight: 600; }
.fl input:-webkit-autofill + label { top: 19px; transform: translateY(-50%) scale(0.76); }
.fl__toggle { display: grid; place-items: center; width: 40px; height: 40px; margin-right: -8px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); }
.fl__toggle:hover { color: var(--forest); background: var(--forest-50); }
.field.error .fl { border-color: var(--danger); background: #fffafa; }
.field.error .fl label { color: var(--danger); }
.btn--xl { min-height: 58px; font-size: 1.05rem; border-radius: 16px; box-shadow: 0 10px 22px rgba(148, 71, 47, 0.28); }
.btn--xl.btn--ghost, .btn--xl.btn--danger { box-shadow: none; }
.btn--xl .icon { transition: transform 0.18s var(--ease); }
.btn--xl:hover .icon { transform: translateX(4px); }

/* ---------- Carrito / checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.checkout > *, .admin-grid > *, .field-row > * { min-width: 0; }
.cart-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; }
.cart-row img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-sm); }
.cart-row__name { font-weight: 700; }
.cart-row__desc { color: var(--text-2); font-size: 0.85rem; margin-top: 2px; }
.cart-row__side { display: grid; justify-items: end; gap: 8px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--clay); font-weight: 700; font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; }
.cart-row__total { font-family: var(--font-display); font-weight: 800; }
.cart-row--skeleton { grid-template-columns: 72px 1fr; }
.panel { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel h3 { font-size: 1.2rem; margin-bottom: 14px; }
.summary { position: static; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.summary__row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--text-2); }
.summary__row--total { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; }
.promo { display: flex; gap: 8px; margin-bottom: 8px; }
.promo .input { flex: 1; min-width: 0; }
.note { color: var(--text-2); font-size: 0.88rem; margin: 4px 0 10px; display: none; }
.note.is-visible { display: block; }
.note--ok { color: #1d5a1a; font-weight: 600; }
.pay { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.pay legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.pay-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.pay-option:has(input:checked) { border-color: var(--forest); background: var(--forest-50); }
.pay-option input { accent-color: var(--forest); width: 18px; height: 18px; }
.pay-option .icon { color: var(--forest); }
.mobile-cta { display: none; }

/* ---------- Pedidos (historial) ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.order { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 12px; overflow: hidden; }
.order--live { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(60, 95, 61, 0.1); }
.order__head { display: grid; gap: 10px; padding: 16px; }
.order__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.order__id { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.order__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 0.9rem; }
.order__meta span { display: inline-flex; align-items: center; gap: 6px; }
.order__summary { color: var(--text); }
.order__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--forest-50); }
.order__total { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.order__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order__detail { padding: 4px 16px 16px; border-top: 1px dashed var(--line-strong); display: grid; gap: 10px; }
.order__line { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; }
.order__line small { display: block; color: var(--text-2); }
.order__calc { display: grid; gap: 4px; padding-top: 10px; border-top: 1px dashed var(--line-strong); color: var(--text-2); font-size: 0.92rem; }
.order__calc div { display: flex; justify-content: space-between; }
.track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px 16px 18px; }
.track__step { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 0.78rem; color: var(--text-3); font-weight: 600; }
.track__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line); color: #fff; }
.track__step::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.track__step:first-child::before { display: none; }
.track__step.is-done { color: var(--forest); }
.track__step.is-done .track__dot, .track__step.is-now .track__dot { background: var(--forest); }
.track__step.is-done::before, .track__step.is-now::before { background: var(--forest); }
.track__step.is-now { color: var(--text); }
.track__step.is-now .track__dot { box-shadow: 0 0 0 5px rgba(87, 178, 83, 0.3); }
.demo-note { margin-bottom: 14px; }

/* ---------- Administración ---------- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.group-block { padding: 14px; margin-bottom: 12px; background: var(--forest-50); border: 1px solid var(--line); border-radius: var(--r-md); }
.group-block__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.group-block .input { min-height: 44px; background: #fff; }
.option-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.option-row .check { font-size: 0.85rem; white-space: nowrap; }
.image-picker { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; }
.image-picker img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm); background: var(--forest-50); }
.image-picker__inputs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.image-picker input[type="file"] { max-width: 100%; }
.image-picker input[type="file"] { font-size: 0.85rem; }
.admin-item { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px; margin-bottom: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.admin-item img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm); }
.admin-item h4 { font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-item__groups { color: var(--text-2); font-size: 0.85rem; margin: 4px 0 8px; }
.admin-item__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-pill); font-size: 0.72rem; font-weight: 700; background: var(--forest-100); color: var(--forest-700); }
.tag--custom { background: var(--clay-100); color: var(--clay-700); }
.save-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Footer ---------- */
.footer { position: relative; overflow: hidden; isolation: isolate; margin-top: 48px; background: var(--forest-900); color: rgba(255, 255, 255, 0.85); }
.footer__ridge { position: absolute; inset: 0; z-index: -1; opacity: 0.8; }
.footer__grid { display: grid; gap: 28px; padding-block: 40px 28px; }
.footer__brand { display: grid; gap: 14px; align-content: start; }
.footer__brand img { width: auto; max-width: 240px; height: 72px; }
.footer__brand p { max-width: 36ch; }
.footer__social { display: flex; gap: 10px; }
.footer__social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #fff; transition: background-color 0.15s; }
.footer__social a:hover { background: var(--clay); }
.footer__col { display: grid; gap: 10px; align-content: start; }
.footer__col h2 { font-size: 1rem; color: #fff; margin-bottom: 2px; }
.footer__col a, .footer__line { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.footer__col a:hover { color: #fff; text-decoration: underline; }
.footer__line { display: flex; align-items: flex-start; gap: 10px; }
.footer__line .icon { margin-top: 3px; color: var(--leaf); }
.footer__bar { border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.88rem; }
.footer__bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 16px; }
.footer__bar a { color: rgba(255, 255, 255, 0.8); display: inline-flex; align-items: center; gap: 6px; }
.footer--minimal { margin-top: 0; background: transparent; color: var(--text-2); border-top: 1px solid var(--line); }
.footer--minimal a { color: var(--forest); }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .container { padding-inline: 24px; }
  .dish-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .dish__desc { display: block; }
  .info-strip { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .chips { margin-inline: 0; padding-inline: 2px; flex-wrap: wrap; overflow: visible; }
  .recent { margin-inline: 0; padding-inline: 0; }
  .overlay { align-items: center; padding: 16px; }
  .sheet { border-radius: var(--r-lg); max-height: 90dvh; }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer__grid .footer__col:last-child { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid .footer__col:last-child h2 { grid-column: 1 / -1; }
}

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  :root { --topbar-h: 72px; }
  body { padding-bottom: 0; }
  .bottom-nav, .m-search { display: none; }
  .topbar__search {
    display: flex; align-items: center; gap: 10px; flex: 1; max-width: 460px; min-height: 46px; padding: 0 16px;
    background: var(--forest-50); border: 1.5px solid transparent; border-radius: var(--r-pill);
  }
  .topbar__search:focus-within { background: #fff; border-color: var(--forest); }
  .topbar__search .icon { color: var(--text-3); }
  .topbar__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
  .topbar__nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
  .topbar__link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); color: var(--text); font-weight: 600; text-decoration: none; }
  .topbar__link:hover { background: var(--forest-50); color: var(--forest); }
  .topbar__link.is-active { background: var(--forest-100); color: var(--forest-700); }
  .topbar__end { margin-left: 0; gap: 10px; }
  .cart-pill__total { display: inline; }
  .toast-region { bottom: 24px; }

  .hero__inner { grid-template-columns: 1.1fr 0.9fr; gap: 48px; padding-block: 56px; }
  .hero__media img { aspect-ratio: 5 / 4; }
  .hero { border-radius: 0 0 36px 36px; }
  .section { padding-top: 40px; }
  .dish-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .dish__body { padding: 14px; }

  body.page-auth { background: var(--bg); }
  .auth { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); background: var(--bg); }
  .auth__stage { text-align: left; padding: 56px 56px 0; display: flex; flex-direction: column; justify-content: space-between; min-height: 100dvh; }
  .auth__stage.is-compact { padding-bottom: 0; }
  .auth__stage.is-compact .auth__logo { width: 280px; }
  .auth__stage.is-compact .auth__tagline { display: block; }
  .auth__back { left: 28px; top: 28px; }
  .auth__brand { justify-items: start; padding-top: 44px; gap: 10px; }
  .auth__logo { width: 300px; }
  .auth__tagline { font-size: 1rem; }
  .auth__pitch { display: block; position: relative; z-index: 2; max-width: 460px; padding-bottom: 260px; animation: rise 0.8s var(--ease) 0.15s both; }
  .auth__pitch h2 { font-size: clamp(2.4rem, 3.6vw, 3.5rem); font-weight: 800; line-height: 1.04; text-wrap: balance; }
  .auth__pitch h2 em { font-style: normal; color: #f0b79f; }
  .auth__pitch > p { margin-top: 14px; color: rgba(255, 255, 255, 0.85); font-size: 1.08rem; max-width: 40ch; }
  .auth__points { list-style: none; display: grid; gap: 12px; padding: 0; margin: 26px 0 0; }
  .auth__points li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.92); }
  .auth__points .icon { color: #8fe08b; }
  .auth__main { margin-top: 0; align-items: center; justify-content: center; padding: 48px; }
  .auth__sheet { background: transparent; box-shadow: none; border-radius: 0; padding: 0; animation: rise 0.6s var(--ease) 0.1s both; max-width: 480px; }

  .checkout { grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; }
  .summary-col { position: sticky; top: calc(var(--topbar-h) + 20px); }
  .cart-row { grid-template-columns: 88px 1fr auto auto; padding: 16px; }
  .cart-row img { width: 88px; height: 88px; }
  .cart-row__side { display: contents; }
  .cart-row__total { min-width: 90px; text-align: right; }

  .order__head { grid-template-columns: 1fr auto; align-items: start; }
  .admin-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 28px; }
  .group-block__top { grid-template-columns: 1fr 160px auto auto; align-items: center; }
  .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1.3fr; }
  .footer__grid .footer__col:last-child { grid-column: auto; grid-template-columns: 1fr; }
}

@media (min-width: 1200px) {
  .dish-grid { gap: 24px; }
}
@media (min-width: 900px) {
  .recent { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .recent__item { width: auto; }
}

/* ---------- Móvil: barra de acción del checkout ---------- */
@media (max-width: 899px) {
  .mobile-cta {
    position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-h) + var(--safe-b)); z-index: 65;
    display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--line);
  }
  .mobile-cta__total { display: grid; line-height: 1.15; }
  .mobile-cta__total small { color: var(--text-2); font-size: 0.78rem; }
  .mobile-cta__total strong { font-family: var(--font-display); font-size: 1.2rem; }
  .mobile-cta .btn { flex: 1; }
  body.has-mobile-cta { padding-bottom: calc(var(--bottom-h) + var(--safe-b) + 76px); }
  body.has-mobile-cta .toast-region { bottom: calc(var(--bottom-h) + var(--safe-b) + 90px); }
  .desktop-submit { display: none; }
}

/* ---------- Preferencias de movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .sk::after { display: none; }
}

/* ---------- Cuenta ---------- */
.account-list { display: grid; gap: 0; margin: 0; }
.account-list > div { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.account-list > div:first-child { border-top: 0; padding-top: 0; }
.account-list dt { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.88rem; font-weight: 600; }
.account-list dd { margin: 0; font-weight: 600; word-break: break-word; }
@media (min-width: 640px) {
  .account-list > div { grid-template-columns: 180px 1fr; align-items: center; }
}

.btn--wrap { white-space: normal; text-align: center; min-height: 48px; height: auto; padding-block: 10px; }

/* ---------- Avatar + menú de usuario ---------- */
.avatar {
  --s: 36px; --a: var(--clay); --b: #c8714f;
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: linear-gradient(140deg, var(--a), var(--b));
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: calc(var(--s) * 0.46); line-height: 1;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px color-mix(in srgb, var(--a) 55%, transparent);
}
.avatar > span { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.avatar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.35), transparent 55%); pointer-events: none; }
.avatar--1 { --a: var(--forest); --b: var(--leaf); }
.avatar--2 { --a: #7a3924; --b: var(--clay); }
.avatar--3 { --a: var(--forest-700); --b: #6bbf66; }

.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 4px 12px 4px 5px;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  font-weight: 700; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(87, 178, 83, 0.2); }
.user-btn__name { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn__chev { color: var(--text-3); transition: transform 0.2s; }
.user-btn[aria-expanded="true"] .user-btn__chev { transform: rotate(180deg); }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 90; width: min(300px, calc(100vw - 24px)); padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 18px 44px rgba(31, 51, 33, 0.18); animation: pop-in 0.18s var(--ease); transform-origin: top right;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } to { opacity: 1; transform: none; } }
.user-pop__head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.user-pop__head div { display: grid; min-width: 0; }
.user-pop__head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); }
.user-pop__head span:not(.avatar) { color: var(--text-2); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pop a, .user-pop button[role="menuitem"] {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); font-weight: 600; text-decoration: none; text-align: left;
}
.user-pop a:hover, .user-pop button[role="menuitem"]:hover { background: var(--forest-50); color: var(--forest-700); }
.user-pop .icon { color: var(--forest); }
.user-pop__out { margin-top: 4px; color: var(--clay) !important; }
.user-pop__out .icon { color: var(--clay) !important; }
.user-pop__out:hover { background: var(--clay-100) !important; }
.bottom-nav__item .avatar { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px color-mix(in srgb, var(--a) 55%, transparent); }
.bottom-nav__item.is-active .avatar { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px var(--forest); }
@media (max-width: 380px) {
  .user-btn__name, .user-btn__chev { display: none; }
  .user-btn { padding-right: 5px; }
}
.field > label.check { font-weight: 500; font-size: 0.93rem; }

/* ---------- Navegador de días ---------- */
.daynav { display: grid; gap: 12px; margin-bottom: 18px; }
.daynav__bar {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 8px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 6px 20px rgba(31, 51, 33, 0.06);
}
.daynav__arrow {
  display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 16px;
  background: var(--forest-50); color: var(--forest); transition: background-color 0.15s, color 0.15s, transform 0.12s;
}
.daynav__arrow:hover:not([disabled]) { background: var(--forest); color: #fff; }
.daynav__arrow:active:not([disabled]) { transform: scale(0.94); }
.daynav__arrow[disabled] { opacity: 0.32; cursor: not-allowed; }
.daynav__title { display: grid; justify-items: center; gap: 3px; text-align: center; min-width: 0; }
.daynav__date { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--clay); }
.daynav__title h2 { font-size: clamp(1.45rem, 5.4vw, 2rem); font-weight: 800; line-height: 1.05; }
.daynav__status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 0.78rem; font-weight: 700; }
.daynav__status--ok { background: var(--leaf-100); color: #1d5a1a; }
.daynav__status--view { background: var(--warn-100); color: var(--warn); }

.daynav__week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.daynav__day {
  position: relative; display: grid; justify-items: center; gap: 1px; padding: 8px 0; border: 1.5px solid var(--line); border-radius: 16px;
  background: #fff; color: var(--text-2); transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.daynav__day span { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; }
.daynav__day b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--text); }
.daynav__day:hover { border-color: var(--forest); }
.daynav__day.is-today::after { content: ""; position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); }
.daynav__day.is-selected { background: var(--forest); border-color: var(--forest); color: rgba(255, 255, 255, 0.85); }
.daynav__day.is-selected b { color: #fff; }
.daynav__day.is-selected.is-today::after { background: #ffd2c2; }

/* Cambio de día */
@keyframes swap-in-next { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes swap-in-prev { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.dish-grid.swap-next { animation: swap-in-next 0.32s var(--ease); }
.dish-grid.swap-prev { animation: swap-in-prev 0.32s var(--ease); }

/* Menús solo para ver */
.dish--view { cursor: pointer; }
.dish--view .dish__media img { filter: saturate(0.82); }
.dish__peek { display: inline-flex; align-items: center; gap: 6px; color: var(--forest-700); font-size: 0.82rem; font-weight: 700; }
.dish:not(.dish--view):not(.dish--skeleton) { cursor: pointer; }
.sheet__note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-100); color: var(--warn); font-size: 0.9rem; font-weight: 600; }
.sheet__note[hidden] { display: none; }
.opt--static { cursor: default; }
.opt--static:hover { border-color: var(--line); }
.opt--static:has(input:checked):hover { border-color: var(--forest); }

@media (min-width: 900px) {
  .daynav { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: center; gap: 18px; }
  .daynav__bar { grid-template-columns: 60px minmax(0, 1fr) 60px; }
  .daynav__arrow { width: 60px; height: 60px; }
}

.cart-row--off img { filter: grayscale(1); opacity: 0.6; }
.cart-row--off .cart-row__name { color: var(--text-2); }

.days-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.days-pick__item { position: relative; cursor: pointer; }
.days-pick__item input { position: absolute; opacity: 0; pointer-events: none; }
.days-pick__item span { display: grid; place-items: center; min-width: 52px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; font-weight: 700; color: var(--text-2); transition: all 0.15s; }
.days-pick__item input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; }
.days-pick__item input:focus-visible + span { outline: 3px solid var(--leaf); outline-offset: 2px; }

.opt--off { opacity: 0.55; cursor: not-allowed; }
.opt--off .opt__mark { background: var(--line); }

/* ---- Instrucciones de transferencia ---- */
.transfer { display: grid; gap: 10px; padding: 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--forest-50); text-align: left; }
.transfer dl { margin: 0; display: grid; gap: 8px; }
.transfer dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.transfer dt { color: var(--text-2); font-size: 0.85rem; font-weight: 600; }
.transfer dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.transfer__code { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: 0.04em; color: var(--forest-900); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: #fff; color: var(--forest); font: inherit; font-weight: 700; font-size: 0.82rem; padding: 4px 10px; border-radius: var(--r-pill); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; }
.dialog-card .field { text-align: left; margin-bottom: 0; }
.dialog-card--wide { max-width: 460px; width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; }
.login-gate { display: grid; gap: 12px; }
.login-gate .btn { width: 100%; }
.saved-addr { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
