/* FullMenu — base compartida: paleta de comida, tipografía, botones, hojas, animaciones */
:root {
  /* Paleta "de cocina" */
  --crema: #FFF8EF;        /* fondo: masa, pan */
  --crema-2: #FBEEDC;      /* fondo alterno */
  --papel: #FFFFFF;
  --tinta: #402419;        /* marrón del logo FullMenu */
  --tinta-2: #6E5B4E;      /* texto secundario */
  --tinta-3: #A08E80;      /* texto apagado */
  --linea: #EFE2D1;
  --linea-2: #E2D0BA;

  --tomate: #EA652D;       /* naranja del logo FullMenu */
  --tomate-d: #C9501D;
  --tomate-s: #FCE6DA;
  --azafran: #F2A33A;      /* acento / estrellas */
  --azafran-s: #FDF0D9;
  --albahaca: #3E8E5A;     /* verde: vegetariano, éxito */
  --albahaca-s: #E3F1E6;
  --berenjena: #5B3A55;    /* detalle oscuro */
  --chile: #C9302C;

  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --sombra-1: 0 1px 2px rgba(42,28,20,.06), 0 2px 8px rgba(42,28,20,.05);
  --sombra-2: 0 6px 24px rgba(42,28,20,.10), 0 2px 6px rgba(42,28,20,.06);
  --sombra-3: 0 24px 60px rgba(42,28,20,.22);

  --f-titulo: "Fraunces", Georgia, serif;
  --f-texto: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--crema); color: var(--tinta);
  font: 400 15px/1.5 var(--f-texto); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-titulo); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
p { margin: 0; }
.muted { color: var(--tinta-2); }
.tiny { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

svg.i { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }
svg.i.fill { fill: currentColor; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 600;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--tomate); color: #fff; box-shadow: 0 6px 16px rgba(226,85,45,.28); }
.btn-primary:hover { background: var(--tomate-d); }
.btn-dark { background: var(--tinta); color: #fff; }
.btn-ghost { background: var(--papel); border: 1px solid var(--linea-2); }
.btn-ghost:hover { border-color: var(--tinta-3); }
.btn-soft { background: var(--tomate-s); color: var(--tomate-d); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 19px; transition: transform .2s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.9); }

/* Chips / etiquetas */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--linea-2); background: var(--papel);
  font-size: 14px; font-weight: 500; white-space: nowrap; transition: all .2s var(--ease);
}
.chip.on { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--crema-2); color: var(--tinta-2); }
.tag.veg { background: var(--albahaca-s); color: var(--albahaca); }
.tag.hot { background: #FCE4E1; color: var(--chile); }
.tag.pop { background: var(--azafran-s); color: #A7650E; }
.tag.new { background: var(--tomate-s); color: var(--tomate-d); }
.tag.gf { background: #EEE7F3; color: var(--berenjena); }

/* Formularios */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--tinta-2); }
.input, .field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--linea-2); background: var(--papel); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 80px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--tomate); box-shadow: 0 0 0 4px var(--tomate-s); }

.seg { display: inline-flex; background: var(--crema-2); padding: 4px; border-radius: 999px; gap: 2px; position: relative; }
.seg button { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--tinta-2); transition: all .25s var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--papel); color: var(--tinta); box-shadow: var(--sombra-1); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--linea-2); border-radius: 999px; transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sombra-1); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--albahaca); }
.switch input:checked + span::after { transform: translateX(18px); }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--crema-2); border-radius: 999px; padding: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; background: var(--papel); display: grid; place-items: center; box-shadow: var(--sombra-1); }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; }

/* Estrellas */
.stars { display: inline-flex; gap: 2px; color: var(--azafran); }
.stars .off { color: var(--linea-2); }

/* Hoja inferior (bottom sheet) */
.scrim { position: fixed; inset: 0; background: rgba(42,28,20,.42); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 80; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  background: var(--crema); border-radius: 28px 28px 0 0; z-index: 90; display: flex; flex-direction: column;
  transform: translate(-50%, 105%); transition: transform .45s var(--ease); box-shadow: var(--sombra-3);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: var(--linea-2); margin: 10px auto 0; flex: none; }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(255,255,255,.9); box-shadow: var(--sombra-1); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet-pad { padding: 18px 20px 24px; }
.sheet-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); background: var(--papel); display: flex; gap: 12px; align-items: center; }
@media (min-width: 760px) {
  .sheet { bottom: 50%; border-radius: 28px; transform: translate(-50%, 60%) scale(.96); opacity: 0; transition: transform .45s var(--ease), opacity .3s; max-height: 86vh; }
  .sheet.open { transform: translate(-50%, 50%) scale(1); opacity: 1; }
  .sheet-handle { display: none; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -140%); z-index: 120;
  background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: 14px;
  display: flex; gap: 8px; align-items: center; box-shadow: var(--sombra-2); transition: transform .45s var(--spring), visibility .45s; max-width: calc(100% - 32px);
  visibility: hidden;
}
.toast.show { visibility: visible; }
.toast.show { transform: translate(-50%, 0); }

/* Animaciones */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.rise { opacity: 0; animation: rise .7s var(--ease) forwards; animation-delay: var(--d, 0s); }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.pop { animation: pop .45s var(--spring); }

.check-anim { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; background: var(--albahaca-s); display: grid; place-items: center; animation: pop .6s var(--spring); }
.check-anim svg { width: 44px; height: 44px; stroke: var(--albahaca); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.check-anim path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .6s .25s var(--ease) forwards; }

/* Imagen con respaldo (si la foto no carga, queda el degradado con emoji) */
.ph { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--azafran-s), var(--tomate-s)); }
.ph::before { content: attr(data-emoji); position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; }
.ph img { position: relative; width: 100%; height: 100%; object-fit: cover; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .rise, .reveal { opacity: 1; transform: none; }
}

/* Íconos de redes sociales */
.red-ic { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; flex: none; }
.red-ic svg { width: 21px; height: 21px; }

/* Página pública y POS de un comercio real: cortina mientras llegan los datos, y avisos (página no existe, POS no activo…) */
html.fm-cargando body::before { content: ''; position: fixed; inset: 0; z-index: 9999; background: var(--crema); }
html.fm-cargando body::after { content: ''; position: fixed; z-index: 10000; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 3px solid var(--linea, #EFE2D1); border-top-color: var(--tomate, #EA652D); animation: fm-gira .8s linear infinite; }
@keyframes fm-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html.fm-cargando body::after { animation-duration: 2.4s; } }
.fm-aviso { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 32px 22px; text-align: center; background: var(--crema); }
.fm-aviso > span { font-size: 54px; line-height: 1; }
.fm-aviso h1 { font-size: 26px; }
.fm-aviso p { color: var(--tinta-2); max-width: 380px; }
.fm-aviso .btn { margin-top: 4px; }
.fm-aviso-pie { margin-top: 26px; opacity: .8; }
.fm-aviso-pie img { height: 26px; width: auto; }
