:root {
  --crema: #FBF5DF;
  --crema-2: #F3E8BF;
  --linea: #E6D9A8;
  --verde: #1E4D36;
  --verde-2: #2C6A4B;
  --verde-claro: #E3EDD8;
  --negro: #1A1813;
  --gris: #5F5A4B;
  --fuego: #C8461A;
  --fuego-osc: #A3380F;
  --whatsapp: #1A7D43;
  --blanco: #FFFDF6;
  --radio: 14px;
  --sombra: 0 10px 30px rgb(26 24 19 / .18);
  --titulos: "Bricolage Grotesque", system-ui, sans-serif;
  --texto: "Figtree", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--crema);
  color: var(--negro);
  font: 16px/1.45 var(--texto);
  padding-bottom: 96px;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--titulos); margin: 0; line-height: 1.1; }
[hidden] { display: none !important; }

/* Cabecera */
.cabecera {
  background: var(--verde);
  color: var(--crema);
  padding: 22px 16px 18px;
  padding-top: max(22px, env(safe-area-inset-top));
}
.cabecera__fila { display: flex; gap: 14px; align-items: center; max-width: 608px; margin: 0 auto; }
.logo {
  flex: none;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--crema-2); color: var(--verde);
  font: 800 17px/1 var(--titulos); letter-spacing: .02em;
  border: 3px solid var(--fuego);
}
.logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cabecera__nombre { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.cabecera__bajada { margin: 2px 0 0; opacity: .85; }
.estado {
  max-width: 608px; margin: 14px auto 0;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.estado::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: #F2C94C;
}
.estado.abierto::before { background: #7BE08F; box-shadow: 0 0 0 4px rgb(123 224 143 / .25); }

.aviso-demo, .aviso-pausa {
  max-width: 640px; margin: 12px auto 0; padding: 10px 14px;
  border-radius: 10px; font-size: 14px;
}
.aviso-demo { background: var(--crema-2); border: 1px dashed var(--fuego); margin-inline: 16px; }
.aviso-pausa { background: var(--fuego); color: var(--blanco); font-weight: 600; margin-inline: 16px; }
@media (min-width: 672px) { .aviso-demo, .aviso-pausa { margin-inline: auto; } }

/* Categorías */
.categorias {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 16px;
  background: var(--crema);
  border-bottom: 1px solid var(--linea);
  scrollbar-width: none;
}
.categorias::-webkit-scrollbar { display: none; }
.categorias a {
  flex: none;
  padding: 7px 14px; border-radius: 999px;
  text-decoration: none; color: var(--verde); font-weight: 600; font-size: 15px;
  background: var(--blanco); border: 1px solid var(--linea);
}
.categorias a.activa { background: var(--verde); color: var(--crema); border-color: var(--verde); }

/* Carta */
.carta { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.cargando { padding: 40px 0; text-align: center; color: var(--gris); }
.seccion { scroll-margin-top: 64px; padding-top: 22px; }
.seccion h2 {
  font-size: 22px; font-weight: 800; color: var(--verde);
  padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 2px solid var(--verde);
}
.producto {
  display: flex; gap: 12px; align-items: center;
  width: 100%; padding: 14px 0;
  border: 0; border-bottom: 1px solid var(--linea);
  background: none; text-align: left; cursor: pointer;
}
.producto:last-child { border-bottom: 0; }
.producto__info { flex: 1; min-width: 0; }
.producto__nombre { display: block; font-weight: 700; font-size: 17px; }
.producto__desc { display: block; color: var(--gris); font-size: 14px; margin-top: 2px; }
.producto__precio { display: block; margin-top: 6px; font-weight: 700; color: var(--fuego-osc); }
.producto__desde { font-weight: 500; color: var(--gris); font-size: 13px; }
.producto__foto { flex: none; width: 84px; height: 84px; border-radius: 12px; object-fit: cover; }
.producto__mas {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fuego); color: var(--blanco);
  font-size: 24px; line-height: 1; font-weight: 600;
}
.producto__en-pedido {
  display: inline-block; margin-left: 6px; padding: 3px 9px; border-radius: 999px;
  background: var(--verde-claro); color: var(--verde); font-size: 12px; font-weight: 700; vertical-align: 2px;
}
.producto[disabled] { cursor: default; }
.producto[disabled] .producto__info { opacity: .5; }
.producto[disabled] .producto__mas { display: none; }
.agotado {
  flex: none; font-size: 13px; font-weight: 700; color: var(--gris);
  border: 1px solid var(--linea); border-radius: 999px; padding: 6px 12px; background: var(--blanco);
}
@media (hover: hover) {
  .producto:not([disabled]):hover .producto__mas { background: var(--fuego-osc); }
}

/* Pie */
.pie { max-width: 640px; margin: 32px auto 0; padding: 20px 16px; color: var(--gris); font-size: 14px; border-top: 1px solid var(--linea); }
.pie h3 { font-size: 16px; color: var(--negro); margin: 0 0 6px; }
.pie p { margin: 0 0 12px; }
.pie a { color: var(--verde); font-weight: 600; }
.pie__horarios { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0 0 12px; }
.pie__horarios dt { font-weight: 600; color: var(--negro); }
.pie__horarios dd { margin: 0; }
.pie__itm { font-size: 12px; opacity: .8; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 20px; border: 0; border-radius: 12px;
  font-weight: 700; font-size: 17px; cursor: pointer;
  transition: transform .12s ease, background-color .15s ease;
}
.boton:active { transform: scale(.98); }
.boton--ancho { width: 100%; justify-content: space-between; }
.boton--fuego { background: var(--fuego); color: var(--blanco); }
.boton--verde { background: var(--verde); color: var(--crema); justify-content: center; }
.boton--whatsapp { background: var(--whatsapp); color: #fff; justify-content: center; margin-top: 8px; }
.boton:disabled { opacity: .5; cursor: not-allowed; }
@media (hover: hover) {
  .boton--fuego:hover { background: var(--fuego-osc); }
  .boton--whatsapp:hover { background: #156836; }
}
.enlace {
  border: 0; background: none; padding: 8px 0; cursor: pointer;
  color: var(--verde); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
:focus-visible { outline: 3px solid var(--fuego); outline-offset: 2px; }

/* Barra inferior */
.barra-pedido {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--crema) 70%, rgb(251 245 223 / 0));
}
.barra-pedido .boton { max-width: 608px; margin: 0 auto; display: flex; box-shadow: var(--sombra); }
.barra-pedido__cant {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--blanco); color: var(--fuego-osc); font-size: 14px;
}

/* Hojas (diálogos) */
.hoja {
  width: 100%; max-width: 640px; max-height: 88vh;
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--blanco); color: var(--negro);
  box-shadow: var(--sombra);
}
.hoja--alta { max-height: 94vh; }
@supports (height: 1dvh) {
  .hoja { max-height: 88dvh; }
  .hoja--alta { max-height: 94dvh; }
}
.pedido__pie {
  position: sticky; bottom: 0;
  margin: 12px -16px 0; padding: 4px 16px 14px;
  background: var(--blanco);
  box-shadow: 0 -10px 16px -12px rgb(26 24 19 / .25);
}
.pedido__pie .boton { margin-top: 10px; }
.hoja::backdrop { background: rgb(26 24 19 / .45); }
.hoja[open] { animation: subir .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes subir { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hoja[open] { animation: none; } }
@media (min-width: 672px) { .hoja { margin: auto; border-radius: 20px; } }
.hoja__cuerpo { padding: 20px 16px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.hoja__cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hoja__cabeza h2 { font-size: 24px; font-weight: 800; padding-top: 4px; }
.hoja__desc { color: var(--gris); margin: 6px 0 4px; }
.cerrar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--crema-2); font-size: 24px; line-height: 1; cursor: pointer;
}
.hoja__pie {
  position: sticky; bottom: 0;
  display: flex; gap: 12px; align-items: center;
  padding-top: 14px; margin-top: 8px;
  background: var(--blanco);
}
.hoja__pie .boton { flex: 1; justify-content: space-between; }

/* Opciones */
.grupo { border: 0; padding: 0; margin: 18px 0 0; }
.grupo legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.grupo legend small { font-weight: 500; color: var(--gris); }
.opcion {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--crema-2); cursor: pointer;
}
.opcion:last-child { border-bottom: 0; }
.opcion input { width: 22px; height: 22px; margin: 0; accent-color: var(--verde); flex: none; }
.opcion span { flex: 1; }
.opcion em { font-style: normal; color: var(--gris); font-size: 15px; }

.contador {
  display: flex; align-items: center;
  border: 1px solid var(--linea); border-radius: 12px; height: 52px;
}
.contador button { width: 44px; height: 100%; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--verde); }
.contador output { min-width: 26px; text-align: center; font-weight: 700; }

/* Campos */
.campo { display: block; margin-top: 14px; }
.campo__etiqueta { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.opcional { font-weight: 400; color: var(--gris); }
input[type="text"], input[type="number"], select {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--linea); border-radius: 12px; background: var(--blanco);
  font-size: 16px;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--verde) 50%), linear-gradient(135deg, var(--verde) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus { border-color: var(--verde); }
.campo--error input, .campo--error select { border-color: var(--fuego); background: #FFF1EA; }
.ayuda { font-size: 14px; color: var(--gris); margin: 8px 0 0; }
.ayuda:empty { display: none; }
.ayuda--centro { text-align: center; }

/* Pedido */
.lineas { list-style: none; margin: 10px 0 0; padding: 0; }
.linea { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--crema-2); }
.linea__info { flex: 1; min-width: 0; }
.linea__nombre { font-weight: 700; }
.linea__detalle { color: var(--gris); font-size: 14px; }
.linea__precio { font-weight: 700; white-space: nowrap; }
.linea__acciones { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.linea__acciones button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--linea);
  background: var(--blanco); color: var(--verde); font-size: 18px; cursor: pointer;
}
.linea__acciones output { min-width: 24px; text-align: center; font-weight: 700; }

.bloque { border: 0; padding: 0; margin: 24px 0 0; }
.bloque legend { font: 800 19px/1.2 var(--titulos); color: var(--verde); padding: 0; margin-bottom: 10px; }
.segmentos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmentos label, .opciones-pago label { cursor: pointer; }
.segmentos input, .opciones-pago input { position: absolute; opacity: 0; pointer-events: none; }
.segmentos span, .opciones-pago span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 6px 10px; border-radius: 12px;
  border: 1.5px solid var(--linea); background: var(--blanco); font-weight: 600; font-size: 15px;
}
.segmentos input:checked + span, .opciones-pago input:checked + span {
  border-color: var(--verde); background: var(--verde-claro); color: var(--verde);
  box-shadow: inset 0 0 0 1px var(--verde);
}
.segmentos input:focus-visible + span, .opciones-pago input:focus-visible + span { outline: 3px solid var(--fuego); outline-offset: 2px; }
.opciones-pago { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.totales { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 24px 0 0; padding-top: 14px; border-top: 2px solid var(--verde); }
.totales dt { color: var(--gris); }
.totales dd { margin: 0; text-align: right; font-weight: 600; }
.totales .total { font: 800 22px/1.2 var(--titulos); color: var(--negro); }
.error { color: var(--fuego-osc); font-weight: 600; margin: 12px 0 0; }
.error:empty { display: none; }

.listo { text-align: center; }
.listo h2 { font-size: 26px; color: var(--verde); margin-bottom: 8px; }
.listo p { margin: 0 0 14px; }
.listo a { color: var(--verde); font-weight: 700; }

/* Celulares chicos (iPhone SE y similares) */
@media (max-width: 359px) {
  .boton { font-size: 16px; padding: 0 14px; }
  .cabecera__nombre { font-size: 25px; }
}
