/* =========================================================================
   Estilos del sistema de pedidos.

   Los colores y la tipografía de cada negocio llegan como variables
   (--marca, --acento, --fondo, --fuente) desde templates/base.html,
   y se cambian en el panel → Configuración → Apariencia.
   ========================================================================= */
:root {
  --marca: #5b2e14;
  --marca-texto: #fff;
  --acento: #e0874f;
  --acento-texto: #1d1410;
  --fondo: #fff8f1;
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --superficie: #ffffff;
  --texto: #24170f;
  --texto-suave: #7a6a5f;
  --borde: rgba(60, 35, 20, 0.12);
  --ok: #1e8a5a;
  --peligro: #c0392b;
  --alerta: #b7791f;
  --radio: 20px;
  --sombra: 0 2px 6px rgba(60, 35, 20, 0.06), 0 10px 24px rgba(60, 35, 20, 0.07);
  --nav-alto: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; background: var(--fondo); color: var(--texto); font-family: var(--fuente); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
a { color: var(--marca); }
img { max-width: 100%; display: block; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.contenedor { max-width: 680px; margin: 0 auto; padding: 0 16px; }
body:not(.pagina-producto) main.contenedor:has(.lista-productos) { max-width: 1100px; }
.texto-suave { color: var(--texto-suave); font-size: .95rem; margin: 4px 0 0; }
.nota { font-style: italic; color: var(--texto-suave); font-size: .9rem; margin: 4px 0 0; }
.vacio { text-align: center; padding: 64px 0; color: var(--texto-suave); }
.vacio .boton { margin-top: 12px; }
.espacio-nav { height: calc(var(--nav-alto) + 24px); }
.espacio-boton { height: 120px; }
.titulo-seccion { font-size: 1.2rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--marca); margin: 26px 0 12px; }

/* ---------- Botones ---------- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; padding: 16px 26px; font: inherit; font-weight: 700; font-size: 1.02rem; text-decoration: none; cursor: pointer; transition: transform .1s, filter .15s; }
.boton:active { transform: scale(.98); }
.boton:hover { filter: brightness(1.08); }
.boton:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.boton-principal { background: var(--marca); color: var(--marca-texto); }
.boton-secundario { background: color-mix(in srgb, var(--marca) 10%, white); color: var(--marca); }
.boton-peligro { background: transparent; color: var(--peligro); box-shadow: inset 0 0 0 1.5px currentColor; }
.boton-ancho { width: 100%; }
.boton-chico { padding: 9px 16px; font-size: .9rem; }

/* ---------- Fotos de producto ----------
   Las fotos tienen fondo blanco: con "multiply" el blanco se funde con el
   fondo de color, así no se notan recuadros. */
:root { --foto-fondo: color-mix(in srgb, var(--acento) 13%, var(--fondo)); }
.foto-producto, .fila-img, .favorito-img, .producto-foto, .linea-img, .item-panel-img { background: var(--foto-fondo); }
.fila-img img, .favorito-img img, .producto-foto img, .linea-img img, .item-panel-img img { mix-blend-mode: multiply; object-fit: contain; width: 100%; height: 100%; }
.agotado img, .agotado .sin-foto { filter: grayscale(1); opacity: .5; }

/* ---------- Portada del menú ---------- */
.portada { background: var(--marca); color: var(--marca-texto); padding: 22px 20px 26px; border-radius: 0 0 28px 28px; }
.portada-con-imagen { background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.6)), var(--portada) center / cover; color: #fff; }
.portada-contenido { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "logo nombre instalar" "logo texto instalar" "estado estado estado"; column-gap: 14px; align-items: center; }
.portada-logo { grid-area: logo; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.portada h1 { grid-area: nombre; font-size: 1.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; align-self: end; }
.portada p { grid-area: texto; margin: 2px 0 0; opacity: .85; font-size: .95rem; align-self: start; }
.portada-contenido:not(:has(.portada-logo)) { grid-template-columns: 1fr auto; grid-template-areas: "nombre instalar" "texto instalar" "estado estado"; }
.estado-tienda { grid-area: estado; justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: rgba(255,255,255,.16); }
.estado-tienda::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.estado-tienda.cerrada::before { background: #f87171; }

.chips { position: sticky; top: 0; z-index: 15; background: color-mix(in srgb, var(--fondo) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chips-scroll { max-width: 1100px; margin: 0 auto; display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 16px; border-radius: 999px; background: var(--superficie); box-shadow: inset 0 0 0 1.5px var(--borde); color: var(--texto); text-decoration: none; font-weight: 600; font-size: .9rem; }
.chip.activa, .chip:hover { background: var(--marca); color: var(--marca-texto); box-shadow: none; }

.banner-pedido { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 18px; border-radius: 16px; background: var(--acento); color: var(--acento-texto); text-decoration: none; font-weight: 600; }

/* ---------- Favoritos (carrusel) ---------- */
.carrusel { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
.carrusel::-webkit-scrollbar { display: none; }
.favorito { flex: none; width: 140px; text-decoration: none; color: var(--texto); scroll-snap-align: start; }
.favorito-img { height: 150px; border-radius: 18px; overflow: hidden; margin-bottom: 8px; padding: 10px; }
.favorito .tarjeta-nombre { display: block; font-weight: 700; font-size: .92rem; line-height: 1.25; }
.tarjeta-precio { color: var(--marca); font-weight: 700; }

/* ---------- Lista de productos (filas, cómodas en el celular) ---------- */
.lista-productos { display: grid; gap: 10px; }
.fila-producto { position: relative; background: var(--superficie); border-radius: 18px; box-shadow: var(--sombra); }
.fila-enlace { display: flex; gap: 14px; align-items: center; padding: 10px 54px 10px 10px; text-decoration: none; color: inherit; min-height: 108px; }
.fila-img { flex: none; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; padding: 6px; }
.fila-texto { min-width: 0; }
.fila-texto h3 { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.fila-texto p { color: var(--texto-suave); font-size: .84rem; margin: 3px 0 6px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fila-precio { font-weight: 700; color: var(--marca); }
.sello-agotado { display: inline-block; background: #eee; color: #666; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.fila-producto > form, .fila-producto > .boton-mas { position: absolute; right: 12px; bottom: 12px; }
.boton-mas { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--marca); color: var(--marca-texto); font-size: 1.35rem; line-height: 36px; text-align: center; text-decoration: none; cursor: pointer; display: block; padding: 0; font-family: inherit; }
@media (min-width: 700px) { .lista-productos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .lista-productos { grid-template-columns: repeat(3, 1fr); } }

.sin-foto { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; font-size: 2rem; color: rgba(255,255,255,.92); border-radius: inherit; }
.sin-foto-0 { background: #c79b74; } .sin-foto-1 { background: #a3785a; } .sin-foto-2 { background: #8fb59a; }
.sin-foto-3 { background: #d99a86; } .sin-foto-4 { background: #9d8bc4; } .sin-foto-5 { background: #c9a86a; }

/* ---------- Página de producto ---------- */
.pagina-producto { background: var(--superficie); }
.barra-superior { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 6px; padding: 8px 8px; background: color-mix(in srgb, var(--foto-fondo) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.barra-superior-titulo { font-weight: 700; color: var(--marca); }
.volver { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--marca); text-decoration: none; background: var(--superficie); box-shadow: var(--sombra); }
.volver svg { width: 24px; height: 24px; stroke-width: 2.4; }
.producto-foto { height: min(42vh, 360px); min-height: 240px; padding: 8px 24px 24px; display: grid; place-items: center; border-radius: 0 0 32px 32px; }
.producto-foto img { max-height: 100%; width: auto; }
.producto-foto .sin-foto { width: 200px; height: 200px; border-radius: 40px; font-size: 4.5rem; }
.producto-detalle { max-width: 640px; margin: 0 auto; padding: 22px 20px 140px; }
.producto-nombre { font-size: 1.75rem; font-weight: 800; color: var(--marca); line-height: 1.15; }
.producto-desc { color: var(--texto-suave); font-size: 1.02rem; margin: 8px 0 0; }
.producto-precio { font-size: 1.35rem; font-weight: 800; margin: 10px 0 0; }
.subtitulo { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; color: var(--marca); margin: 28px 0 12px; }
.etiqueta-suave { font-size: .75rem; font-weight: 600; color: var(--texto-suave); background: var(--fondo); padding: 3px 10px; border-radius: 999px; text-transform: none; letter-spacing: 0; }
.campo .etiqueta-suave { margin-left: 6px; }
.pagina-producto .campo { margin-top: 22px; }
@media (min-width: 900px) {
  .producto { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; max-width: 1100px; margin: 0 auto; column-gap: 40px; padding: 0 24px; }
  .barra-superior { grid-column: 1 / -1; background: transparent; backdrop-filter: none; padding: 16px 0; }
  .producto-foto { position: sticky; top: 20px; height: 520px; border-radius: 32px; align-self: start; }
  .producto-detalle { margin: 0; padding-top: 0; }
  .pagina-producto { background: var(--fondo); }
}

/* Botones redondos (opción destacada: tipo de leche, tamaños...) */
.personaliza-intro { margin: -6px 0 6px; }
.grupo-botones { background: var(--foto-fondo); border-radius: 18px; padding: 14px 12px 16px; margin-top: 12px; }
.grupo-titulo { font-size: 1rem; font-weight: 700; margin: 0 6px 12px; }
.botones-redondos { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.boton-redondo { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; padding: 4px 2px; line-height: 1.25; }
.boton-redondo strong { font-size: .92rem; }
.boton-redondo input { position: absolute; opacity: 0; pointer-events: none; }
.boton-redondo .circulo { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--superficie); box-shadow: inset 0 0 0 1.5px var(--borde); color: var(--marca); margin-bottom: 8px; transition: background .15s, color .15s; }
.boton-redondo .circulo svg { width: 28px; height: 28px; }
.boton-redondo input:checked + .circulo { background: var(--marca); color: var(--marca-texto); box-shadow: 0 4px 12px color-mix(in srgb, var(--marca) 35%, transparent); }
.boton-redondo:has(input:checked) strong { color: var(--marca); }
.boton-redondo input:focus-visible + .circulo { outline: 3px solid var(--acento); outline-offset: 3px; }
.boton-redondo small { color: var(--texto-suave); }
.boton-redondo em { font-style: normal; color: var(--texto-suave); font-weight: 600; font-size: .82rem; margin-top: 2px; }

/* Desplegables (personalización) */
.desplegable { background: var(--superficie); border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--borde); margin-top: 10px; overflow: hidden; }
.desplegable summary { list-style: none; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 14px 18px; cursor: pointer; min-height: 56px; }
.desplegable summary::-webkit-details-marker { display: none; }
.desplegable-titulo { font-weight: 700; }
.requerido { color: var(--acento); margin-left: 4px; }
.desplegable-resumen { grid-column: 1; color: var(--texto-suave); font-size: .9rem; margin-top: 2px; }
.desplegable-resumen.elegido { color: var(--marca); font-weight: 600; }
.desplegable .flecha { grid-column: 2; grid-row: 1 / span 2; color: var(--marca); stroke-width: 2.4; transition: transform .2s; }
.desplegable[open] .flecha { transform: rotate(180deg); }
.desplegable-opciones { border-top: 1px solid var(--borde); }
.opcion { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; min-height: 52px; }
.opcion + .opcion { border-top: 1px solid var(--borde); }
.opcion input { width: 22px; height: 22px; accent-color: var(--marca); margin: 0; flex: none; }
.opcion-nombre { flex: 1; }
.opcion-precio { color: var(--texto-suave); font-weight: 600; font-size: .92rem; }
.opcion-agotada, .opcion-bloqueada { opacity: .4; cursor: not-allowed; }

/* Cantidad */
.cantidad { flex: none; display: flex; align-items: center; gap: 2px; background: var(--fondo); border-radius: 999px; padding: 4px; }
.cantidad button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--superficie); color: var(--marca); cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cantidad button svg { width: 20px; height: 20px; stroke-width: 2.2; }
.cantidad input { width: 36px; text-align: center; border: 0; background: none; font: inherit; font-size: 1.15rem; font-weight: 700; -moz-appearance: textfield; color: var(--texto); padding: 0; }
.cantidad input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cantidad-chica { padding: 3px; }
.cantidad-chica button { width: 32px; height: 32px; }
.cantidad-chica button svg { width: 16px; height: 16px; }
.cantidad-chica span { min-width: 24px; text-align: center; font-weight: 700; }

/* Barras fijas abajo */
.barra-accion { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--superficie); box-shadow: 0 -6px 24px rgba(60, 35, 20, .1); border-radius: 22px 22px 0 0; }
.barra-contenido { max-width: 640px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.barra-contenido > .boton { flex: 1; }
.boton-agregar, .barra-contenido > .boton-principal { justify-content: space-between; padding: 15px 22px; }
.boton-agregar:disabled, .boton-agregar:only-child { justify-content: center; }
.barra-accion.con-nav { bottom: calc(var(--nav-alto) + env(safe-area-inset-bottom)); background: transparent; box-shadow: none; padding-bottom: 10px; }
.nav-inferior { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 12px; height: calc(var(--nav-alto) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--superficie); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgba(60, 35, 20, .08); }
.nav-inferior a { position: relative; flex: 0 1 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--texto-suave); font-size: .78rem; font-weight: 600; }
.nav-inferior a.activa { color: var(--marca); }
.nav-inferior a.activa::after { content: ""; position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--marca); }
.nav-inferior svg { width: 24px; height: 24px; }
.nav-burbuja { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--acento); color: var(--acento-texto); font-size: .72rem; display: grid; place-items: center; }

/* ---------- Encabezados simples ---------- */
.encabezado { position: sticky; top: 0; z-index: 10; background: var(--fondo); padding: 22px 20px 12px; max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.encabezado h1 { font-size: 1.7rem; font-weight: 800; text-transform: uppercase; color: var(--marca); }
.encabezado-con-volver { padding-left: 8px; }
.encabezado .volver { color: var(--marca); }

/* ---------- Avisos ---------- */
.avisos { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 50; max-width: 560px; margin: 0 auto; animation: desaparecer 4s forwards; pointer-events: none; }
@keyframes desaparecer { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.aviso { padding: 14px 18px; border-radius: 16px; margin: 12px 0; font-size: .95rem; font-weight: 500; }
.avisos .aviso { box-shadow: var(--sombra); }
.aviso-success { background: #e3f5ea; color: #155c3a; }
.aviso-info { background: #fdf1e4; color: #7a4310; }
.aviso-error { background: #fdecea; color: #8e2a1f; }

/* ---------- Formularios, tarjetas, carrito ---------- */
.campo { display: block; margin-top: 18px; }
.campo-etiqueta { display: block; font-size: .9rem; font-weight: 700; margin-bottom: 8px; }
.campo input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .campo select, .campo textarea { width: 100%; padding: 15px 18px; border: 0; box-shadow: inset 0 0 0 1.5px var(--borde); border-radius: 16px; font: inherit; background: var(--superficie); color: var(--texto); }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--marca); }
.campo-error input { box-shadow: inset 0 0 0 2px var(--peligro) !important; }
.campo-mensaje { display: block; color: var(--peligro); font-size: .85rem; margin-top: 6px; }
.tarjeta { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: 20px 22px; margin-top: 16px; }
.tarjeta-destacada { box-shadow: inset 0 0 0 2px var(--acento), var(--sombra); }
.tarjeta-titulo { font-size: 1.1rem; font-weight: 800; color: var(--marca); }
.tarjeta .campo:first-of-type { margin-top: 12px; }
.pastillas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pastilla { position: relative; }
.pastilla input { position: absolute; opacity: 0; }
.pastilla span { display: inline-block; padding: 11px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--borde); cursor: pointer; font-weight: 600; font-size: .92rem; }
.pastilla input:checked + span { background: var(--marca); color: var(--marca-texto); box-shadow: none; }
.pastilla input:focus-visible + span { outline: 3px solid var(--acento); outline-offset: 2px; }
.lista-opciones { margin: 10px -22px 0; }
.datos-pago { display: flex; flex-direction: column; gap: 2px; background: var(--fondo); border-radius: 16px; padding: 16px 18px; margin-top: 12px; }
.dato-grande { font-size: 1.6rem; font-weight: 800; letter-spacing: .03em; color: var(--marca); }

.lista-carrito { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
.linea { display: flex; gap: 14px; background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px; }
.linea-img { flex: none; width: 72px; height: 84px; border-radius: 14px; overflow: hidden; background: var(--fondo); display: grid; place-items: center; }
.linea-img img { width: 100%; height: 100%; object-fit: contain; }
.linea-img .sin-foto { font-size: 1.6rem; }
.linea-info { flex: 1; min-width: 0; }
.linea-info h3 { font-size: 1.02rem; }
.linea-pie { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.linea-pie .tarjeta-precio { padding: 0; }
.enlace-agregar { display: block; margin: 18px 0; font-weight: 700; text-decoration: none; }
.fila { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.fila-item { align-items: flex-start; }
.fila-total { border-top: 1px solid var(--borde); margin-top: 8px; padding-top: 14px; font-size: 1.15rem; }

/* ---------- Estado del pedido ---------- */
.estado-hero { background: var(--marca); color: var(--marca-texto); text-align: center; padding: 34px 20px 30px; border-radius: 0 0 32px 32px; }
.estado-hero p { margin: 0; opacity: .85; }
.estado-hero h1 { font-size: 3.6rem; font-weight: 800; }
.estado-hero .estado-texto { opacity: 1; font-size: 1.2rem; font-weight: 700; margin-top: 4px; }
.pasos { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 26px 0 6px; }
.pasos li { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .8rem; color: var(--texto-suave); position: relative; }
.pasos li span { width: 18px; height: 18px; border-radius: 50%; background: var(--superficie); box-shadow: inset 0 0 0 2px var(--borde); z-index: 1; }
.pasos li + li::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; height: 3px; background: var(--borde); }
.pasos li.hecho span { background: var(--marca); box-shadow: none; }
.pasos li.hecho + li.hecho::before { background: var(--marca); }
.pasos li.actual { color: var(--marca); font-weight: 700; }
.pasos li.actual span { box-shadow: 0 0 0 5px color-mix(in srgb, var(--marca) 20%, transparent); }
#estado-pedido > .boton { margin-top: 18px; }

/* ---------- Etiquetas ---------- */
.etiqueta { display: inline-block; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--marca) 10%, white); color: var(--marca); font-size: .78rem; font-weight: 700; }
.etiqueta-ok { background: #e3f5ea; color: var(--ok); }
.etiqueta-alerta { background: #fdf1e4; color: var(--alerta); }
.etiqueta-apagada { background: #eee; color: #777; }

/* ---------- Comandas (pantalla del negocio) ---------- */
.pantalla-comandas { background: #f3ede7; --fuente: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.comandas-barra { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--superficie); box-shadow: 0 1px 0 var(--borde); }
.comandas-acciones { display: flex; align-items: center; gap: 8px; }
.comandas-main { padding: 12px; }
.columnas { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.columna h2 { font-size: 1rem; padding: 8px 4px; display: flex; gap: 8px; align-items: center; }
.contador-columna { background: var(--texto); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: .8rem; }
.columna-nuevo h2 { color: var(--peligro); }
.columna-preparando h2 { color: var(--alerta); }
.columna-listo h2 { color: var(--ok); }
.columna-vacia { color: var(--texto-suave); text-align: center; padding: 24px 0; border: 2px dashed var(--borde); border-radius: 14px; }
.comanda { background: var(--superficie); border-radius: 14px; box-shadow: var(--sombra); padding: 14px; margin-bottom: 12px; border-left: 6px solid var(--borde); }
.columna-nuevo .comanda { border-left-color: var(--peligro); }
.columna-preparando .comanda { border-left-color: var(--alerta); }
.columna-listo .comanda { border-left-color: var(--ok); }
.comanda-recien { animation: parpadeo 1s ease-in-out 4; }
@keyframes parpadeo { 50% { box-shadow: 0 0 0 4px rgba(192,57,43,.35); } }
.comanda-cabecera { display: flex; justify-content: space-between; align-items: baseline; }
.comanda-numero { font-size: 1.5rem; font-weight: 800; }
.comanda-hora { font-size: .8rem; color: var(--texto-suave); }
.comanda-cliente, .comanda-direccion { margin: 6px 0; font-size: .92rem; }
.comanda-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.comanda-items { padding-left: 0; list-style: none; margin: 10px 0; border-top: 1px dashed var(--borde); }
.comanda-items > li { padding: 8px 0; border-bottom: 1px dashed var(--borde); }
.comanda-items ul { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; color: var(--texto-suave); }
.comanda-pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0; font-size: .9rem; }
.comanda-total { font-weight: 800; font-size: 1.1rem; }
.comanda-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.comanda-botones .boton-principal { flex: 1 1 100%; }
.comanda-botones .boton { padding: 12px 16px; font-size: .95rem; }
.comanda-botones .boton:not(.boton-principal) { flex: 1; }

@media (max-width: 800px) { .columnas { grid-template-columns: 1fr; } }
@media (min-width: 640px) {
  .portada h1 { font-size: 2.4rem; }
}

/* =========================================================================
   Panel del negocio
   ========================================================================= */
.panel { --fuente: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f6f3f0; }
.panel-cabecera { position: sticky; top: 0; z-index: 20; background: var(--marca); color: var(--marca-texto); }
.panel-cabecera-fila { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.panel-marca { display: flex; align-items: center; gap: 10px; font-weight: 800; color: inherit; text-decoration: none; }
.panel-marca img { width: 34px; height: 34px; border-radius: 50%; background: #fff; object-fit: cover; }
.panel-cabecera .boton-chico { background: rgba(255,255,255,.15); color: inherit; }
.panel-tabs { max-width: 1080px; margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.panel-tabs a { flex: none; padding: 10px 14px 12px; color: inherit; opacity: .75; text-decoration: none; font-weight: 600; font-size: .93rem; border-bottom: 3px solid transparent; }
.panel-tabs a.activa { opacity: 1; border-bottom-color: var(--acento); }
.panel-main { max-width: 1080px; margin: 0 auto; padding: 20px 20px 60px; }
.panel h1 { font-size: 1.5rem; font-weight: 800; margin: 6px 0 4px; }
.panel h2 { font-size: 1.1rem; font-weight: 800; }
.panel .tarjeta { border-radius: 16px; }
.panel-titulo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.metrica { background: var(--superficie); border-radius: 16px; box-shadow: var(--sombra); padding: 18px; }
.metrica span { color: var(--texto-suave); font-size: .85rem; font-weight: 600; }
.metrica strong { display: block; font-size: 1.7rem; font-weight: 800; margin-top: 4px; }
.interruptor-tienda { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tabla { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tabla th { text-align: left; color: var(--texto-suave); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; }
.tabla td { padding: 12px 10px; border-top: 1px solid var(--borde); vertical-align: middle; }
.tabla .num { text-align: right; white-space: nowrap; }
.lista-panel { list-style: none; margin: 0; padding: 0; }
.item-panel { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--borde); }
.item-panel:first-child { border-top: 0; }
.item-panel-img { flex: none; width: 54px; height: 54px; border-radius: 12px; overflow: hidden; background: var(--fondo); display: grid; place-items: center; }
.item-panel-img img { width: 100%; height: 100%; object-fit: contain; }
.item-panel-img .sin-foto { font-size: 1.2rem; }
.item-panel-info { flex: 1; min-width: 0; }
.item-panel-info a { color: var(--texto); font-weight: 700; text-decoration: none; }
.item-panel-info a:hover { text-decoration: underline; }
.item-panel-info small { display: block; color: var(--texto-suave); }
.interruptores { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.interruptor { border: 0; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.interruptor.encendido { background: #e3f5ea; color: var(--ok); }
.interruptor.apagado { background: #eee; color: #888; }
.interruptor.agotado { background: #fdecea; color: var(--peligro); }
.formulario { display: grid; gap: 4px; }
.formulario .campo { margin-top: 14px; }
.ayuda { display: block; color: var(--texto-suave); font-size: .82rem; margin-top: 6px; }
.casilla { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; cursor: pointer; }
.casilla input { width: 20px; height: 20px; accent-color: var(--marca); margin-top: 2px; flex: none; }
.casillas-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.casillas-grupos label { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.casillas-grupos input { width: 18px; height: 18px; accent-color: var(--marca); }
.radios label { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.radios input { accent-color: var(--marca); width: 18px; height: 18px; }
.radios div, .casillas-grupos div { display: contents; }
.dos-columnas { display: grid; grid-template-columns: 1fr; gap: 0 20px; }
@media (min-width: 760px) { .dos-columnas { grid-template-columns: 1fr 1fr; } }
.acciones-form { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.tabla-opciones input:not([type=checkbox]) { width: 100%; padding: 10px 12px; border: 0; box-shadow: inset 0 0 0 1.5px var(--borde); border-radius: 10px; font: inherit; }
.tabla-opciones input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--marca); }
.tabla-opciones td { padding: 6px; border: 0; }
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.subnav a { padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .92rem; background: var(--superficie); color: var(--texto); box-shadow: inset 0 0 0 1.5px var(--borde); }
.subnav a.activa { background: var(--marca); color: var(--marca-texto); box-shadow: none; }
.vista-previa { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.vista-previa img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--fondo); }
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.entrar .tarjeta { width: 100%; max-width: 400px; padding: 32px 28px; }
.entrar h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.panel .avisos { top: auto; bottom: 16px; }

/* Horario */
.tabla-horario { display: grid; gap: 8px; margin-top: 12px; }
.fila-horario { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--borde); }
.fila-horario label { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--texto-suave); }
.fila-horario input[type=time] { padding: 9px 10px; border: 0; box-shadow: inset 0 0 0 1.5px var(--borde); border-radius: 10px; font: inherit; width: 100%; min-width: 0; }
.casilla-chica input { width: 18px; height: 18px; accent-color: var(--marca); }
.fila-horario .campo-mensaje { grid-column: 1 / -1; }
@media (max-width: 560px) { .fila-horario { grid-template-columns: 1fr 1fr; } .fila-horario strong { grid-column: 1 / -1; } }

/* Botón de WhatsApp en comandas */
.comanda-botones .boton-whatsapp { background: #25d366; color: #fff; flex: 1 1 100%; }
.boton-whatsapp svg { width: 20px; height: 20px; }
.auto-imprimir { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.auto-imprimir input { width: 18px; height: 18px; accent-color: var(--marca); }
@media (max-width: 640px) { .comandas-barra { flex-wrap: wrap; } .comandas-acciones { flex-wrap: wrap; } #reloj { display: none; } }

/* Mesa (cuando el cliente entra por el QR de una mesa) */
.banner-mesa { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: 16px; background: var(--superficie); box-shadow: inset 0 0 0 1.5px var(--acento); }
.banner-mesa svg { flex: none; color: var(--acento); }

/* Hoja de códigos QR (se imprime y se recorta) */
.qr-controles { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.qr-controles .campo { margin: 0; width: 160px; }
.hoja-qr { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.qr-tarjeta { background: #fff; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--marca); padding: 18px 14px; text-align: center; break-inside: avoid; color: #1d1410; }
.qr-tarjeta img { width: 150px; height: 150px; margin: 8px auto; }
.qr-tarjeta .qr-logo { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto; }
.qr-tarjeta strong { display: block; font-size: 1.4rem; color: var(--marca); }
.qr-tarjeta small { color: #555; }
@media print {
  .panel-cabecera, .no-imprimir, .avisos { display: none !important; }
  .panel, .panel-main { background: #fff; padding: 0; }
  .hoja-qr { grid-template-columns: repeat(3, 1fr); gap: 10mm; }
}

/* Vista previa de la comanda */
.vista-comanda { border: 0; border-radius: 20px; padding: 0; width: min(420px, 94vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.vista-comanda::backdrop { background: rgba(30, 20, 15, .55); }
.vista-comanda[open] { display: flex; flex-direction: column; }
.vista-comanda header, .vista-comanda footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; }
.vista-comanda footer { flex-direction: column; border-top: 1px solid var(--borde); }
.vista-papel { flex: 1; min-height: 0; background: #ecebe8; padding: 14px; overflow: auto; }
.vista-papel iframe { display: block; width: 100%; height: 58vh; border: 0; background: #fff; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }

/* Antibots: campo trampa fuera de la vista (no usar display:none, algunos bots lo detectan) */
.trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.casilla-cliente { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: .92rem; cursor: pointer; }
.casilla-cliente input { width: 20px; height: 20px; accent-color: var(--marca); flex: none; margin-top: 1px; }
.cf-turnstile { margin-top: 16px; display: flex; justify-content: center; }

/* App instalable */
.instalar-app { grid-area: instalar; align-self: start; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; font-weight: 700; background: rgba(255,255,255,.18); color: inherit; cursor: pointer; }
.instalar-app svg { width: 18px; height: 18px; }
.ayuda-ios ol { margin: 0; padding: 4px 22px 22px 40px; line-height: 1.6; }

/* Chat */
.chat-mensajes { display: flex; flex-direction: column; gap: 8px; max-height: 320px; min-height: 90px; overflow-y: auto; padding: 12px 2px; }
.chat-dialogo .chat-mensajes { max-height: none; flex: 1; min-height: 260px; padding: 14px 16px; background: var(--fondo); }
.chat-vacio { color: var(--texto-suave); font-size: .9rem; text-align: center; margin: auto 0; }
.burbuja-chat { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: .95rem; line-height: 1.35; display: flex; flex-direction: column; gap: 2px; word-wrap: break-word; }
.burbuja-chat small { font-size: .7rem; opacity: .7; align-self: flex-end; }
.burbuja-chat.mia { align-self: flex-end; background: var(--marca); color: var(--marca-texto); border-bottom-right-radius: 6px; }
.burbuja-chat.suya { align-self: flex-start; background: var(--superficie); box-shadow: inset 0 0 0 1.5px var(--borde); border-bottom-left-radius: 6px; }
.chat-enviar { display: flex; gap: 8px; padding-top: 8px; }
.chat-dialogo .chat-enviar { padding: 12px 16px 16px; }
.chat-enviar input { flex: 1; min-width: 0; padding: 13px 16px; border: 0; box-shadow: inset 0 0 0 1.5px var(--borde); border-radius: 999px; font: inherit; }
.chat-enviar input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--marca); }
.chat-enviar .boton { padding: 12px 18px; }
.respuestas-rapidas { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 0; scrollbar-width: none; }
.respuestas-rapidas button { flex: none; border: 0; border-radius: 999px; padding: 8px 12px; font: inherit; font-size: .82rem; background: color-mix(in srgb, var(--marca) 9%, white); color: var(--marca); cursor: pointer; }
.chat-dialogo { height: min(640px, 92vh); }
.boton-chat.con-mensajes { background: var(--acento); color: var(--acento-texto); }
.globo { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--peligro); font-size: .75rem; }
.aviso-listo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.aviso-listo small { display: block; }
