/* Tokens compartidos: cal, azulejo y albero */
:root {
  --brand: #1E3FA6;          /* azulejo (cada restaurante puede cambiarlo) */
  --albero: #E8B33C;         /* amarillo albero */
  --albero-soft: #FBF0D2;
  --cal: #FFFFFF;            /* blanco de cal */
  --bg: #F5F6F8;
  --ink: #16182A;
  --ink-2: #4A4D63;
  --ink-3: #8A8DA3;
  --line: #E3E5EC;
  --hoja: #2E7D57;           /* verde naranjo, etiquetas veganas */
  --danger: #C4362B;
  --surface: var(--cal);
  --tint: color-mix(in srgb, var(--brand) 8%, var(--cal));
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 26px;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow-float: 0 10px 30px -10px color-mix(in srgb, var(--ink) 45%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cal: #1A1A1D; --bg: #0F0F11; --ink: #F4F3F1; --ink-2: #B8B6B1; --ink-3: #85837E;
    --line: #2A2A2F; --albero-soft: #3A3220; --hoja: #5DC495; --danger: #FF7A6E;
    --tint: color-mix(in srgb, var(--brand) 22%, var(--cal));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cal: #1A1A1D; --bg: #0F0F11; --ink: #F4F3F1; --ink-2: #B8B6B1; --ink-3: #85837E;
  --line: #2A2A2F; --albero-soft: #3A3220; --hoja: #5DC495; --danger: #FF7A6E;
  --tint: color-mix(in srgb, var(--brand) 22%, var(--cal));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--albero); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fondo de marca: degradado suave del color del local */
.tiles {
  background-color: var(--brand);
  background-image:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--brand) 55%, #fff) 0%, transparent 60%),
    radial-gradient(90% 90% at 100% 100%, color-mix(in srgb, var(--brand) 55%, #000) 0%, transparent 70%);
}

/* Hoja inferior (bottom sheet) */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgb(10 12 25 / .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease-out;
}
.sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--cal); border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: rise .28s cubic-bezier(.2,.9,.25,1);
}
.sheet.full { max-height: 100dvh; height: 100dvh; border-radius: 0; }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.15; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--bg); font-size: 1.1rem;
}
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: var(--radius-l); max-height: 86dvh; }
  .sheet.full { height: auto; border-radius: var(--radius-l); }
}

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--cal); padding: 11px 18px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; transition: .25s; white-space: nowrap; max-width: 92vw;
  overflow: hidden; text-overflow: ellipsis;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
