/* ============================================================================
   tienda.css — LA PANTALLA DEL COMENSAL
   ============================================================================

   NO es el ERP y no debe parecerlo. Aquí no hay menú lateral, ni barra de
   usuario, ni tablas: hay una carta que se abre en un teléfono con datos móviles
   mientras alguien decide si pide o no.

   ── TRES DECISIONES QUE GOBIERNAN TODO ─────────────────────────────────────

   1. PRIMERO EL TELÉFONO. El ancho base es 375 px y todo lo demás es
      consecuencia. En el escritorio la carta se centra en una columna de 480 px
      en vez de estirarse: una lista de platos a 1.400 px de ancho obliga a mover
      la cabeza para unir el nombre con su precio.

   2. LA MARCA ES UNA VARIABLE, NO UN COLOR ESCRITO. Los tres tokens de abajo
      —`--t-marca`, `--t-marca-txt`, `--t-acento`— son lo único que hay que
      cambiar para que la tienda sea de otro restaurante. Hoy salen del sistema
      de diseño; cuando exista «Mi Tienda» saldrán de la configuración de cada
      inquilino. Ni un color a mano en el resto del archivo.

   3. EL PULGAR MANDA. Lo que se pulsa mide 44 px de alto como mínimo, y lo que
      se pulsa mucho —«agregar», «ver pedido»— vive en la parte de ABAJO, que es
      donde llega el pulgar sin recolocar la mano.
   ============================================================================ */

:root {
  /* ── LA MARCA. Lo único que cambia entre un restaurante y otro ──────────── */
  --t-marca:      var(--col-primary);
  --t-marca-txt:  #fff;
  --t-acento:     var(--col-accent);

  /* El resto sale del sistema, para que la tienda y el ERP no parezcan dos
     productos distintos hechos por dos equipos distintos. */
  --t-fondo:      var(--col-bg);
  --t-tarjeta:    var(--col-card);
  --t-texto:      var(--col-text);
  --t-suave:      var(--col-muted);
  --t-linea:      var(--col-border);
  --t-ancho:      480px;
  --t-barra:      64px;   /* alto de la barra de abajo */
}

body {
  background: var(--t-fondo);
  color: var(--t-texto);
  font-family: var(--fuente);
  /* Hueco al final para que la barra fija no tape el último plato. */
  padding-bottom: calc(var(--t-barra) + 16px);
}

.t-marco { max-width: var(--t-ancho); margin: 0 auto; background: var(--t-tarjeta);
  min-height: 100vh; box-shadow: 0 0 40px rgba(0,0,0,.06) }

/* ── CABECERA ──────────────────────────────────────────────────────────────
   Se queda arriba al desplazar, porque es donde vive el buscador y las
   secciones: en una carta de sesenta platos, perder la navegación al bajar
   obliga a volver al principio para cambiar de sección. */
.t-cab { position: sticky; top: 0; z-index: 20; background: var(--t-marca);
  color: var(--t-marca-txt) }
.t-cab-fila { display: flex; align-items: center; gap: 12px; padding: 13px 16px 11px }
.t-logo { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0 }
.t-nom { flex: 1; min-width: 0 }
.t-nom b { display: block; font-size: 17px; font-weight: var(--fw-extrabold);
  letter-spacing: -.2px }
.t-nom span { display: block; font-size: var(--fs-sm); opacity: .78; margin-top: 1px }
/* Abierto o cerrado: texto plano de color, como en todo el sistema. Sobre fondo
   oscuro el verde del ERP no se lee, así que se usa blanco y un punto. */
.t-estado { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm);
  font-weight: var(--fw-semibold) }
.t-punto { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80 }
.t-punto.cerrado { background: #FCA5A5 }

.t-buscar { padding: 0 16px 12px }
.t-buscar input { width: 100%; height: 44px; border: none; border-radius: 12px;
  background: rgba(255,255,255,.15); color: var(--t-marca-txt);
  font-family: var(--fuente); font-size: var(--fs-lg); padding: 0 14px }
.t-buscar input::placeholder { color: rgba(255,255,255,.6) }
.t-buscar input:focus { outline: 2px solid rgba(255,255,255,.5); outline-offset: -2px }

/* Las secciones, en fichas que se arrastran de lado. Con seis departamentos no
   caben en una fila y partirlas en dos líneas mueve todo el contenido hacia
   abajo cada vez que se añade uno. */
.t-secs { display: flex; gap: 7px; padding: 0 16px 11px; overflow-x: auto;
  scrollbar-width: none }
.t-secs::-webkit-scrollbar { display: none }
.t-sec { flex-shrink: 0; border: none; background: rgba(255,255,255,.15);
  color: var(--t-marca-txt); font-family: var(--fuente); font-size: var(--fs-md);
  font-weight: var(--fw-semibold); padding: 8px 15px; border-radius: 999px;
  cursor: pointer; white-space: nowrap }
.t-sec-on { background: var(--t-marca-txt); color: var(--t-marca) }

/* ── LA CARTA ──────────────────────────────────────────────────────────────── */
.t-cuerpo { padding: 4px 0 0 }
.t-fam { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--t-suave);
  text-transform: uppercase; letter-spacing: .06em; padding: 18px 16px 7px }

.t-plato { display: flex; align-items: center; gap: 13px; padding: 11px 16px;
  border-bottom: 1px solid var(--t-linea); cursor: pointer; background: none;
  border-left: none; border-right: none; border-top: none; width: 100%;
  text-align: left; font-family: var(--fuente) }
.t-plato:active { background: var(--t-fondo) }
.t-foto, .t-sinfoto { width: 68px; height: 68px; border-radius: 12px; object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--t-linea) }
.t-sinfoto { border-style: dashed; display: flex; align-items: center; justify-content: center;
  color: var(--t-linea); font-size: 22px }
.t-plato-txt { flex: 1; min-width: 0 }
.t-plato-nom { font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: 1.25 }
/* La descripción a dos líneas y corta. Tres líneas en un teléfono empujan el
   plato siguiente fuera de la pantalla y se ven menos platos por pantalla, que
   es exactamente lo contrario de lo que quiere una carta. */
.t-plato-des { font-size: var(--fs-md); color: var(--t-suave); line-height: 1.4;
  margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden }
.t-plato-pre { font-size: var(--fs-xl); font-weight: var(--fw-extrabold);
  color: var(--t-marca); white-space: nowrap; text-align: right; flex-shrink: 0 }
.t-plato-desde { display: block; font-size: var(--fs-xs); font-weight: var(--fw-normal);
  color: var(--t-suave); text-transform: none; letter-spacing: 0 }
.t-plato-mod { font-size: var(--fs-xs); color: var(--t-acento);
  font-weight: var(--fw-semibold); margin-top: 3px }

.t-vacio { padding: 40px 20px; text-align: center; color: var(--t-suave);
  font-size: var(--fs-lg); line-height: 1.6 }

/* ── LA FICHA DEL PLATO ────────────────────────────────────────────────────
   Sube desde abajo y ocupa casi toda la pantalla. En un teléfono, un cuadro
   flotante en el medio deja los bordes visibles y se cierra sin querer al
   intentar desplazar. */
.t-fondo { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center }
.t-hoja { background: var(--t-tarjeta); width: 100%; max-width: var(--t-ancho);
  max-height: 94vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  overflow: hidden }
.t-hoja-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.42); color: #fff;
  font-size: 19px; cursor: pointer; z-index: 2; line-height: 1 }
.t-hoja-cuerpo { overflow-y: auto; flex: 1 }
.t-hoja-foto { width: 100%; height: 200px; object-fit: cover; display: block }
.t-hoja-sinfoto { width: 100%; height: 92px; background: var(--t-fondo);
  display: flex; align-items: center; justify-content: center; color: var(--t-linea);
  font-size: 30px }
.t-hoja-cab { padding: 15px 18px 4px }
.t-hoja-nom { font-size: 21px; font-weight: var(--fw-extrabold); line-height: 1.2 }
.t-hoja-des { font-size: var(--fs-lg); color: var(--t-suave); line-height: 1.5; margin-top: 5px
}
.t-hoja-pre { font-size: 19px; font-weight: var(--fw-extrabold); color: var(--t-marca);
  margin-top: 9px }

/* ── LOS GRUPOS DE MODIFICADORES ───────────────────────────────────────────── */
.t-grupo { padding: 16px 18px 4px; border-top: 1px solid var(--t-linea); margin-top: 14px }
.t-preg { font-size: var(--fs-xl); font-weight: var(--fw-bold) }
/* La regla, en la frase que ya escribimos en el ERP. Es la misma que el dueño ve
   al configurar el grupo, y eso no es casualidad: si el dueño y el comensal leen
   frases distintas de la misma regla, uno de los dos se equivoca. */
.t-regla { font-size: var(--fs-md); color: var(--t-acento); font-weight: var(--fw-semibold);
  margin: 2px 0 10px }
.t-regla.falta { color: var(--col-danger) }

.t-op { display: flex; align-items: center; gap: 11px; padding: 11px 0;
  border-bottom: 1px solid var(--t-linea); min-height: 44px }
.t-op:last-child { border-bottom: none }
.t-op-nom { flex: 1; min-width: 0; font-size: var(--fs-lg) }
.t-op-pre { font-size: var(--fs-md); color: var(--t-suave); white-space: nowrap;
  font-weight: var(--fw-semibold) }
.t-op-on .t-op-nom { font-weight: var(--fw-semibold) }

/* Casilla cuando solo cabe una; más y menos cuando caben varias. Un contador
   donde solo cabe uno invita a intentar poner dos. */
.t-marca-op { width: 22px; height: 22px; border: 2px solid var(--t-linea);
  border-radius: 7px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: transparent }
.t-op-on .t-marca-op { background: var(--t-acento); border-color: var(--t-acento);
  color: #fff }
.t-pasos { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0 }
.t-paso { width: 34px; height: 34px; border: 1px solid var(--t-linea); border-radius: 9px;
  background: var(--t-tarjeta); color: var(--t-marca); font-family: var(--fuente);
  font-size: 18px; font-weight: var(--fw-bold); line-height: 1; cursor: pointer; padding: 0 }
.t-paso:disabled { opacity: .3 }
.t-cuenta { min-width: 24px; text-align: center; font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold); font-variant-numeric: tabular-nums }

/* ── EL PIE DE LA FICHA ─────────────────────────────────────────────────────
   Cantidad y botón, siempre a la vista. Que el botón de agregar se vaya de la
   pantalla al desplazar por las opciones es lo que hace que alguien elija todo y
   luego no sepa cómo confirmar. */
.t-hoja-pie { border-top: 1px solid var(--t-linea); padding: 11px 16px;
  display: flex; align-items: center; gap: 12px; background: var(--t-tarjeta) }
.t-btn { flex: 1; height: 48px; border: none; border-radius: 12px;
  background: var(--t-marca); color: var(--t-marca-txt); font-family: var(--fuente);
  font-size: var(--fs-xl); font-weight: var(--fw-bold); cursor: pointer }
.t-btn:disabled { background: var(--t-linea); color: var(--t-suave); cursor: not-allowed }

/* ── LA BARRA DEL PEDIDO ───────────────────────────────────────────────────── */
.t-barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: var(--t-ancho); margin: 0 auto; height: var(--t-barra);
  background: var(--t-marca); color: var(--t-marca-txt); display: flex;
  align-items: center; gap: 12px; padding: 0 16px; cursor: pointer }
.t-barra[hidden] { display: none }
.t-barra-n { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-extrabold); font-size: var(--fs-lg); flex-shrink: 0 }
.t-barra-t { flex: 1; font-size: var(--fs-lg); font-weight: var(--fw-semibold) }
.t-barra-tot { font-size: 18px; font-weight: var(--fw-extrabold) }

/* ── EL PEDIDO ─────────────────────────────────────────────────────────────── */
.t-ped-lin { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--t-linea) }
.t-ped-c { width: 26px; height: 26px; border-radius: 8px; background: var(--t-fondo);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: var(--fs-md); font-weight: var(--fw-extrabold) }
.t-ped-txt { flex: 1; min-width: 0 }
.t-ped-nom { font-size: var(--fs-lg); font-weight: var(--fw-semibold) }
.t-ped-op { font-size: var(--fs-md); color: var(--t-suave); line-height: 1.45; margin-top: 2px }
.t-ped-pre { font-weight: var(--fw-bold); white-space: nowrap; font-size: var(--fs-lg) }
.t-ped-quitar { border: none; background: none; color: var(--col-danger);
  font-size: var(--fs-md); font-family: var(--fuente); cursor: pointer; padding: 3px 0;
  font-weight: var(--fw-semibold) }
.t-ped-tot { display: flex; justify-content: space-between; align-items: baseline;
  padding: 15px 0 4px; font-size: 19px; font-weight: var(--fw-extrabold) }

/* ── AVISO DE MAQUETA ───────────────────────────────────────────────────────
   Va arriba de todo y se ve. Una maqueta que no se anuncia se confunde con lo
   terminado, y alguien acaba enseñándosela a un cliente. */
.t-maqueta { background: var(--col-warn-bg); color: var(--col-warn-txt);
  border-bottom: 1px solid var(--col-warn-bd); font-size: var(--fs-sm);
  padding: 8px 16px; line-height: 1.5 }
.t-maqueta b { font-weight: var(--fw-bold) }
