/* Birria Los Carnales · app de pedidos
   Tokens de marca (marca/identidad.md). Contraste revisado: texto normal >= 4.5:1. */
:root {
  --vino: #6E1E2E;
  --vino-oscuro: #4F1421;
  --chile: #A62C2B;
  --chile-oscuro: #86211F;
  --tortilla: #EBB647;
  --tortilla-suave: #F8E3B0;
  --comal: #1E1E1E;
  --crema: #F5EBDD;
  --hueso: #FFF8EF;
  --texto-suave: #5A5148;
  --borde: #E4D3BD;
  --limon: #96883C;
  --verde: #12804A;
  --verde-oscuro: #0E6A3D;
  --error: #A62C2B;

  --radio: 18px;
  --radio-chico: 12px;
  --sombra: 0 1px 2px rgb(30 30 30 / .06), 0 6px 18px rgb(110 30 46 / .08);
  --sombra-alta: 0 -8px 30px rgb(30 30 30 / .18);
  --rapido: 160ms;
  --medio: 260ms;
  --curva: cubic-bezier(.2, .8, .2, 1);
  --alto-barra: 72px;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; scroll-padding-bottom: 110px; }
body {
  margin: 0;
  background: var(--crema);
  color: var(--comal);
  font: 400 16px/1.5 Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.sin-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--vino); }
:focus-visible { outline: 3px solid var(--tortilla); outline-offset: 2px; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-relleno { fill: currentColor; stroke: none; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.titulo { font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif; font-weight: 400; letter-spacing: .02em; line-height: 1; margin: 0; }

/* ---------- Cabecera ---------- */
.hero {
  position: relative;
  background: var(--vino);
  color: var(--hueso);
  padding: 18px 16px 22px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: auto -40px -60px auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgb(235 182 71 / .28), transparent 70%);
  pointer-events: none;
}
.hero-fila { display: flex; align-items: center; gap: 14px; max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }
.hero-logo { width: 74px; height: 74px; object-fit: contain; background: var(--hueso); border-radius: 50%; padding: 6px; flex: none; }
.hero h1 { font-size: 34px; }
.hero-datos { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.hero-datos span { display: inline-flex; align-items: center; gap: 4px; }
.hero-datos .i { width: 16px; height: 16px; }
.estrella { color: var(--tortilla); }
.chip-estado {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 14px auto 0; padding: 8px 14px; border-radius: 999px;
  background: rgb(255 248 239 / .14); font-size: 14px; font-weight: 700;
  position: relative; z-index: 1;
}
.chip-estado::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 4px rgb(61 220 132 / .25); }
.chip-estado.cerrado::before, .chip-estado.agotado::before { background: var(--tortilla); box-shadow: 0 0 0 4px rgb(235 182 71 / .25); }
.hero-estado { max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }

main { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--alto-barra) + 32px + var(--seguro-abajo)); }

/* ---------- Combo del anuncio ---------- */
.combo {
  margin: 16px 0 4px; background: var(--hueso); border-radius: var(--radio);
  box-shadow: var(--sombra); overflow: hidden; border: 3px solid var(--tortilla);
}
.combo-foto { position: relative; aspect-ratio: 16 / 10; background: var(--vino); }
.combo-foto img { width: 100%; height: 100%; object-fit: cover; }
.combo-sello {
  position: absolute; top: 12px; left: 12px; background: var(--chile); color: var(--hueso);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 6px 10px; border-radius: 999px;
}
.combo-cuerpo { padding: 14px 16px 16px; }
.combo-cuerpo h2 { font-size: 36px; color: var(--vino); }
.combo-cuerpo p { margin: 4px 0 0; }
.combo-precios { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.combo-precio { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 44px; color: var(--chile); line-height: 1; }
.combo-antes { text-decoration: line-through; color: var(--texto-suave); font-weight: 600; }
.combo-ahorro { background: var(--tortilla-suave); color: var(--vino-oscuro); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }

/* ---------- Pedir lo de siempre ---------- */
.repetir { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; padding: 14px; border-radius: var(--radio); background: var(--hueso); border: 2px solid var(--vino); box-shadow: var(--sombra); }
.repetir > div { flex: 1; min-width: 0; }
.repetir h2 { font-size: 26px; color: var(--vino); }
.repetir p { margin: 2px 0 0; font-size: 14px; color: var(--texto-suave); }
.repetir .agregar { white-space: nowrap; }

/* ---------- Categorías ---------- */
.categorias {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto;
  margin: 0 -16px; padding: 12px 16px; background: var(--crema);
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.categorias::-webkit-scrollbar { display: none; }
.categorias a {
  flex: none; scroll-snap-align: start; text-decoration: none; color: var(--vino);
  background: var(--hueso); border: 2px solid var(--borde); border-radius: 999px;
  padding: 8px 14px; font-weight: 700; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center;
  transition: background var(--rapido), color var(--rapido), border-color var(--rapido);
}
.categorias a.activa { background: var(--vino); color: var(--hueso); border-color: var(--vino); }
.categoria { scroll-margin-top: 72px; }
.categoria h2 { font-size: 30px; color: var(--vino); margin: 18px 0 10px; }

/* ---------- Productos ---------- */
.producto {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: stretch;
  background: var(--hueso); border-radius: var(--radio); padding: 12px; margin-bottom: 10px; box-shadow: var(--sombra);
}
.producto-foto { width: 96px; height: 96px; border-radius: var(--radio-chico); object-fit: cover; background: var(--vino); }
.producto-sinfoto {
  width: 96px; height: 96px; border-radius: var(--radio-chico); display: grid; place-items: center;
  background: var(--vino); color: var(--tortilla);
  background-image: radial-gradient(circle at 30% 20%, rgb(235 182 71 / .25), transparent 60%);
}
.producto-sinfoto .i { width: 38px; height: 38px; stroke-width: 1.6; }
.producto-info { display: flex; flex-direction: column; min-width: 0; }
.producto-info h3 { font-size: 24px; }
.producto-desc { margin: 4px 0 0; font-size: 14px; color: var(--texto-suave); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.producto-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.precio { font-weight: 700; font-size: 18px; }
.porcion { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--vino); background: var(--tortilla-suave); border-radius: 999px; padding: 2px 8px; align-self: flex-start; }
.insignia { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--chile); margin-bottom: 2px; }
.insignia .i { width: 14px; height: 14px; }

/* Botón agregar / contador */
.agregar {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--chile); color: var(--hueso); font-weight: 700;
  transition: transform var(--rapido) var(--curva), background var(--rapido);
}
.agregar:active { transform: scale(.94); }
.agregar:hover { background: var(--chile-oscuro); }
.contador { display: inline-flex; align-items: center; background: var(--vino); color: var(--hueso); border-radius: 999px; height: 44px; }
.contador button { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; border-radius: 999px; }
.contador button:active { background: rgb(255 255 255 / .12); }
.contador output { min-width: 22px; text-align: center; font-weight: 700; }

/* ---------- Barra del carrito ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 16px calc(12px + var(--seguro-abajo));
  background: linear-gradient(to top, var(--crema) 70%, rgb(245 235 221 / 0));
  transform: translateY(0); transition: transform var(--medio) var(--curva);
}
.barra[hidden] { display: block !important; transform: translateY(120%); pointer-events: none; }
.barra button {
  width: 100%; max-width: 608px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 18px; border: 0; border-radius: var(--radio);
  background: var(--vino); color: var(--hueso); font-weight: 700; font-size: 17px; box-shadow: var(--sombra-alta);
}
.barra .cuenta { min-width: 28px; height: 28px; border-radius: 999px; background: var(--tortilla); color: var(--comal); display: grid; place-items: center; font-size: 14px; }
.barra .total { margin-left: auto; }

/* ---------- Hoja del pedido ---------- */
.hoja {
  position: fixed; inset: 0; z-index: 30; background: var(--crema);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform var(--medio) var(--curva); visibility: hidden;
}
.hoja.abierta { transform: none; visibility: visible; }
.hoja-cabeza {
  display: flex; align-items: center; gap: 8px; padding: 10px 8px; background: var(--vino); color: var(--hueso);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}
.hoja-cabeza button { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; border-radius: 999px; }
.hoja-cabeza h2 { font-size: 28px; flex: 1; }
.pasos { display: flex; gap: 6px; padding: 0 16px; background: var(--vino); padding-bottom: 12px; }
.pasos span { flex: 1; height: 5px; border-radius: 999px; background: rgb(255 248 239 / .25); }
.pasos span.hecho { background: var(--tortilla); }
.hoja-cuerpo { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 24px; }
.hoja-cuerpo > div { max-width: 608px; margin: 0 auto; }
.hoja-pie { padding: 12px 16px calc(12px + var(--seguro-abajo)); background: var(--hueso); box-shadow: var(--sombra-alta); }
.hoja-pie > * { max-width: 608px; margin-left: auto; margin-right: auto; }

.linea { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.linea img, .linea .producto-sinfoto { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.linea .producto-sinfoto .i { width: 24px; height: 24px; }
.linea-nombre { flex: 1; min-width: 0; font-weight: 600; }
.linea-nombre small { display: block; color: var(--texto-suave); font-weight: 600; }

.meta-envio { margin: 16px 0 4px; background: var(--hueso); border-radius: var(--radio-chico); padding: 12px 14px; font-size: 14px; font-weight: 600; }
.meta-envio .riel { height: 8px; border-radius: 999px; background: var(--borde); margin-top: 8px; overflow: hidden; }
.meta-envio .avance { height: 100%; background: var(--limon); border-radius: inherit; transition: width var(--medio) var(--curva); }
.meta-envio.lograda { color: var(--verde-oscuro); }
.meta-envio.lograda .avance { background: var(--verde); }

.antojo h3 { font-size: 24px; color: var(--vino); margin: 20px 0 8px; }
.antojo-fila { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.antojo-fila::-webkit-scrollbar { display: none; }
.antojo-item { flex: 0 0 148px; background: var(--hueso); border-radius: var(--radio-chico); padding: 10px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 8px; }
.antojo-item img, .antojo-item .producto-sinfoto { width: 100%; height: 84px; border-radius: 10px; object-fit: cover; }
.antojo-item strong { font-size: 14px; line-height: 1.25; }
.antojo-item .agregar { height: 40px; min-width: 0; width: 100%; font-size: 14px; }

/* Formulario */
.bloque { margin-top: 20px; }
.bloque > .titulo { font-size: 24px; color: var(--vino); margin-bottom: 10px; }
.campo { display: block; margin-top: 12px; }
.campo span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.campo input, .campo textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 2px solid var(--borde); border-radius: var(--radio-chico);
  background: #fff; font-size: 16px; transition: border-color var(--rapido);
}
.campo input:focus, .campo textarea:focus { border-color: var(--vino); outline: none; box-shadow: 0 0 0 3px rgb(110 30 46 / .15); }
.campo input[aria-invalid="true"] { border-color: var(--error); }
.campo .ayuda { font-size: 13px; color: var(--texto-suave); margin-top: 4px; }
.campo .mal { font-size: 13px; color: var(--error); font-weight: 700; margin-top: 4px; }

.opciones { display: grid; gap: 10px; }
.opcion { position: relative; display: flex; gap: 12px; align-items: center; background: var(--hueso); border: 2px solid var(--borde); border-radius: var(--radio-chico); padding: 12px 14px; min-height: 64px; cursor: pointer; transition: border-color var(--rapido), background var(--rapido); }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion .icono { width: 42px; height: 42px; border-radius: 12px; background: var(--crema); color: var(--vino); display: grid; place-items: center; flex: none; }
.opcion strong { display: block; }
.opcion small { display: block; color: var(--texto-suave); font-size: 13px; font-weight: 600; }
.opcion:has(input:checked) { border-color: var(--vino); background: #fff; box-shadow: 0 0 0 3px rgb(110 30 46 / .12); }
.opcion:has(input:checked) .icono { background: var(--vino); color: var(--hueso); }
.opcion:has(input:focus-visible) { outline: 3px solid var(--tortilla); outline-offset: 2px; }

.turnos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.turnos::-webkit-scrollbar { display: none; }
.turno { flex: none; }
.turno input { position: absolute; opacity: 0; pointer-events: none; }
.turno span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--borde); background: var(--hueso); font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer; }
.turno input:checked + span { background: var(--vino); color: var(--hueso); border-color: var(--vino); }
.turno input:focus-visible + span { outline: 3px solid var(--tortilla); outline-offset: 2px; }

.boton-ubicacion { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--vino); background: transparent; color: var(--vino); font-weight: 700; }

.resumen { background: var(--hueso); border-radius: var(--radio-chico); padding: 12px 14px; margin-top: 20px; }
.resumen div { display: flex; justify-content: space-between; padding: 3px 0; }
.resumen .total { border-top: 2px solid var(--vino); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 20px; }
.gratis { color: var(--verde-oscuro); font-weight: 700; }

.alarma { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: var(--chile); animation: alarma-parpadeo .8s steps(2, jump-none) infinite; }
@keyframes alarma-parpadeo { 50% { background: var(--tortilla); } }
@media (prefers-reduced-motion: reduce) { .alarma { animation: none; } }
.alarma-caja { background: var(--hueso); border-radius: var(--radio); padding: 28px 22px; text-align: center; width: 100%; max-width: 420px; box-shadow: 0 10px 40px rgb(30 30 30 / .35); }
.alarma-titulo { font-size: 46px; color: var(--vino); margin: 0; }
.alarma-folios { font-size: 22px; font-weight: 800; margin: 8px 0 18px; color: var(--comal); }
.alarma-boton { width: 100%; min-height: 64px; border: 0; border-radius: var(--radio-chico); background: var(--verde); color: #fff; font: inherit; font-size: 22px; font-weight: 800; cursor: pointer; }
.aviso-boton { display: block; width: 100%; text-align: left; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.aviso-error { background: #FBE4E2; color: var(--chile-oscuro); border-radius: var(--radio-chico); padding: 12px 14px; font-weight: 700; margin-bottom: 10px; }
.confianza { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--texto-suave); margin-top: 8px; text-align: center; }
.confianza .i { width: 16px; height: 16px; color: var(--verde-oscuro); }

.principal {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px;
  border: 0; border-radius: var(--radio); background: var(--chile); color: var(--hueso);
  font-weight: 700; font-size: 17px; text-decoration: none; padding: 0 18px;
  transition: background var(--rapido), transform var(--rapido) var(--curva);
}
.principal:hover { background: var(--chile-oscuro); }
.principal:active { transform: scale(.98); }
.principal:disabled { opacity: .65; cursor: progress; }
.principal.whatsapp { background: var(--verde); }
.principal.whatsapp:hover { background: var(--verde-oscuro); }
.secundario { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--radio-chico); border: 2px solid var(--vino); background: var(--hueso); color: var(--vino); font-weight: 700; text-decoration: none; }
.girando { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .4); border-top-color: #fff; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Listo */
.pantalla-listo { position: fixed; inset: 0; z-index: 40; background: var(--vino); color: var(--hueso); display: grid; place-items: center; padding: 24px; text-align: center; }
.listo-caja { max-width: 420px; }
.listo-check { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: var(--tortilla); color: var(--comal); display: grid; place-items: center; }
.listo-check .i { width: 46px; height: 46px; stroke-width: 3; }
.pantalla-listo h2 { font-size: 46px; }
.pantalla-listo .folio { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 34px; color: var(--tortilla); margin: 6px 0 12px; }
.pantalla-listo p { margin: 0 0 20px; }

.letra-chica { font-size: 13px; color: var(--texto-suave); }
.pie-pagina { text-align: center; padding: 24px 16px; font-size: 13px; color: var(--texto-suave); }
.cargando { text-align: center; color: var(--texto-suave); padding: 40px 0; }

/* ---------- Panel ---------- */
.panel-cabeza { position: sticky; top: 0; z-index: 10; background: var(--vino); color: var(--hueso); padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.panel-cabeza > div { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.panel-cabeza h1 { font-size: 32px; flex: 1; }
.en-vivo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.en-vivo::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3DDC84; }
.en-vivo.caido::before { background: var(--tortilla); }
.boton-redondo { width: 44px; height: 44px; border-radius: 999px; border: 0; display: grid; place-items: center; background: rgb(255 248 239 / .14); color: var(--hueso); }
.boton-redondo.activo { background: var(--tortilla); color: var(--comal); }
.panel { max-width: 900px; margin: 0 auto; padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--hueso); border-radius: var(--radio-chico); padding: 12px; box-shadow: var(--sombra); }
.tile small { display: block; font-size: 12px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; }
.tile strong { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 34px; font-weight: 400; line-height: 1.1; }
.promos { font-size: 13px; font-weight: 600; color: var(--texto-suave); margin: 8px 2px 0; }
.boton-agotado { margin-top: 14px; width: 100%; min-height: 56px; border-radius: var(--radio); border: 3px solid var(--comal); background: var(--hueso); color: var(--comal); font-weight: 800; font-size: 16px; letter-spacing: .02em; }
.boton-agotado.si { background: var(--comal); color: var(--tortilla); }
.pestanas { display: flex; gap: 8px; margin: 16px 0 12px; }
.pestanas button { flex: 1; min-height: 46px; border-radius: 999px; border: 2px solid var(--vino); background: var(--hueso); color: var(--vino); font-weight: 700; }
.pestanas button[aria-selected="true"] { background: var(--vino); color: var(--hueso); }
.lista-pedidos { display: grid; gap: 12px; }
@media (min-width: 760px) { .lista-pedidos { grid-template-columns: 1fr 1fr; } }
.pedido { background: var(--hueso); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; border-top: 8px solid var(--texto-suave); }
.pedido.nuevo { border-top-color: var(--chile); }
.pedido.pagado { border-top-color: var(--tortilla); }
.pedido.preparando { border-top-color: var(--limon); }
.pedido.entregado, .pedido.cancelado { opacity: .6; }
.pedido.recien { animation: latido 1.2s ease-in-out 5; }
@keyframes latido { 50% { box-shadow: 0 0 0 6px rgb(235 182 71 / .7); } }
.pedido-cabeza { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 14px 0; }
.pedido-cabeza h2 { font-size: 34px; }
.para { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; padding: 6px 10px; border-radius: 999px; background: var(--crema); white-space: nowrap; }
.para.urgente { background: var(--chile); color: var(--hueso); }
.para .i { width: 16px; height: 16px; }
.etiquetas { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; }
.etiqueta { font-size: 12px; font-weight: 800; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: var(--crema); }
.etiqueta.nuevo { background: var(--chile); color: var(--hueso); }
.etiqueta.pagado { background: var(--tortilla); color: var(--comal); }
.etiqueta.preparando { background: var(--limon); color: #fff; }
.pedido-cuerpo { padding: 10px 14px; display: grid; gap: 10px; }
.productos-pedido { margin: 0; padding: 0; list-style: none; font-size: 17px; }
.productos-pedido li { padding: 2px 0; }
.productos-pedido b { display: inline-block; min-width: 34px; font-size: 19px; }
.cobro { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--borde); padding-top: 8px; }
.cobro strong { font-size: 24px; }
.cliente { background: var(--crema); border-radius: var(--radio-chico); padding: 10px 12px; font-size: 15px; }
.cliente b { display: block; font-size: 13px; letter-spacing: .03em; color: var(--vino); }
.pedido-acciones { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 0 14px 14px; }
.pedido-acciones .principal { grid-column: 1 / -1; min-height: 52px; }
.pedido-acciones .secundario { padding: 0 6px; font-size: 14px; }
.pedido-acciones .secundario .i { width: 18px; height: 18px; }
.entrar { max-width: 360px; margin: 40px auto; background: var(--hueso); border-radius: var(--radio); padding: 20px; box-shadow: var(--sombra); }

/* ---------- Dirección y mapa ---------- */
.icono-caja { width: 42px; height: 42px; border-radius: 12px; background: var(--vino); color: var(--hueso); display: grid; place-items: center; flex: none; }
.tarjeta-mapa {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 12px;
  padding: 14px; min-height: 76px; border-radius: var(--radio-chico); border: 2px dashed var(--vino); background: #fff;
}
.tarjeta-mapa strong { display: block; }
.tarjeta-mapa small { display: block; color: var(--texto-suave); font-size: 13px; font-weight: 600; }
.tarjeta-mapa > .i:last-child { margin-left: auto; color: var(--vino); }
.direccion-elegida { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 12px 8px 12px 14px; border-radius: var(--radio-chico); background: #fff; border: 2px solid var(--vino); }
.direccion-elegida > div { flex: 1; min-width: 0; }
.direccion-elegida strong { display: block; }
.enlace { border: 0; background: none; color: var(--chile); font-weight: 700; padding: 0 8px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.zona { display: inline-flex; align-items: center; margin-top: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; line-height: 1.3; }
.zona.corta { white-space: nowrap; }
.zona.colonia { background: #DDF3E6; color: var(--verde-oscuro); }
.zona.fuera { background: var(--tortilla-suave); color: var(--vino-oscuro); }
.zona.lejos { background: #FBE4E2; color: var(--chile-oscuro); }

.mapa { position: fixed; inset: 0; z-index: 35; background: var(--crema); display: flex; flex-direction: column; }
.mapa .hoja-cabeza h2 { font-size: 26px; }
.mapa-buscar { position: relative; z-index: 4; padding: 0 16px 12px; background: var(--vino); }
.mapa-buscar > .i { position: absolute; left: 30px; top: 14px; width: 20px; height: 20px; color: var(--texto-suave); pointer-events: none; }
.mapa-buscar input { width: 100%; height: 48px; padding: 0 14px 0 44px; border: 0; border-radius: 999px; background: #fff; font-size: 16px; }
.mapa-buscar input:focus { outline: 3px solid var(--tortilla); }
.sugerencias { position: absolute; left: 16px; right: 16px; top: 56px; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: var(--radio-chico); box-shadow: var(--sombra-alta); max-height: 50vh; overflow-y: auto; }
.sugerencias button { display: flex; gap: 10px; align-items: flex-start; width: 100%; min-height: 52px; padding: 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.sugerencias button:hover, .sugerencias button:focus-visible { background: var(--crema); }
.sugerencias .i { color: var(--vino); margin-top: 2px; }
.sugerencias strong { display: block; font-size: 15px; }
.sugerencias small { display: block; color: var(--texto-suave); font-size: 13px; }
.sugerencias .vacio { padding: 12px; color: var(--texto-suave); font-size: 14px; }
.mapa-lienzo-caja { position: relative; flex: 1; min-height: 0; background: #E9E4DA; }
/* Más específico que .maplibregl-map (position: relative) para que el mapa ocupe toda la caja. */
.mapa-lienzo-caja > .mapa-lienzo { position: absolute; inset: 0; }
.pin-centro { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.pin-svg { width: 40px; height: 52px; filter: drop-shadow(0 4px 6px rgb(0 0 0 / .3)); transition: transform var(--rapido) var(--curva); }
.pin-centro.levantado .pin-svg { transform: translateY(-12px); }
.pin-globo { position: relative; margin-bottom: 8px; padding: 6px 10px; border-radius: 10px; background: var(--comal); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: var(--sombra); transition: opacity var(--rapido); }
.pin-globo::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--comal); transform: translateX(-50%) rotate(45deg); }
.pin-centro.levantado .pin-globo { opacity: 0; }
.pin-sombra { position: absolute; left: 50%; top: 50%; z-index: 1; width: 16px; height: 6px; border-radius: 50%; background: rgb(0 0 0 / .35); transform: translate(-50%, -50%); }
.mapa-gps { position: absolute; right: 16px; bottom: 32px; z-index: 2; width: 52px; height: 52px; border: 0; border-radius: 50%; background: #fff; color: var(--vino); box-shadow: var(--sombra-alta); display: grid; place-items: center; }
.mapa-falla { position: absolute; inset: 0; z-index: 3; display: grid; align-content: start; gap: 12px; padding: 24px 16px; background: var(--crema); }
.mapa-pie { position: relative; z-index: 3; margin-top: -16px; padding: 14px 16px calc(14px + var(--seguro-abajo)); border-radius: 20px 20px 0 0; background: var(--hueso); box-shadow: var(--sombra-alta); }
.mapa-pie > * { max-width: 608px; margin-left: auto; margin-right: auto; }
.mapa-ayuda { margin-top: 0; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--texto-suave); text-align: center; }
.mapa-lugar { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; min-height: 52px; }
.mapa-lugar > .i { margin-top: 2px; color: var(--chile); }
.mapa-lugar strong { display: block; }
.marcador-local { width: 34px; height: 34px; border-radius: 50%; background: var(--vino); border: 3px solid var(--tortilla); background-image: url("fotos/logo.webp"); background-size: cover; box-shadow: var(--sombra); }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---------- Agotado por producto (catálogo) ---------- */
.producto.agotado .producto-foto, .producto.agotado .producto-sinfoto { filter: grayscale(1); opacity: .55; }
.producto.agotado h3, .producto.agotado .precio { color: var(--texto-suave); }
.sin-existencia { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; background: var(--crema); color: var(--texto-suave); font-weight: 700; font-size: 13px; }
.enlace-claro { display: inline-block; margin-top: 14px; color: var(--hueso); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; line-height: 44px; }

/* ---------- Panel: embudo, estados y productos ---------- */
.embudo { margin-top: 10px; background: var(--hueso); border-radius: var(--radio-chico); padding: 10px 12px; box-shadow: var(--sombra); }
.embudo-titulo { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-suave); }
.pasos-embudo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.paso-embudo { text-align: center; background: var(--crema); border-radius: 10px; padding: 6px 2px; }
.paso-embudo strong { display: block; font-family: 'Bebas Neue', Impact, sans-serif; font-size: 26px; font-weight: 400; line-height: 1; }
.paso-embudo small { display: block; font-size: 11px; font-weight: 700; color: var(--texto-suave); }
.paso-embudo em { display: block; font-style: normal; font-size: 11px; font-weight: 800; color: var(--vino); }
.embudo .promos { margin: 8px 0 0; }
.pedido.listo { border-top-color: var(--verde); }
.etiqueta.listo { background: var(--verde); color: #fff; }
.pedido-acciones .principal.whatsapp + .principal { margin-top: 0; }
.pedido-acciones .cancelar { grid-column: 1 / -1; border-color: var(--borde); color: var(--texto-suave); }
.lista-productos h3 { font-size: 22px; color: var(--vino); margin: 16px 0 6px; }
.fila-producto { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border-radius: var(--radio-chico); background: var(--hueso); box-shadow: var(--sombra); }
.fila-producto.sin { background: #EFE6DA; }
.fila-producto.sin .fila-nombre { color: var(--texto-suave); text-decoration: line-through; }
.fila-nombre { flex: 1; min-width: 0; font-weight: 600; }
.fila-nombre small { display: block; font-size: 12px; font-weight: 700; color: var(--limon); text-decoration: none; }
.mini { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.mini-vacia { background: var(--vino); }
.secundario.chico { min-height: 40px; padding: 0 10px; font-size: 13px; }
.interruptor { min-width: 92px; min-height: 44px; border-radius: 999px; border: 0; background: var(--verde); color: #fff; font-weight: 800; }
.interruptor.apagado { background: var(--comal); color: var(--tortilla); }
.ajustes { margin-top: 20px; padding: 14px; border-radius: var(--radio-chico); background: var(--hueso); box-shadow: var(--sombra); }
.ajustes textarea, .editor textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--borde); border-radius: var(--radio-chico); background: #fff; font-size: 16px; resize: vertical; }
.editor { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgb(30 30 30 / .55); }
.editor-caja { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px; border-radius: var(--radio); background: var(--hueso); box-shadow: var(--sombra-alta); }
.editor-caja h2 { font-size: 30px; color: var(--vino); margin-bottom: 12px; }
.editor-foto-caja { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radio-chico); overflow: hidden; background: var(--vino); }
.editor-foto { width: 100%; height: 100%; object-fit: cover; }
.editor-sinfoto { position: absolute; inset: 0; display: grid; place-items: center; color: var(--tortilla); font-weight: 700; }
.archivo { width: 100%; margin-top: 12px; cursor: pointer; }
.editor-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.editor-botones .principal { margin: 0; min-height: 48px; }
.editor-caja .enlace { display: block; margin: 8px auto 0; }

/* ---------- Seguimiento del pedido ---------- */
.seguimiento { max-width: 520px; margin: 0 auto; padding: 16px; }
.seguimiento-estado { margin-top: 16px; padding: 16px; border-radius: var(--radio); background: var(--hueso); box-shadow: var(--sombra); }
.seguimiento-estado h2 { font-size: 34px; color: var(--vino); }
.seguimiento-estado p { margin: 4px 0 0; color: var(--texto-suave); font-weight: 600; }
.linea-tiempo { list-style: none; margin: 18px 0 0; padding: 0; }
.linea-tiempo li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding-bottom: 18px; color: var(--texto-suave); font-weight: 600; }
.linea-tiempo li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--borde); }
.linea-tiempo li:last-child::before { display: none; }
.linea-tiempo .punto { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--crema); border: 2px solid var(--borde); color: transparent; }
.linea-tiempo .punto .i { width: 16px; height: 16px; stroke-width: 3; }
.linea-tiempo li.hecho { color: var(--comal); }
.linea-tiempo li.hecho .punto { background: var(--verde); border-color: var(--verde); color: #fff; }
.linea-tiempo li.hecho::before { background: var(--verde); }
.linea-tiempo li.actual { color: var(--vino); font-weight: 800; }
.linea-tiempo li.actual .punto { background: var(--tortilla); border-color: var(--tortilla); color: var(--comal); animation: latido 1.6s ease-in-out infinite; }
.cancelar-caja { margin-top: 16px; text-align: center; }
.cancelar-caja .secundario { width: 100%; }
.cancelado-aviso { margin-top: 12px; padding: 12px 14px; border-radius: var(--radio-chico); background: #FBE4E2; color: var(--chile-oscuro); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
