/* ====================================================================
   PEDIDOS EN LINEA — SISTEMA VISUAL DEL CLIENTE

   Encargo: plataforma de marca blanca para restaurantes de barrio en
   Colombia. Quien la usa esta en un celular, con hambre, a veces con
   datos lentos, decidiendo en menos de dos minutos.

   Criterio: el protagonista es el restaurante, no la plataforma. El
   chasis es neutro y silencioso; el color y el logo los pone cada
   negocio. Una sola idea fuerte — la lamina blanca montada sobre la
   franja de color, con el logo a caballo — y el resto disciplinado.

   --marca la inyecta PHP desde restaurantes.color_marca.
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;800&display=swap');

:root {
  --marca: #1F4D3D;
  --marca-tenue: #F0F3F1;
  --marca-tenue: color-mix(in srgb, var(--marca) 7%, white);
  --marca-borde: #CFD8D3;
  --marca-borde: color-mix(in srgb, var(--marca) 22%, white);

  --fondo: #F3F4F1;
  --lienzo: #FFFFFF;
  --tinta: #16181A;
  --tenue: #6E7370;
  --linea: #E7E8E4;
  --alerta: #A32B1C;
  --alerta-fondo: #FCEFEC;
  --aviso: #7A5B08;
  --aviso-fondo: #FDF6E6;

  --radio: 14px;
  --radio-lamina: 26px;
  --ancho: 480px;
  --solapa: 30px;

  --sombra: 0 1px 2px rgba(20, 24, 22, .05), 0 8px 24px rgba(20, 24, 22, .07);
}

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

html { background: var(--fondo); }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

.envoltura {
  max-width: var(--ancho);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--lienzo);
}

/* --- Franja de marca y lamina ----------------------------------------
   La unica idea llamativa del diseno: la lamina blanca se monta sobre
   el color y el logo queda a caballo entre las dos. */

.marca {
  background: var(--marca);
  padding: 34px 24px calc(var(--solapa) + 30px);
  text-align: center;
  position: relative;
}

.marca__logo,
.marca__inicial {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  bottom: calc(var(--solapa) - 48px);
  transform: translateX(-50%);
  background: var(--lienzo);
  box-shadow: 0 0 0 5px var(--lienzo), 0 6px 20px rgba(20, 24, 22, .16);
  z-index: 3;
}

.marca__logo { object-fit: cover; display: block; }

.marca__inicial {
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--marca);
}

.marca__pie { display: none; }

.hoja {
  flex: 1;
  background: var(--lienzo);
  border-radius: var(--radio-lamina) var(--radio-lamina) 0 0;
  margin-top: calc(-1 * var(--solapa));
  position: relative;
  z-index: 1;
}

/* Si la pantalla abre con la foto de un plato, la foto hace de franja:
   la banda de color y el logo se retiran para no competir con ella. */
.marca--oculta { display: none; }
.hoja--foto { margin-top: 0; border-radius: 0; }

.hoja--foto > .identidad { padding-top: 26px; }

/* --- Identidad --------------------------------------------------------- */

.identidad { text-align: center; padding: 62px 26px 4px; }

.identidad h1 {
  margin: 0;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -.028em;
  line-height: 1.14;
}

.identidad p {
  margin: 9px auto 0;
  max-width: 32ch;
  color: var(--tenue);
  font-size: 15px;
  line-height: 1.45;
}

.identidad a { color: var(--marca); font-weight: 600; text-decoration: none; }
.identidad a:hover { text-decoration: underline; }

/* --- Contenido ---------------------------------------------------------- */

.contenido { padding: 26px; }

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 9px;
  letter-spacing: -.005em;
}

.ayuda { color: var(--tenue); font-size: 13.5px; line-height: 1.45; margin: 9px 0 0; }

/* --- Campo de celular ---------------------------------------------------
   El +57 va fijo: nadie deberia teclear el indicativo de su propio pais
   para pedir una pizza. */

.celular {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--linea);
  border-radius: var(--radio);
  background: var(--lienzo);
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.celular:focus-within {
  border-color: var(--marca);
  box-shadow: 0 0 0 4px var(--marca-tenue);
}

.celular__prefijo {
  display: flex;
  align-items: center;
  padding: 0 15px;
  background: var(--marca-tenue);
  color: var(--tenue);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.celular input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 17px 15px;
  font: inherit;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .045em;
  font-variant-numeric: tabular-nums;
  background: transparent;
  color: inherit;
}

.campo-texto {
  width: 100%;
  border: 1.5px solid var(--linea);
  border-radius: var(--radio);
  padding: 14px 15px;
  font: inherit;
  font-size: 15.5px;
  resize: vertical;
  background: var(--lienzo);
  color: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.campo-texto:focus {
  outline: none;
  border-color: var(--marca);
  box-shadow: 0 0 0 4px var(--marca-tenue);
}

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

.boton {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 17px;
  border: 0;
  border-radius: var(--radio);
  background: var(--marca);
  color: #fff;
  font: inherit;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: filter .16s ease, transform .08s ease;
}

.boton:hover { filter: brightness(1.09); }
.boton:active { transform: scale(.988); }
.boton:disabled { opacity: .38; cursor: not-allowed; transform: none; }

.boton--secundario {
  background: transparent;
  color: var(--marca);
  border: 1.5px solid var(--linea);
}

/* --- Tarjetas de eleccion -------------------------------------------------- */

.opciones { display: grid; gap: 11px; }

.opcion {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 17px;
  border: 1.5px solid var(--linea);
  border-radius: var(--radio);
  background: var(--lienzo);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.opcion:hover { border-color: var(--marca-borde); background: var(--marca-tenue); }

.opcion__icono {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--marca-tenue);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.opcion__titulo { font-weight: 600; display: block; letter-spacing: -.01em; }
.opcion__detalle { color: var(--tenue); font-size: 13.5px; line-height: 1.4; }

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

.aviso {
  padding: 14px 16px;
  border-radius: var(--radio);
  font-size: 14.5px;
  line-height: 1.45;
  margin-bottom: 20px;
  background: var(--marca-tenue);
}

.aviso--error   { background: var(--alerta-fondo); color: #7C2116; }
.aviso--cerrado { background: var(--aviso-fondo); color: var(--aviso); }

/* --- Cintillo de categorias --------------------------------------------------- */

/* El marco es lo que se pega arriba; la cinta de adentro es lo que se
   desplaza. Tienen que ser dos elementos distintos: si el degradado y
   las flechas vivieran dentro del contenedor que desplaza, se irian
   moviendo con las categorias. */
.cintillo-marco {
  position: sticky;
  top: 0;
  isolation: isolate;
  z-index: 6;
  background: var(--lienzo);
  border-bottom: 1px solid var(--linea);
}

.cintillo {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 14px 26px;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--linea) transparent;
}

.cintillo::-webkit-scrollbar { height: 5px; }
.cintillo::-webkit-scrollbar-track { background: transparent; }
.cintillo::-webkit-scrollbar-thumb { background: var(--linea); border-radius: 999px; }
.cintillo::-webkit-scrollbar-thumb:hover { background: var(--marca-borde); }

.cintillo a {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--fondo);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--tinta);
  white-space: nowrap;
  user-select: none;
  transition: background .16s ease, color .16s ease;
}

.cintillo a:hover { background: var(--marca-tenue); }

/* La categoria que se esta viendo, para no perderse con muchas */
.cintillo a.activa { background: var(--marca); color: #fff; font-weight: 600; }

/* Degradado que insinua que hay mas hacia ese lado */
.cintillo-marco::before,
.cintillo-marco::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 1px;
  width: 46px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 1;
}

.cintillo-marco::before {
  left: 0;
  background: linear-gradient(to right, var(--lienzo) 30%, transparent);
}

.cintillo-marco::after {
  right: 0;
  background: linear-gradient(to left, var(--lienzo) 30%, transparent);
}

.cintillo-marco--izq::before { opacity: 1; }
.cintillo-marco--der::after { opacity: 1; }

.cintillo__flecha {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid var(--linea);
  border-radius: 50%;
  background: var(--lienzo);
  color: var(--tinta);
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0 0 2px;
  box-shadow: 0 2px 8px rgba(20, 24, 22, .12);
}

.cintillo__flecha:hover { background: var(--marca); color: #fff; border-color: var(--marca); }
.cintillo__flecha--izq { left: 6px; }
.cintillo__flecha--der { right: 6px; }
.cintillo__flecha[hidden] { display: none; }

/* En tactil sobran las flechas: el dedo ya arrastra */
@media (hover: none) {
  .cintillo__flecha { display: none; }
  .cintillo { scrollbar-width: none; }
  .cintillo::-webkit-scrollbar { display: none; }
}

/* --- Carta --------------------------------------------------------------------- */

.categoria { margin-bottom: 34px; scroll-margin-top: 70px; }
.categoria:last-child { margin-bottom: 0; }

.categoria__titulo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.022em;
  color: var(--tinta);
  margin: 0 0 4px;
  padding: 0;
  border: 0;
}

.plato {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid var(--linea);
}

.plato:last-child { border-bottom: 0; }

.plato__cuerpo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.plato__nombre { font-weight: 600; font-size: 16.5px; letter-spacing: -.012em; }

.plato__desc {
  color: var(--tenue);
  font-size: 14px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plato__precio {
  font-weight: 600;
  font-size: 15.5px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.plato__desde { font-weight: 400; font-size: 13px; color: var(--tenue); }

.plato__lado {
  flex: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.plato--con-foto { align-items: center; padding: 19px 0; }

.plato__foto {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--fondo);
}

.plato__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

.plato__forma { margin: 0; }

.plato__mas {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1.5px solid var(--linea);
  background: var(--lienzo);
  color: var(--marca);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.plato__mas:hover { background: var(--marca); border-color: var(--marca); color: #fff; }

/* Con foto, el boton se monta en la esquina para no robarle ancho al texto */
.plato--con-foto .plato__mas,
.plato--con-foto .plato__forma {
  position: absolute;
  right: -8px;
  bottom: -8px;
  margin: 0;
}

.plato--con-foto .plato__mas {
  background: var(--marca);
  border-color: transparent;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 0 0 0 3px var(--lienzo);
}

/* --- Pantalla del plato ------------------------------------------------------- */

.plato-hero { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.grupo { border: 0; padding: 0; margin: 0 0 26px; }

.grupo__titulo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.015em;
  padding: 0;
  margin-bottom: 6px;
  border: 0;
}

.grupo__regla { font-weight: 400; font-size: 13px; color: var(--tenue); }

.opcion-fila {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--linea);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}

.opcion-fila:last-child { border-bottom: 0; }
.opcion-fila input { width: 21px; height: 21px; accent-color: var(--marca); flex: none; }
.opcion-fila__nombre { flex: 1; }
.opcion-fila__extra { color: var(--tenue); font-size: 14px; font-variant-numeric: tabular-nums; }

.opcion-fila__precio {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.cantidad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.cantidad__etiqueta { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }

.paso {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  background: var(--lienzo);
  margin: 0;
}

.paso__boton {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--marca);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background .16s ease;
}

.paso__boton:hover { background: var(--marca-tenue); }
.paso--chico .paso__boton { width: 36px; height: 36px; font-size: 17px; }

.paso__valor {
  min-width: 34px;
  text-align: center;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.paso__valor::-webkit-outer-spin-button,
.paso__valor::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- Carrito --------------------------------------------------------------------- */

.linea {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid var(--linea);
}

.linea__texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.linea__nombre { font-weight: 600; letter-spacing: -.012em; }
.linea__detalle { color: var(--tenue); font-size: 13.5px; line-height: 1.4; }

.linea__precio {
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.cuentas {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--fondo);
  border-radius: var(--radio);
  border: 0;
}

.cuentas__fila {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cuentas__fila--tenue { font-weight: 400; color: var(--tenue); font-size: 14.5px; }

.cuentas__fila--total {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--linea);
}

.acciones-menores {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  font-size: 14.5px;
}

.acciones-menores a { color: var(--marca); font-weight: 600; text-decoration: none; }
.acciones-menores a:hover { text-decoration: underline; }

.enlace-peligro {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--tenue);
  cursor: pointer;
}

.enlace-peligro:hover { color: var(--alerta); }

/* --- Barras del fondo -------------------------------------------------------------
   Pastilla flotante en vez de barra pegada al borde: deja ver que hay
   contenido debajo y no parte la pantalla en dos. */

.con-barra { padding-bottom: 108px; }

.barra-carrito,
.barra-accion {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(var(--ancho) - 32px), calc(100vw - 32px));
  box-sizing: border-box;
  z-index: 10;
}

.barra-carrito {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 20px;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  background: var(--marca);
  font-weight: 600;
  letter-spacing: -.01em;
  box-shadow: 0 6px 24px rgba(20, 24, 22, .22);
}

.barra-carrito__cuenta {
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.barra-carrito__total { margin-left: auto; font-variant-numeric: tabular-nums; }

.barra-accion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: var(--lienzo);
  box-shadow: var(--sombra);
}

.barra-accion .boton {
  margin-top: 0;
  flex: 1;
  text-align: center;
  text-decoration: none;
  padding: 15px;
}

.barra-accion__volver {
  flex: none;
  color: var(--tenue);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 12px;
}

/* --- Seguimiento --------------------------------------------------------------------- */

.ruta { list-style: none; margin: 8px 0 0; padding: 0 0 0 5px; }

.ruta__paso {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 17px;
  padding: 0 0 28px 0;
}

.ruta__paso:last-child { padding-bottom: 0; }

.ruta__paso:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 2px;
  width: 2px;
  background: var(--linea);
}

.ruta__paso--hecho:not(:last-child)::before { background: var(--marca); }

.ruta__punto {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--linea);
  background: var(--lienzo);
  z-index: 1;
}

.ruta__paso--hecho .ruta__punto {
  border-color: var(--marca);
  background: var(--marca);
  box-shadow: inset 0 0 0 3.5px var(--lienzo);
}

/* El paso en curso late suave. Es el unico movimiento de toda la
   interfaz y esta ahi para decir "esto sigue vivo". */
.ruta__paso--hecho:last-of-type .ruta__punto { animation: latido 2.6s ease-in-out infinite; }

@keyframes latido {
  0%, 100% { box-shadow: inset 0 0 0 3.5px var(--lienzo), 0 0 0 0 var(--marca-tenue); }
  50%      { box-shadow: inset 0 0 0 3.5px var(--lienzo), 0 0 0 8px var(--marca-tenue); }
}

.ruta__texto {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.ruta__nombre { color: var(--tenue); }
.ruta__paso--hecho .ruta__nombre { color: var(--tinta); font-weight: 600; }

.ruta__hora {
  color: var(--tenue);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ficha {
  margin-top: 24px;
  background: var(--fondo);
  border-radius: var(--radio);
  overflow: hidden;
}

.ficha__fila {
  display: flex;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--linea);
  font-size: 14.5px;
  line-height: 1.4;
}

.ficha__fila:last-child { border-bottom: 0; }
.ficha__fila > span:first-child { flex: none; width: 88px; color: var(--tenue); }
.ficha__fila > span:last-child { flex: 1; min-width: 0; }

/* --- Pie ----------------------------------------------------------------------------- */

.pie {
  padding: 26px 26px 34px;
  text-align: center;
  color: var(--tenue);
  font-size: 13px;
  line-height: 1.6;
  background: var(--lienzo);
}

.pie a { color: var(--tenue); }

/* --- Error --------------------------------------------------------------------------- */

.error-centro {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  background: var(--fondo);
}

.error-centro h1 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 10px; }
.error-centro p { color: var(--tenue); margin: 0; max-width: 34ch; line-height: 1.5; }

/* --- Base de calidad ------------------------------------------------------------------ */

:focus-visible { outline: 2.5px solid var(--marca); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* En pantallas anchas la lamina se despega del borde y flota */
@media (min-width: 620px) {
  .envoltura {
    margin: 28px auto;
    min-height: auto;
    border-radius: var(--radio-lamina);
    overflow: hidden;
    box-shadow: var(--sombra);
  }
  .pie { padding-bottom: 28px; }
}

/* --------------------------------------------------------------------
   El atributo hidden tiene que ganar siempre.

   Por defecto lo aplica el navegador con [hidden] { display: none },
   pero cualquier regla nuestra que fije un display lo pisa, porque los
   estilos del autor van por encima de los del navegador. Sin esta
   linea, todo elemento con clase y con hidden se sigue viendo.
   -------------------------------------------------------------------- */
[hidden] { display: none !important; }
