/* ------------------------------------------------------------------
   Pachucrepas · Estilos del pedido en línea
   Sólo se carga en /menu/. Usa los mismos tokens de marca de home.css.
------------------------------------------------------------------ */

/* ---------- Aviso de "cómo pedir" en la portada del menú ---------- */

.como-pedir {
  margin: 18px 0 22px;
  padding: 15px 18px;
  border: 1.5px solid var(--azul);
  border-left-width: 5px;
  border-radius: 12px;
  background: #f3f7ff;
  font-size: 15.5px;
  line-height: 1.55;
}

/* ---------- Botón "Agregar" dentro de cada platillo ---------- */

/* El renglón del menú pasa de 2 a 3 columnas: nombre, precio y botón. */
.platillos li {
  grid-template-columns: 1fr auto auto;
}

.platillo-nombre { grid-column: 1; grid-row: 1; }
.platillo-precio { grid-column: 2; grid-row: 1; }
.platillo-desc   { grid-column: 1 / -1; grid-row: 2; }

.agregar {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1.5px solid var(--azul);
  border-radius: 999px;
  background: var(--blanco);
  color: var(--azul);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, transform .08s;
}

.agregar:hover  { background: var(--azul); color: #fff; }
.agregar:active { transform: translateY(1px); }

.agregar.agregado {
  background: #1d7a35;
  border-color: #1d7a35;
  color: #fff;
}

/* En pantallas chicas el botón baja a su propio renglón, alineado a la
   derecha, para no exprimir el nombre del platillo. */
@media (max-width: 480px) {
  .platillos li { grid-template-columns: 1fr auto; }
  .agregar {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    margin-top: 6px;
    /* Área táctil cómoda para el pulgar en celular. */
    min-height: 42px;
    padding: 0 18px;
    font-size: 14.5px;
  }
}

/* ---------- Tabla de zonas de reparto ---------- */

.zonas {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.zonas li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--borde);
  font-size: 15.5px;
}

.zonas li:last-child { border-bottom: 0; }

.zona-costo {
  font-weight: 800;
  color: var(--azul-osc);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.zona-costo--abierto {
  font-size: 14px;
  font-weight: 700;
  color: #a86a00;
}

/* ---------- Barra flotante con el total ---------- */

/* Se centra con left/right + margin auto, no con translateX: si se usa
   sólo `left:50%` el botón queda encerrado en media pantalla y el texto
   se parte en dos renglones. */
.barra-pedido {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 30;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--azul);
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(15, 86, 223, .38);
  transform: translateY(160%);
  transition: transform .28s ease;
}

.barra-pedido.visible { transform: translateY(0); }

.barra-conteo {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.barra-total {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .32);
  font-variant-numeric: tabular-nums;
}

/* Espacio al final de la página para que la barra no tape el contenido. */
body.con-barra { padding-bottom: 84px; }

html.sin-scroll { overflow: hidden; }

/* ---------- Panel del pedido ---------- */

.panel-pedido { display: none; }

.panel-pedido[open] {
  display: flex;
  flex-direction: column;
}

.panel-pedido {
  width: min(520px, calc(100% - 32px));
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: var(--radio);
  background: var(--blanco);
  color: var(--negro);
  box-shadow: 0 24px 60px rgba(18, 22, 31, .28);
}

.panel-pedido::backdrop { background: rgba(18, 22, 31, .55); }

.panel-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--borde);
}

.panel-titulo { font-size: 18px; }

.panel-cerrar {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--gris-claro);
  color: var(--negro);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.panel-cerrar:hover { background: var(--borde); }

.panel-cuerpo {
  overflow-y: auto;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

/* En celular el panel se comporta como hoja inferior. */
@media (max-width: 560px) {
  .panel-pedido {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: auto auto 0;
    border-radius: 20px 20px 0 0;
  }
}

/* ---------- Piezas comunes del panel ---------- */

.panel-intro,
.panel-aviso {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--gris);
  line-height: 1.5;
}

.panel-aviso { margin: 10px 0 16px; }

.panel-vacio {
  margin: 10px 0 20px;
  text-align: center;
  color: var(--gris);
  line-height: 1.6;
}

.boton.ancho {
  display: flex;
  width: 100%;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
}

.enlace {
  border: 0;
  padding: 0;
  background: none;
  color: var(--azul);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.enlace.centrado {
  display: block;
  margin: 14px auto 0;
  text-align: center;
}

/* ---------- Lista de productos del carrito ---------- */

.aviso-enviado {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff6e5;
  border: 1px solid #f5d9a3;
  font-size: 14px;
  line-height: 1.5;
}

.lineas { list-style: none; margin: 0 0 4px; padding: 0; }

.linea {
  padding: 14px 0;
  border-bottom: 1px solid var(--borde);
}

.linea:first-child { padding-top: 0; }

.linea-datos {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.linea-nombre { font-weight: 700; font-size: 15.5px; }

.linea-precio {
  font-weight: 800;
  color: var(--azul-osc);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.linea-controles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.contador {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--borde);
  border-radius: 999px;
  overflow: hidden;
}

.contador button {
  width: 40px;
  height: 40px;
  border: 0;
  background: var(--blanco);
  color: var(--azul);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.contador button:hover { background: var(--gris-claro); }

.contador span {
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.linea-nota { display: block; margin-top: 10px; }

.linea-nota > span {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gris);
}

.total-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 4px;
  font-size: 18px;
}

.total-fila b { font-size: 22px; color: var(--azul-osc); font-variant-numeric: tabular-nums; }

/* ---------- Elección de entrega ---------- */

.opciones-entrega {
  display: grid;
  gap: 12px;
  margin-bottom: 4px;
}

.tarjeta-opcion {
  display: grid;
  gap: 4px;
  padding: 18px;
  text-align: left;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  background: var(--blanco);
  font: inherit;
  color: var(--negro);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.tarjeta-opcion:hover {
  border-color: var(--azul);
  box-shadow: var(--sombra);
}

.tarjeta-icono { font-size: 26px; line-height: 1; }
.tarjeta-opcion b { font-size: 16.5px; }
.tarjeta-opcion > span:last-child { font-size: 14px; color: var(--gris); line-height: 1.45; }

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

.campo { display: block; margin-bottom: 16px; }

.etiqueta {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.req { color: #c0392b; }

.entrada {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  background: var(--blanco);
  color: var(--negro);
  font: inherit;
  font-size: 16px;   /* 16px evita que iOS haga zoom al enfocar */
}

.entrada:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(15, 86, 223, .15);
}

textarea.entrada { resize: vertical; min-height: 62px; }

.entrada.con-error {
  border-color: #c0392b;
  background: #fdf4f3;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 9px 14px;
  border: 1.5px solid var(--borde);
  border-radius: 999px;
  background: var(--blanco);
  color: var(--negro);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover { border-color: var(--azul); }

.chip.activo {
  background: var(--azul);
  border-color: var(--azul);
  color: #fff;
}

.error, .ok, .ayuda {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.45;
}

.error { color: #c0392b; font-weight: 600; }
.ok    { color: #1d7a35; font-weight: 600; }
.ayuda { color: var(--gris); }

.error:empty { margin: 0; }

/* ---------- Desglose de lo que se va a pagar ---------- */

.resumen-pedido {
  margin: 4px 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--gris-claro);
}

.fila-resumen {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  padding: 3px 0;
}

.fila-resumen b { font-variant-numeric: tabular-nums; }

.fila-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--borde);
  font-size: 16px;
  font-weight: 700;
}

.fila-total b { font-size: 20px; color: var(--azul-osc); }

/* Envío que todavía no tiene precio cerrado. */
.por-cotizar {
  font-size: 13.5px;
  font-weight: 700;
  color: #a86a00;
}

.nota-extras {
  margin: 12px 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--borde);
  font-size: 13px;
  color: var(--gris);
  line-height: 1.5;
}

/* El desplegable usa la misma caja que los campos de texto, pero con
   flecha propia porque Safari no respeta el estilo nativo. */
select.entrada {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6472' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px 8px;
  cursor: pointer;
}

/* ---------- Confirmación ---------- */

.listo { text-align: center; }

.listo-icono { font-size: 42px; line-height: 1; }

.listo-titulo { margin: 10px 0 6px; font-size: 17px; font-weight: 700; }

.folio {
  margin: 0 0 18px;
  padding: 12px;
  border-radius: 12px;
  background: var(--gris-claro);
  font-size: 15px;
}

.folio b { letter-spacing: 2px; font-size: 19px; color: var(--azul-osc); }

@media (prefers-reduced-motion: reduce) {
  .barra-pedido, .agregar, .tarjeta-opcion { transition: none; }
}
