/* =====================================================================
   Lo llevamos — hoja de estilos base
   Negro, blanco y amarillo. Pensada primero para el celular.
   ===================================================================== */

:root {
  /* Marca */
  --amarillo:        #F5E14C;
  --amarillo-osc:    #E2CB2A;
  --amarillo-claro:  #FFF6C2;
  --negro:           #121212;
  --negro-suave:     #1E1E1E;
  --blanco:          #FFFFFF;

  /* Grises */
  --gris-100: #F5F5F5;
  --gris-200: #EAEAEA;
  --gris-300: #D6D6D6;
  --gris-500: #8A8A8A;
  --gris-700: #4A4A4A;

  /* Estados */
  --verde:   #17A34A;
  --rojo:    #DC2626;
  --naranja: #EA8A0B;
  --azul:    #2563EB;

  /* Superficies. El fondo lleva un tinte cálido (no gris frío puro) para
     que el amarillo de marca se sienta integrado y no como un color que
     se agrega encima de una interfaz gris genérica. */
  --fondo:       #FAF8EF;
  --superficie:  #FFFFFF;
  --borde:       var(--gris-200);
  --borde-calido: #F0E9C8;
  --texto:       var(--negro);
  --texto-suave: var(--gris-500);
  --acento-suave: #FFF9DC;

  /* Medidas */
  --radio:    14px;
  --radio-sm: 9px;
  --radio-lg: 22px;
  --sombra:    0 1px 3px rgba(0,0,0,.08);
  --sombra-md: 0 4px 14px rgba(0,0,0,.10);
  --sombra-lg: 0 10px 34px rgba(0,0,0,.16);

  /* Alturas fijas de la interfaz */
  --header-h: 58px;
  --nav-h:    62px;

  --fuente: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------------------------------------------- Base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Evita el zoom accidental al tocar dos veces en iOS */
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
  /* Deja lugar para la barra inferior y el notch */
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

body.sin-nav { padding-bottom: 0; }

h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.03rem; }
p  { margin: 0 0 .75rem; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* Que el foco se vea, pero solo cuando se navega con teclado */
:focus-visible {
  outline: 3px solid var(--amarillo);
  outline-offset: 2px;
  border-radius: 4px;
}

.contenedor {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* En pantallas grandes la app se ensancha, pero sin perder la forma */
@media (min-width: 900px) {
  .contenedor { max-width: 1080px; }
}

/* ------------------------------------------------------------ Header */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--negro);
  color: var(--blanco);
  padding-top: env(safe-area-inset-top);
  /* Filo amarillo de marca: sin esto la cabecera es negra a secas y
     nada distingue "esta app" de cualquier plantilla genérica. */
  border-bottom: 3px solid var(--amarillo);
}

.header__logo { height: 30px; width: auto; }

.header__titulo {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__accion {
  background: none;
  border: 0;
  color: var(--blanco);
  padding: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.header__accion:active { background: rgba(255,255,255,.14); }

.header--claro { background: var(--blanco); color: var(--negro); border-bottom: 1px solid var(--borde); }
.header--claro .header__accion { color: var(--negro); }

/* Aviso para un comercio/repartidor que terminó del lado del cliente:
   pasa fácil si entran por el link equivocado o navegan de memoria. */
.banner-panel {
  display: block;
  background: var(--amarillo);
  color: var(--negro);
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  padding: 9px 16px;
}
.banner-panel span { margin-left: 4px; }

/* --------------------------------------------------- Barra inferior */

.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--blanco);
  border-top: 1px solid var(--borde);
}

.nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--gris-500);
  position: relative;
  /* Área táctil cómoda aunque el ícono sea chico */
  min-height: 44px;
}

.nav__item svg { width: 22px; height: 22px; }

.nav__item.activo { color: var(--negro); }

.nav__item.activo::before {
  content: '';
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--amarillo);
}

.nav__badge {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--rojo);
  color: var(--blanco);
  font-size: .62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ----------------------------------------------------------- Botones */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;          /* cómodo para el pulgar */
  padding: 0 20px;
  border: 0;
  border-radius: var(--radio);
  font-family: inherit;
  font-size: .96rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease, background .15s ease;
  text-align: center;
}

.btn:active { transform: scale(.975); }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--principal { background: var(--amarillo); color: var(--negro); }
.btn--principal:hover { background: var(--amarillo-osc); }

.btn--negro { background: var(--negro); color: var(--blanco); }
.btn--negro:hover { background: var(--negro-suave); }

.btn--borde {
  background: transparent;
  color: var(--negro);
  box-shadow: inset 0 0 0 2px var(--gris-300);
}
.btn--borde:hover { box-shadow: inset 0 0 0 2px var(--negro); }

.btn--fantasma { background: transparent; color: var(--gris-700); }
.btn--fantasma:hover { background: var(--gris-100); }

.btn--peligro { background: var(--rojo); color: var(--blanco); }

.btn--bloque { width: 100%; }
.btn--chico  { min-height: 38px; padding: 0 14px; font-size: .85rem; }

/* Botón fijo al pie: "Hacer el pedido", "Confirmar" */
.btn-fijo {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 55;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--blanco);
  border-top: 1px solid var(--borde);
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}

/* Cuando la barra de navegación inferior sigue visible (carrito, ficha
   del comercio), el CTA fijo se apila ARRIBA de ella. Antes los dos
   compartían bottom:0 y la nav, con más z-index, lo dejaba tapado por
   completo: el botón "Continuar" existía en el DOM pero era invisible. */
body:not(.sin-nav) .btn-fijo {
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

/* Esas mismas páginas necesitan lugar de sobra al pie para que el
   contenido no quede tapado por el CTA apilado sobre la nav. */
body.con-cta-fijo {
  padding-bottom: calc(var(--nav-h) + 78px + env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------ Tarjetas */

.tarjeta {
  background: var(--superficie);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
}

.tarjeta--plana { box-shadow: none; border: 1px solid var(--borde); }

.tarjeta__cuerpo { padding: 14px 16px; }

/* Comercio en el listado */
.comercio {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--superficie);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  margin-bottom: 10px;
  align-items: center;
}

.comercio__logo {
  width: 62px;
  height: 62px;
  border-radius: var(--radio-sm);
  object-fit: cover;
  background: var(--gris-100);
  flex-shrink: 0;
}

.comercio__datos { min-width: 0; flex: 1; }

/* El nombre se trunca, pero el sello de destacado NO: va como hermano
   en un flex, si no un nombre largo se comía justo la etiqueta del
   comercio que paga por mostrarla. */
.comercio__nombre {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: .98rem;
  margin: 0 0 2px;
  min-width: 0;
}

.comercio__texto {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.comercio__meta {
  font-size: .8rem;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.comercio--cerrado { opacity: .55; }

/* Producto */
.producto {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--borde);
  align-items: flex-start;
  width: 100%;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.producto__info { flex: 1; min-width: 0; }
.producto__nombre { font-weight: 600; margin: 0 0 3px; font-size: .95rem; }

.producto__desc {
  font-size: .83rem;
  color: var(--texto-suave);
  margin: 0 0 6px;
  /* Dos líneas y corta */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.producto__precio { font-weight: 700; font-size: .95rem; }

.producto__precio-viejo {
  font-weight: 400;
  font-size: .82rem;
  color: var(--texto-suave);
  text-decoration: line-through;
  margin-left: 6px;
}

.producto__img {
  width: 82px;
  height: 82px;
  border-radius: var(--radio-sm);
  object-fit: cover;
  background: var(--gris-100);
  flex-shrink: 0;
}

.producto--agotado { opacity: .45; }

/* ------------------------------------------ Carta (QR en la mesa)
   Cuando el cliente entra escaneando el QR del local no está eligiendo
   entre comercios: ya está sentado adentro. Así que en vez de la lista
   de siempre —pensada para comparar y comprar— se le muestra algo que
   se lea como la carta de papel del restaurante. */

.carta__tapa {
  text-align: center;
  padding: 26px 16px 20px;
  border-bottom: 2px solid var(--negro);
  margin-bottom: 4px;
}
.carta__tapa img { height: 54px; width: auto; border-radius: 10px; margin-bottom: 10px; }
.carta__marca {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}
.carta__lema {
  font-size: .8rem;
  color: var(--gris-500);
  margin: 6px 0 0;
}

.carta__seccion {
  text-align: center;
  margin: 26px 0 6px;
}
.carta__seccion h2 {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0;
}
/* Las dos rayitas al costado del título de cada sección */
.carta__seccion h2::before,
.carta__seccion h2::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--gris-300);
  vertical-align: middle;
  margin: 0 10px;
}

.carta__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--borde-calido);
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.carta__cuerpo { flex: 1; min-width: 0; }

/* Nombre …………… precio, como en una carta impresa. Los puntos son un
   borde que se estira: así el precio queda siempre pegado a la derecha
   sin importar cuánto mida el nombre. */
.carta__linea { display: flex; align-items: baseline; gap: 4px; }
.carta__nombre { font-weight: 700; font-size: .96rem; }
.carta__puntos {
  flex: 1;
  border-bottom: 1px dotted var(--gris-300);
  min-width: 14px;
  transform: translateY(-3px);
}
.carta__precio { font-weight: 800; font-size: .96rem; white-space: nowrap; }
.carta__precio-viejo {
  font-size: .8rem;
  color: var(--gris-500);
  text-decoration: line-through;
  margin-left: 5px;
  font-weight: 500;
}
.carta__desc {
  font-size: .82rem;
  color: var(--gris-500);
  line-height: 1.45;
  margin: 3px 0 0;
}
.carta__img {
  width: 62px;
  height: 62px;
  border-radius: var(--radio-sm);
  object-fit: cover;
  background: var(--gris-100);
  flex-shrink: 0;
}
.carta__item--agotado { opacity: .45; }

/* ----------------------------------------------------------- Etiquetas */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--blanco);
  border: 1px solid var(--borde-calido);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  color: var(--texto);
}

.chip.activo { background: var(--negro); color: var(--amarillo); border-color: var(--negro); }

/* Fila de rubros que se desliza en horizontal */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  margin: 0 -16px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chips > * { scroll-snap-align: start; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--acento-suave);
  color: var(--gris-700);
}

.badge--amarillo { background: var(--amarillo); color: var(--negro); }
.badge--verde    { background: #DCFCE7; color: #14532D; }
.badge--rojo     { background: #FEE2E2; color: #7F1D1D; }
.badge--naranja  { background: #FEF0D6; color: #7C4A03; }
.badge--azul     { background: #DBEAFE; color: #1E3A8A; }

/* ----------------------------------------------------------- Formularios */

.campo { margin-bottom: 15px; }

.campo__label {
  display: block;
  font-size: .86rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.campo__ayuda {
  font-size: .78rem;
  color: var(--texto-suave);
  margin-top: 5px;
}

.campo__error {
  font-size: .8rem;
  color: var(--rojo);
  margin-top: 5px;
  font-weight: 500;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--gris-300);
  border-radius: var(--radio-sm);
  background: var(--blanco);
  font-family: inherit;
  /* 16px evita que iOS haga zoom al enfocar el campo */
  font-size: 16px;
  color: var(--texto);
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--negro);
  box-shadow: 0 0 0 3px var(--amarillo-claro);
}

.input.con-error { border-color: var(--rojo); }

.textarea { min-height: 92px; resize: vertical; line-height: 1.45; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234A4A4A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* Interruptor sí/no */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch__pista {
  width: 46px; height: 27px;
  border-radius: 999px;
  background: var(--gris-300);
  position: relative;
  transition: background .18s ease;
  flex-shrink: 0;
}

.switch__pista::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--blanco);
  transition: transform .18s ease;
  box-shadow: var(--sombra);
}

.switch input:checked + .switch__pista { background: var(--verde); }
.switch input:checked + .switch__pista::after { transform: translateX(19px); }
.switch input:focus-visible + .switch__pista { outline: 3px solid var(--amarillo); outline-offset: 2px; }

/* Campo con prefijo o sufijo: $ ... / ... km */
.campo-grupo { display: flex; align-items: stretch; }

.campo-grupo__afijo {
  display: grid;
  place-items: center;
  padding: 0 13px;
  background: var(--gris-100);
  border: 1px solid var(--gris-300);
  font-size: .88rem;
  font-weight: 600;
  color: var(--gris-700);
  white-space: nowrap;
}

.campo-grupo__afijo:first-child {
  border-right: 0;
  border-radius: var(--radio-sm) 0 0 var(--radio-sm);
}
.campo-grupo__afijo:last-child {
  border-left: 0;
  border-radius: 0 var(--radio-sm) var(--radio-sm) 0;
}
.campo-grupo .input { border-radius: 0; }
.campo-grupo .input:first-child { border-radius: var(--radio-sm) 0 0 var(--radio-sm); }
.campo-grupo .input:last-child  { border-radius: 0 var(--radio-sm) var(--radio-sm) 0; }

/* ------------------------------------------------------------- Avisos */

.aviso {
  padding: 12px 15px;
  border-radius: var(--radio-sm);
  font-size: .89rem;
  margin-bottom: 14px;
  border-left: 4px solid;
  font-weight: 500;
}

.aviso--ok    { background: #DCFCE7; border-color: var(--verde);   color: #14532D; }
.aviso--error { background: #FEE2E2; border-color: var(--rojo);    color: #7F1D1D; }
.aviso--info  { background: #DBEAFE; border-color: var(--azul);    color: #1E3A8A; }
.aviso--ojo   { background: var(--amarillo-claro); border-color: var(--amarillo-osc); color: #6B5800; }

/* Mensaje flotante */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px);
  transform: translateX(-50%) translateY(24px);
  z-index: 200;
  background: var(--negro);
  color: var(--blanco);
  padding: 13px 20px;
  border-radius: var(--radio);
  font-size: .89rem;
  font-weight: 600;
  box-shadow: var(--sombra-lg);
  max-width: calc(100% - 32px);
  transition: transform .28s cubic-bezier(.2,.8,.3,1), opacity .2s ease;

  /* Se oculta con opacidad y no solo desplazándolo: apoyado únicamente
     en el translate, el borde del recuadro asomaba sobre la barra. */
  opacity: 0;
  pointer-events: none;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ------------------------------------------------------- Estados vacíos */

.vacio { text-align: center; padding: 48px 24px; color: var(--texto-suave); }

.vacio svg {
  width: 34px;
  height: 34px;
  stroke: var(--amarillo-osc);
  opacity: .85;
  padding: 20px;
  border-radius: 50%;
  background: var(--acento-suave);
  margin-bottom: 16px;
  box-sizing: content-box;
}

.vacio h3 { color: var(--texto); margin-bottom: 5px; }
.vacio p { font-size: .89rem; margin: 0; }

/* Esqueleto de carga */
.esqueleto {
  background: linear-gradient(90deg, var(--gris-100) 25%, var(--gris-200) 50%, var(--gris-100) 75%);
  background-size: 200% 100%;
  animation: brillo 1.4s infinite;
  border-radius: var(--radio-sm);
}

@keyframes brillo {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* --------------------------------------------------- Estados de pedido */

.estado { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; }
.estado::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.estado--pending   { color: var(--naranja); }
.estado--accepted,
.estado--preparing { color: var(--azul); }
.estado--ready,
.estado--picked_up { color: #7C3AED; }
.estado--delivered { color: var(--verde); }
.estado--cancelled,
.estado--rejected  { color: var(--rojo); }

/* El pedido nuevo late para que no pase desapercibido en el mostrador */
.late { animation: latido 1.4s ease-in-out infinite; }

@keyframes latido {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,225,76,.7); }
  50%      { box-shadow: 0 0 0 12px rgba(245,225,76,0); }
}

/* ------------------------------------------------------------ Utilidades */

.fila     { display: flex; align-items: center; gap: 10px; }
.fila--sep{ justify-content: space-between; }
.col      { display: flex; flex-direction: column; gap: 10px; }
.crece    { flex: 1; }

.txt-suave  { color: var(--texto-suave); }
.txt-chico  { font-size: .82rem; }
.txt-grande { font-size: 1.14rem; }
.txt-negrita{ font-weight: 700; }
.txt-centro { text-align: center; }
.txt-der    { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-0  { padding: 0; }

.oculto { display: none !important; }

/* Visible solo para lectores de pantalla */
.solo-lectores {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.separador { height: 1px; background: var(--borde); margin: 16px 0; border: 0; }

.seccion__titulo {
  display: flex;
  align-items: baseline;
  gap: 9px;
  justify-content: space-between;
  margin: 22px 0 11px;
}
.seccion__titulo h2 { margin: 0; }

/* Marca de sección: una rayita amarilla antes del título. Barato de
   dibujar (un pseudo-elemento) y le da personalidad a cada encabezado
   sin necesitar íconos ni imágenes por sección. */
.seccion__titulo h2::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amarillo-osc);
  margin-right: 8px;
  vertical-align: middle;
}
.seccion__titulo a  { font-size: .85rem; font-weight: 600; color: var(--gris-700); }

/* Quien prefiere menos movimiento, no lo tiene */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =====================================================================
   Inicio: selector de localidad, banners, rubros y carruseles
   ===================================================================== */

.selector-pueblo {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 0 9px;
  font-size: .87rem;
}
.selector-pueblo strong { font-weight: 700; }
.selector-pueblo .txt-suave { margin-left: auto; font-size: .8rem; }

/* ------------------------------------------- Sumate (negocio/repartidor)
   Dos avisos chicos para juntar comercios y repartidores. Van aparte del
   carrusel de banners: ese es para promociones que cambian, y esto es
   fijo. Se dibujan con CSS y no con imágenes subidas para que se vean
   nítidos en cualquier pantalla y el texto se pueda cambiar sin tener
   que rehacer un archivo. */

.sumate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 4px;
}

.sumate__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radio-sm);
  padding: 14px 13px 13px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--sombra);
}

.sumate__item--negocio { background: var(--amarillo); color: var(--negro); }
.sumate__item--rider   { background: var(--negro);    color: var(--blanco); }

.sumate__titulo {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.15;
}
.sumate__bajada {
  font-size: .72rem;
  font-weight: 500;
  opacity: .78;
  margin-top: 2px;
}
.sumate__cta {
  font-size: .74rem;
  font-weight: 700;
  margin-top: 8px;
}

/* El isotipo asomando en la esquina: da identidad sin robarle lugar al
   texto, que es lo único que hay que leer. */
.sumate__marca {
  position: absolute;
  top: -14px;
  right: -16px;
  width: 74px;
  height: 74px;
  opacity: .22;
  transform: rotate(-12deg);
  pointer-events: none;
}
.sumate__item--negocio .sumate__marca { filter: brightness(0); opacity: .13; }

@media (max-width: 340px) {
  /* En pantallas muy angostas dos columnas dejan los títulos en una
     palabra por renglón; mejor uno abajo del otro. */
  .sumate { grid-template-columns: 1fr; }
  .sumate__item { min-height: 0; }
}

@media (min-width: 900px) {
  /* En escritorio cada tarjeta se estira a media pantalla: con las
     medidas del celular quedaba mucho aire a la derecha del texto. Se
     agranda el isotipo para que ocupe ese lado y la tipografía para que
     acompañe el ancho. */
  .sumate { gap: 12px; }
  .sumate__item   { min-height: 124px; padding: 20px 22px 18px; }
  .sumate__titulo { font-size: 1.1rem; }
  .sumate__bajada { font-size: .78rem; }
  .sumate__cta    { font-size: .8rem; margin-top: 10px; }
  .sumate__marca  { width: 132px; height: 132px; top: -26px; right: -26px; }
}

/* --------------------------------------------------------- Banners */

.carrusel-banner { position: relative; margin-bottom: 6px; }

.carrusel-banner__pista {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radio);
  /* Sin esto el arrastre horizontal en iOS se siente pegajoso */
  -webkit-overflow-scrolling: touch;
}
.carrusel-banner__pista::-webkit-scrollbar { display: none; }

.banner {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-height: 148px;
  display: flex;
  align-items: center;
  padding: 20px 22px;
  border-radius: var(--radio);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.banner__texto { max-width: 78%; }

.banner__titulo {
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

.banner__bajada { font-size: .87rem; opacity: .88; line-height: 1.35; }

.banner__cta {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  color: inherit;
  /* Velo del color del propio texto: funciona tanto sobre un fondo
     claro como sobre uno oscuro, sin tener que calcular contraste. */
  background: color-mix(in srgb, currentColor 16%, transparent);
  border: 1.5px solid color-mix(in srgb, currentColor 30%, transparent);
}

.banner--foto .banner__cta {
  background: var(--amarillo);
  border-color: var(--amarillo);
  color: var(--negro);
}

.carrusel-banner__puntos {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 2px;
}
.carrusel-banner__puntos button {
  width: 7px; height: 7px;
  padding: 0;
  border: 0; border-radius: 50%;
  background: var(--gris-300);
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}
.carrusel-banner__puntos button.activo { width: 20px; border-radius: 4px; background: var(--negro); }

/* ---------------------------------------------------------- Rubros */

.rubros {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
  margin: 16px 0 4px;
}

.rubro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 13px 5px;
  border-radius: var(--radio-sm);
  background: var(--superficie);
  box-shadow: var(--sombra);
  text-align: center;
  transition: transform .1s ease;
}
.rubro:active { transform: scale(.96); }

.rubro__icono {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--amarillo-claro);
  color: var(--negro);
}
.rubro__icono svg { width: 19px; height: 19px; }

.rubro__nombre {
  font-size: .71rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--gris-700);
}

/* ------------------------------------------------------- Carruseles */

.carrusel {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding: 2px 16px 6px;
  margin: 0 -16px;
}
.carrusel::-webkit-scrollbar { display: none; }

.tarjetita {
  flex: 0 0 156px;
  scroll-snap-align: start;
}

.tarjetita__foto {
  position: relative;
  height: 96px;
  border-radius: var(--radio-sm);
  overflow: hidden;
  background: var(--gris-100);
  display: grid;
  place-items: center;
  margin-bottom: 7px;
}
.tarjetita__foto img { width: 100%; height: 100%; object-fit: cover; }

.tarjetita__inicial {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gris-300);
}

.tarjetita__nombre {
  font-weight: 700;
  font-size: .87rem;
  line-height: 1.25;
  /* Dos líneas máximo, para que todas las tarjetas midan igual */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tarjetita__meta { font-size: .75rem; color: var(--texto-suave); }

.tarjetita--cerrada .tarjetita__foto { opacity: .5; }

.tarjetita__cerrado {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(18,18,18,.82);
  color: var(--blanco);
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
  padding: 4px;
}

/* Sello de destacado sobre la foto */
.sello {
  position: absolute;
  top: 7px; left: 7px;
  background: var(--amarillo);
  color: var(--negro);
  font-size: .66rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: var(--sombra);
  letter-spacing: .01em;
}

/* La misma idea, en línea junto al nombre */
.sello--linea {
  position: static;
  flex-shrink: 0;          /* nunca se achica ni se corta */
  box-shadow: none;
  font-size: .62rem;
  padding: 2px 7px;
}

.comercio__logo--vacio {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--gris-500);
}

/* =====================================================================
   Escritorio: la nav inferior (pensada para el pulgar en el celular)
   se convierte en una segunda barra debajo del header, y los
   carruseles de scroll horizontal pasan a grilla — si no, con pocas
   tarjetas queda media pantalla vacía y hay que arrastrar para ver
   el resto, algo que en mobile no se nota pero en desktop sí.
   ===================================================================== */
@media (min-width: 900px) {
  .banner { min-height: 200px; padding: 30px 36px; }
  .banner__titulo { font-size: 1.7rem; }

  /* auto-fit (no auto-fill): con pocos rubros, que ocupen todo el
     ancho en vez de quedar pegados a la izquierda con el resto de la
     fila vacío. */
  .rubros { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .tarjetita__foto { height: 124px; }

  .carrusel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    overflow: visible;
    margin: 0;
    padding: 2px 0 6px;
  }

  body:not(.sin-nav) main.contenedor { margin-top: 58px; }
  body { padding-bottom: 0; }
  body.con-cta-fijo { padding-bottom: 78px; }
  body:not(.sin-nav) .btn-fijo { bottom: 18px; }
  .toast { bottom: 18px; }

  .nav {
    top: var(--header-h);
    bottom: auto;
    height: auto;
    padding-bottom: 0;
    border-top: 0;
    border-bottom: 1px solid var(--borde);
    justify-content: center;
    gap: 6px;
  }
  .nav__item {
    flex: none;
    flex-direction: row;
    gap: 8px;
    padding: 15px 20px;
    font-size: .85rem;
  }
  .nav__item.activo::before { top: auto; bottom: 0; }
  /* En fila, no hace falta calcular dónde cae el ícono: la insignia
     simplemente sigue al texto. */
  .nav__badge { position: static; margin-left: 2px; }

  /* El banner-panel no es fixed: empuja al resto hacia abajo solo. Al
     nav (que sí es fixed) hay que correrlo a mano para que no quede
     tapando ese aviso. */
  body.con-banner-panel .nav { top: calc(var(--header-h) + 38px); }
}

/* =====================================================================
   Ficha del comercio: portada, logo superpuesto y tira de datos
   ===================================================================== */

.ficha {
  /* Se sale del padding del contenedor para ocupar todo el ancho */
  margin: 0 -16px 12px;
}

.ficha__portada {
  height: 168px;
  background: var(--gris-200);
  position: relative;
  overflow: hidden;
}

.ficha__portada img { width: 100%; height: 100%; object-fit: cover; }

/* Velo inferior: sin esto el logo blanco se pierde sobre fotos claras */
.ficha__portada::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(0,0,0,.28));
}

.ficha__cabecera {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 13px;
  padding: 0 16px;
  /* El logo monta sobre la portada */
  margin-top: -34px;
  position: relative;
  z-index: 1;
}

/* El nombre va DEBAJO de la portada, no encima: sobre una foto clara
   el texto blanco con sombra igual se leía mal. */
.ficha__datos { padding: 10px 16px 0; }

.ficha__logo {
  width: 76px;
  height: 76px;
  border-radius: var(--radio);
  object-fit: cover;
  background: var(--blanco);
  border: 3px solid var(--blanco);
  /* El aro amarillo es lo que hace que el logo se sienta "de la marca"
     y no un recorte cualquiera montado sobre la foto de portada. */
  box-shadow: var(--sombra-md), 0 0 0 3px var(--amarillo);
  flex-shrink: 0;
}

.ficha__logo--vacio {
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gris-500);
  background: var(--gris-100);
}

.ficha__nombre {
  font-size: 1.32rem;
  margin: 0 0 2px;
  line-height: 1.2;
}

/* ------------------------------------------------- Tira de datos */

.datos-tira {
  display: flex;
  background: var(--superficie);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  margin-bottom: 14px;
  overflow: hidden;
  border-top: 3px solid var(--amarillo);
}

.dato {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  text-align: center;
  min-width: 0;
}

.dato + .dato { border-left: 1px solid var(--borde-calido); }

.dato__icono {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--acento-suave);
  color: var(--negro);
  margin-bottom: 2px;
}
.dato__icono svg { width: 16px; height: 16px; }

.dato__valor {
  font-weight: 700;
  font-size: .89rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dato__etiqueta {
  font-size: .69rem;
  color: var(--texto-suave);
  font-weight: 600;
}

@media (min-width: 900px) {
  .ficha__portada { height: 240px; }
  .ficha__logo { width: 96px; height: 96px; }
  .ficha__nombre { font-size: 1.7rem; }
}

/* =====================================================================
   Ofertas dentro de la ficha del comercio: lo que el vendedor marcó con
   un precio tachado desde su panel. Reutiliza .carrusel (scroll
   horizontal ya definido para el inicio).
   ===================================================================== */

.oferta {
  flex: 0 0 130px;
  scroll-snap-align: start;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.oferta__img {
  position: relative;
  height: 98px;
  border-radius: var(--radio-sm);
  overflow: hidden;
  background: var(--gris-100);
  margin-bottom: 7px;
}
.oferta__img img { width: 100%; height: 100%; object-fit: cover; }

.oferta__badge {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--rojo);
  color: var(--blanco);
  font-size: .68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.oferta__nombre {
  font-size: .83rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.oferta__precio { font-weight: 800; font-size: .88rem; }

.oferta__precio-viejo {
  font-size: .74rem;
  color: var(--texto-suave);
  text-decoration: line-through;
  margin-left: 5px;
}

/* =====================================================================
   Texto legal (Términos, Privacidad): tipografía de lectura larga,
   distinta de las pantallas de la app que son más de "tocar botones".
   ===================================================================== */

.legal-texto h2 {
    font-size: 1.05rem;
    margin: 26px 0 10px;
    padding-top: 12px;
    border-top: 1px solid var(--borde);
    scroll-margin-top: calc(var(--header-h) + 12px);
}
.legal-texto h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.legal-texto p { line-height: 1.6; margin-bottom: 12px; }
.legal-texto ul { margin: 0 0 14px; padding-left: 20px; line-height: 1.6; }
.legal-texto li { margin-bottom: 6px; }
.legal-texto strong { font-weight: 700; }
.legal-texto a { text-decoration: underline; text-underline-offset: 2px; }
