/* ==========================================================================
   La Cucharita · estilos (mobile-first)
   Para cambiar colores, edita las variables de :root.
   ========================================================================== */
:root {
  --crema: #FFF8F1;
  --rosa-palo: #F6C9C9;
  --rosa: #E07A8B;          /* botones */
  --rosa-oscuro: #C75A6E;   /* hover / texto sobre claro */
  --cafe: #4A2C2A;          /* textos */
  --cafe-suave: #7A5A57;
  --blanco: #FFFFFF;
  --verde: #2E8B57;
  --rojo: #C0392B;
  --sombra: 0 4px 14px rgba(74, 44, 42, .12);
  --radio: 16px;
  --barra-alto: 112px;      /* alto aprox. de la barra sticky (categorías + buscador) */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--crema); color: var(--cafe);
  font-family: 'Poppins', system-ui, sans-serif; font-size: 16px; line-height: 1.45;
  padding-bottom: 90px; /* espacio para la barra flotante */
}
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; margin: 0; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--rosa-oscuro); outline-offset: 2px; }

/* ---------- Encabezado ---------- */
.encabezado {
  background: linear-gradient(180deg, var(--rosa-palo), var(--crema));
  text-align: center; padding: 24px 16px 18px;
}
.encabezado__logo { margin: 0 auto 8px; border-radius: 50%; background: var(--crema); box-shadow: var(--sombra); }
.encabezado__nombre { font-size: 1.9rem; line-height: 1.15; }
.encabezado__eslogan { margin: 6px 0 10px; color: var(--cafe-suave); }
.encabezado__horario { margin: 0; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.estado { font-weight: 600; font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--blanco); }
.estado--abierto { color: var(--verde); }
.estado--abierto::before { content: '● '; }
.estado--cerrado { color: var(--rojo); }
.estado--cerrado::before { content: '● '; }

/* ---------- Barra sticky: categorías + buscador ---------- */
.barra { position: sticky; top: 0; z-index: 20; background: var(--crema); box-shadow: 0 2px 8px rgba(74,44,42,.08); padding: 8px 0 8px; }
.categorias { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 8px; scrollbar-width: none; }
.categorias::-webkit-scrollbar { display: none; }
.categorias a {
  flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px;
  border-radius: 999px; background: var(--blanco); border: 2px solid var(--rosa-palo);
  color: var(--cafe); text-decoration: none; font-weight: 500; font-size: .9rem; white-space: nowrap;
}
.categorias a.activa { background: var(--rosa); border-color: var(--rosa); color: var(--blanco); }
.buscador { padding: 0 16px; }
.buscador input {
  width: 100%; min-height: 44px; border: 2px solid var(--rosa-palo); border-radius: 999px;
  padding: 0 16px; background: var(--blanco);
}

/* ---------- Menú ---------- */
.menu { max-width: 1100px; margin: 0 auto; padding: 8px 16px 24px; }
.seccion { scroll-margin-top: var(--barra-alto); padding-top: 16px; }
.seccion__titulo { font-size: 1.5rem; margin-bottom: 4px; }
.seccion__nota { margin: 0 0 8px; color: var(--cafe-suave); font-size: .85rem; }
.rejilla { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 10px; }
.vacio { text-align: center; padding: 30px 0; color: var(--cafe-suave); }

.tarjeta {
  background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s;
}
.tarjeta--pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.03); } }
.tarjeta__foto { position: relative; aspect-ratio: 1 / 1; background: var(--rosa-palo); }
.tarjeta__foto img { width: 100%; height: 100%; object-fit: cover; }
.placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 4rem; background: linear-gradient(135deg, #FBE0E0, var(--rosa-palo));
}
.etiqueta-prod {
  position: absolute; top: 10px; left: 10px; font-size: .75rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: var(--cafe); color: var(--crema);
}
.etiqueta-prod--agotado { background: var(--rojo); left: auto; right: 10px; }
.tarjeta__cuerpo { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tarjeta__nombre { font-size: 1.15rem; }
.tarjeta__desc { margin: 0; font-size: .88rem; color: var(--cafe-suave); flex: 1; }
.tarjeta__precio { font-size: 1.6rem; font-weight: 600; color: var(--rosa-oscuro); font-family: 'Playfair Display', serif; }
.tarjeta--agotada .tarjeta__foto img { filter: grayscale(.8); opacity: .7; }

.variantes { display: flex; gap: 8px; }
.variante {
  flex: 1; min-height: 44px; border-radius: 12px; border: 2px solid var(--rosa-palo);
  background: var(--blanco); font-weight: 500;
}
.variante[aria-pressed="true"] { background: var(--rosa-palo); border-color: var(--rosa); font-weight: 600; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  padding: 0 20px; border: 0; border-radius: 999px; background: var(--rosa); color: var(--blanco);
  font-weight: 600; text-decoration: none; text-align: center; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--rosa-oscuro); }
.btn:active { transform: scale(.97); }
.btn:disabled { background: #CFC3C0; cursor: not-allowed; }
.btn--wa { background: #1FA855; }
.btn--wa:hover { background: #178443; }
.btn--grande { width: 100%; min-height: 52px; font-size: 1.05rem; margin-top: 10px; }
.btn--suave { background: var(--rosa-palo); color: var(--cafe); }
.btn--suave:hover { background: #EDB5B5; }
.btn--peligro { background: var(--rojo); }
.btn--mini { min-height: 44px; padding: 0 14px; font-size: .85rem; }

.selector { display: flex; align-items: center; justify-content: space-between; min-height: 44px; background: var(--rosa-palo); border-radius: 999px; padding: 0 4px; }
.selector button {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--rosa); color: var(--blanco);
  font-size: 1.4rem; font-weight: 600; line-height: 1;
}
.selector span { font-weight: 600; font-size: 1.1rem; }

/* ---------- Barra flotante del carrito ---------- */
.barra-carrito {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; max-width: 560px; margin: 0 auto;
  min-height: 56px; border: 0; border-radius: 999px; background: var(--cafe); color: var(--crema);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); font-size: .95rem;
}
.barra-carrito strong { color: var(--rosa-palo); }
.barra-carrito--rebote { animation: rebote .4s ease; }
@keyframes rebote { 40% { transform: translateY(-8px) scale(1.03); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); z-index: 60;
  background: var(--cafe); color: var(--crema); padding: 10px 20px; border-radius: 999px;
  font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap;
}
.toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Drawer ---------- */
.fondo { position: fixed; inset: 0; background: rgba(74,44,42,.55); z-index: 40; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-width: 640px; margin: 0 auto;
  max-height: 92vh; background: var(--crema); border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0,0,0,.25);
  animation: sube .3s ease;
}
@keyframes sube { from { transform: translateY(100%); } }
.drawer__cabecera { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--rosa-palo); }
.drawer__cabecera h2 { font-size: 1.4rem; }
.icono { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--rosa-palo); font-size: 1.1rem; }
.drawer__cuerpo { overflow-y: auto; padding: 14px 18px 24px; -webkit-overflow-scrolling: touch; }

.lineas { list-style: none; margin: 0; padding: 0; }
.linea { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px dashed var(--rosa-palo); align-items: center; }
.linea__nombre { font-weight: 500; }
.linea__extra { font-size: .8rem; color: var(--cafe-suave); display: block; }
.linea__sub { font-weight: 600; text-align: right; }
.linea__ctrl { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; justify-content: space-between; }
.linea__ctrl .selector { width: 140px; }
.linea__quitar { background: none; border: 0; color: var(--rojo); min-height: 44px; padding: 0 8px; font-size: .85rem; text-decoration: underline; }

.totales { margin: 14px 0 0; }
.totales div { display: flex; justify-content: space-between; padding: 4px 0; }
.totales dt, .totales dd { margin: 0; }
.totales__total { font-size: 1.2rem; font-weight: 600; border-top: 2px solid var(--rosa-palo); margin-top: 6px; padding-top: 8px !important; }
.aviso { background: #FFF1CC; border-radius: 12px; padding: 10px 14px; font-size: .88rem; margin: 12px 0 0; }
.vaciar { margin: 10px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vaciar__confirma { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.enlace { background: none; border: 0; color: var(--cafe-suave); text-decoration: underline; min-height: 44px; padding: 0 4px; }

/* ---------- Formulario ---------- */
.form { margin-top: 14px; border-top: 2px solid var(--rosa-palo); padding-top: 14px; }
.form h3 { font-size: 1.25rem; margin-bottom: 8px; }
.campo { margin-bottom: 14px; }
.campo label, .etiqueta { display: block; font-weight: 500; margin-bottom: 6px; font-size: .92rem; }
.campo input[type="text"], .campo input[type="datetime-local"], .campo textarea {
  width: 100%; min-height: 44px; border: 2px solid var(--rosa-palo); border-radius: 12px; padding: 10px 14px; background: var(--blanco);
}
.campo textarea { resize: vertical; }
.campo__ayuda { margin: 4px 0 0; font-size: .78rem; color: var(--cafe-suave); }
.campo__error { margin: 4px 0 0; font-size: .82rem; color: var(--rojo); font-weight: 500; display: none; }
.campo--error input[type="text"], .campo--error input[type="datetime-local"], .campo--error textarea { border-color: var(--rojo); background: #FFF3F1; }
.campo--error .pastilla span { border-color: var(--rojo); }
.campo--error .campo__error { display: block; }

.pastillas { display: flex; gap: 8px; }
.pastilla { flex: 1; margin: 0 !important; }
.pastilla input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pastilla span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border: 2px solid var(--rosa-palo);
  border-radius: 999px; background: var(--blanco); font-weight: 500; cursor: pointer; text-align: center; padding: 0 8px;
}
.pastilla input:checked + span { background: var(--rosa); border-color: var(--rosa); color: var(--blanco); }
.pastilla input:focus-visible + span { outline: 3px solid var(--rosa-oscuro); outline-offset: 2px; }

/* ---------- Pantalla de listo ---------- */
.listo { text-align: center; padding-top: 28px; }
.listo__emoji { font-size: 3.5rem; }
.listo h3 { font-size: 1.8rem; margin: 6px 0; }
.listo__pedido { font-weight: 600; color: var(--rosa-oscuro); }

/* ---------- Pie ---------- */
.pie { background: var(--cafe); color: var(--crema); text-align: center; padding: 28px 16px 24px; }
.pie p { margin: 0 0 8px; }
.pie__info { font-size: .85rem; opacity: .85; }
.pie .btn { margin: 10px 0 14px; }
.pie__creditos { font-size: .75rem; opacity: .7; }

/* ---------- Pantallas más grandes ---------- */
@media (min-width: 640px) {
  .rejilla { grid-template-columns: repeat(2, 1fr); }
  .barra { display: flex; align-items: center; gap: 12px; padding: 8px 16px; justify-content: center; }
  .categorias { padding: 0; overflow-x: visible; }
  .buscador { padding: 0; width: 240px; }
  :root { --barra-alto: 80px; }
}
@media (min-width: 1024px) {
  .rejilla { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .encabezado__nombre { font-size: 2.4rem; }
  .drawer { bottom: 20px; border-radius: 24px; }
  .toast { bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
