/* =====================================================================
   app.css — Estilos de La Popular · Ventas
   Colores y medidas en variables (cámbialos aquí). Sin degradados.
   ===================================================================== */
:root {
  --barra: #12263F;          /* barra lateral azul marino */
  --barra-texto: #C9D3E0;
  --acento: #F0761E;         /* naranja */
  --acento-osc: #D4620F;
  --acento-suave: #FDEBDD;
  --fondo: #F7F9FB;
  --sup: #FFFFFF;
  --ok: #16A34A;  --ok-suave: #DCFCE7;  --ok-texto: #15803D;
  --aviso: #D97706; --aviso-suave: #FEF3C7; --aviso-texto: #92400E;
  --peligro: #DC2626; --peligro-suave: #FEE2E2; --peligro-texto: #B91C1C;
  --info: #2563EB; --info-suave: #DBEAFE; --info-texto: #1D4ED8;
  --borde: #E5E9EF;
  --texto: #111417; --texto-2: #5B6570; --texto-3: #9AA4B0;
  --r1: 6px; --r2: 10px; --r3: 14px; --r4: 999px;
  --ancho-barra: 240px;
  --fuente: -apple-system, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  --toque: 48px;             /* alto mínimo de botones (≥ 44 px) */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--fuente); font-size: 15px; line-height: 1.4; color: var(--texto); background: var(--fondo);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
body.con-modal { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.num, .monto, td.num, .tabular { font-variant-numeric: tabular-nums; }
.sub { color: var(--texto-2); font-size: 13px; }
.terc { color: var(--texto-3); }
.rojo { color: var(--peligro-texto); }
.verde { color: var(--ok-texto); }
.azul { color: var(--info); }
.naranja { color: var(--acento); }
.ambar { color: var(--aviso-texto); }
.negrita { font-weight: 700; }
.oculto { display: none !important; }
.derecha { text-align: right; }
.centro { text-align: center; }

/* ---------------- Carga ---------------- */
.cargando { position: fixed; inset: 0; background: var(--barra); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; z-index: 50; }
.cargando-logo { font-size: 32px; font-weight: 800; letter-spacing: .5px; }
body.listo .cargando { display: none; }

/* ---------------- Estructura ---------------- */
.app { display: flex; min-height: 100vh; }
.barra { width: var(--ancho-barra); flex: none; background: var(--barra); color: #fff; display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; padding: 24px 12px calc(16px + env(safe-area-inset-bottom)); }
.marca { padding: 0 12px 28px; }
.marca-nombre { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.marca-sub { font-size: 11px; letter-spacing: 1.2px; color: var(--barra-texto); margin-top: 2px; }
.nav-lateral { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: var(--r2);
  color: var(--barra-texto); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.activo { background: var(--acento); color: #fff; font-weight: 600; }
.vendedor-actual { background: transparent; border: 0; color: #fff; text-align: left; padding: 12px; border-radius: var(--r2);
  display: flex; flex-direction: column; min-height: 56px; cursor: pointer; margin-top: 8px; }
.vendedor-actual:hover { background: rgba(255,255,255,.06); }
.vend-nombre { font-weight: 700; font-size: 15px; }
.vend-sub { font-size: 12px; color: var(--barra-texto); }

.principal { flex: 1; margin-left: var(--ancho-barra); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.encabezado { background: var(--sup); border-bottom: 1px solid var(--borde); padding: 16px 28px; display: flex; align-items: center;
  gap: 16px; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.enc-textos { min-width: 0; }
.encabezado h1 { font-size: 24px; line-height: 1.2; }
.enc-derecha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.acciones-encabezado { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-estado { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r4); font-size: 12px;
  font-weight: 600; white-space: nowrap; }
.chip-estado .punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-estado.ok { background: var(--ok-suave); color: var(--ok-texto); }
.chip-estado.info { background: var(--info-suave); color: var(--info-texto); }
.chip-estado.peligro { background: var(--peligro-suave); color: var(--peligro-texto); }
.sin-conexion { color: var(--aviso-texto); }
.contenido { padding: 24px 28px 40px; flex: 1; }

.barra-inferior { display: none; }
.cajon-fondo { display: none; }

/* ---------------- Tarjetas y rejillas ---------------- */
.tarjeta { background: var(--sup); border: 1px solid var(--borde); border-radius: var(--r3); padding: 20px; }
.tarjeta + .tarjeta { margin-top: 16px; }
.rejilla > .tarjeta + .tarjeta, .columnas-camiones > .tarjeta + .tarjeta { margin-top: 0; }
.tarjeta-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tarjeta-cab h3 { font-size: 17px; }
.seccion-titulo { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--texto-2); margin: 0 0 8px; }
.rejilla { display: grid; gap: 16px; }
.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fila { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fila-entre { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pila > * + * { margin-top: 12px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

/* Indicadores del Inicio */
.indicador { display: flex; flex-direction: column; gap: 4px; min-height: 120px; }
.indicador .etq { font-size: 13px; color: var(--texto-2); font-weight: 600; }
.indicador .valor { font-size: 32px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.indicador .det { font-size: 13px; color: var(--texto-2); }
a.indicador { text-decoration: none; color: inherit; }
a.indicador:hover { border-color: var(--acento); }

/* ---------------- Botones ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--toque); padding: 0 18px;
  border-radius: var(--r2); border: 1px solid var(--borde); background: var(--sup); color: var(--texto); font-weight: 600;
  font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none; -webkit-user-select: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-primario:hover { background: var(--acento-osc); }
.btn-azul { background: var(--barra); border-color: var(--barra); color: #fff; }
.btn-peligro { background: var(--peligro); border-color: var(--peligro); color: #fff; }
.btn-peligro-borde { color: var(--peligro-texto); border-color: #F5B5B5; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-secundario:hover { border-color: #C8D0DA; }
.btn-grande { min-height: 60px; font-size: 18px; font-weight: 800; border-radius: var(--r3); padding: 0 24px; }
.btn-enorme { min-height: 72px; font-size: 22px; font-weight: 800; border-radius: var(--r3); width: 100%; letter-spacing: .3px; }
.btn-chico { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn-bloque { width: 100%; }
.btn-icono { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0;
  background: transparent; border-radius: var(--r2); cursor: pointer; color: var(--texto-2); flex: none; }
.btn-icono:hover { background: var(--fondo); color: var(--texto); }
.btn-icono.peligro:hover { color: var(--peligro); background: var(--peligro-suave); }
.grupo-botones { display: flex; flex-wrap: wrap; gap: 8px; }

/* Selector segmentado (Venta | Cotización, $ | %) */
.segmentado { display: inline-flex; background: #EEF1F5; border-radius: var(--r2); padding: 4px; gap: 4px; }
.segmentado button { border: 0; background: transparent; min-height: 40px; min-width: 44px; padding: 0 16px; border-radius: 8px;
  font-weight: 600; cursor: pointer; color: var(--texto-2); }
.segmentado button.activo { background: var(--sup); color: var(--texto); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Chips de filtro */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r4);
  border: 1px solid var(--borde); background: var(--sup); cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; }
a.chip { text-decoration: none; color: inherit; }
.chip.activo { background: var(--acento-suave); border-color: #F6C29B; color: #B4520C; font-weight: 600; }
select.chip { padding-right: 32px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B6570' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }

/* Insignias de estado (siempre con texto) */
.insignia { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r4); font-size: 12px;
  font-weight: 700; white-space: nowrap; }
.insignia.ok { background: var(--ok-suave); color: var(--ok-texto); }
.insignia.aviso { background: var(--aviso-suave); color: var(--aviso-texto); }
.insignia.peligro { background: var(--peligro-suave); color: var(--peligro-texto); }
.insignia.info { background: var(--info-suave); color: var(--info-texto); }
.insignia.neutro { background: #EEF1F5; color: var(--texto-2); }
.insignia.naranja { background: var(--acento-suave); color: #B4520C; }

/* ---------------- Formularios ---------------- */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .etiqueta { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.campo .ayuda { font-size: 12px; color: var(--texto-3); }
.entrada, .campo input:not([type=checkbox]):not([type=radio]), .campo select, .campo textarea, .buscador input {
  min-height: var(--toque); border: 1px solid var(--borde); border-radius: var(--r2); padding: 10px 14px; background: var(--sup);
  font-size: 16px; width: 100%; outline: none; }
.campo textarea { min-height: 88px; resize: vertical; }
.entrada:focus, .campo input:focus, .campo select:focus, .campo textarea:focus, .buscador input:focus {
  border-color: var(--acento); box-shadow: 0 0 0 3px rgba(240,118,30,.18); }
.con-error input, .con-error select, .con-error textarea { border-color: var(--peligro); }
.error-campo { color: var(--peligro-texto); font-size: 13px; font-weight: 600; }
.obligatorio::after { content: " *"; color: var(--peligro); }
.casilla { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 500; }
.casilla input { width: 22px; height: 22px; accent-color: var(--acento); }
.buscador { position: relative; }
.buscador .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-3); }
.buscador input { padding-left: 44px; min-height: 52px; border-radius: var(--r3); }
fieldset.seccion { min-width: 0; border: 1px solid var(--borde); border-radius: var(--r3); padding: 16px 20px 20px; margin: 0 0 16px; background: var(--sup); }
fieldset.seccion legend { font-weight: 700; font-size: 15px; padding: 0 6px; }
.entrada-dinero { position: relative; }
.entrada-dinero::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--texto-2); }
.entrada-dinero input { padding-left: 24px !important; text-align: right; font-variant-numeric: tabular-nums; }
.resaltar-precio input, input.resaltar-precio { background: var(--aviso-suave) !important; border-color: var(--aviso) !important; }

/* ---------------- Tablas / listas ---------------- */
.tabla-env { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; font-weight: 600; color: var(--texto-3); padding: 8px 10px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 12px 10px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td.num, .tabla th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: #FAFBFC; }
.nombre-fila { font-weight: 700; }
.lista-filas { display: flex; flex-direction: column; }
.fila-lista { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--borde); min-height: 60px; text-decoration: none; color: inherit; }
.fila-lista:last-child { border-bottom: 0; }
button.fila-lista { width: 100%; background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.fila-lista:hover { background: #FAFBFC; }
.fila-lista .crece { flex: 1; min-width: 0; }
.vacio { text-align: center; padding: 40px 20px; }
.vacio h3 { font-size: 17px; margin-bottom: 6px; }
.vacio .btn { margin-top: 16px; }
.paginador { display: flex; justify-content: center; align-items: center; gap: 12px; padding-top: 12px; }
.aviso-caja { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r2); font-size: 14px; font-weight: 500; }
.aviso-caja.aviso { background: var(--aviso-suave); color: var(--aviso-texto); }
.aviso-caja.peligro { background: var(--peligro-suave); color: var(--peligro-texto); }
.aviso-caja.info { background: var(--info-suave); color: var(--info-texto); }
.aviso-caja.ok { background: var(--ok-suave); color: var(--ok-texto); }
.barra-progreso { height: 12px; background: #EEF1F5; border-radius: var(--r4); overflow: hidden; }
.barra-progreso > div { height: 100%; background: var(--info); border-radius: var(--r4); }
.barra-progreso.pasado > div { background: var(--peligro); }
.barra-progreso.casi > div { background: var(--aviso); }

/* ---------------- Modales ---------------- */
.modal-capa { position: fixed; inset: 0; background: rgba(17,20,23,.45); display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px; }
.modal { background: var(--sup); border-radius: var(--r3); width: 100%; max-width: 560px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-grande { max-width: 860px; }
.modal-completo { max-width: none; width: 100%; height: 100%; max-height: none; }
.modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--borde); }
.modal-cab h2 { font-size: 20px; }
.modal-cuerpo { padding: 20px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.modal-pie { display: flex; gap: 12px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--borde); flex-wrap: wrap; }
.modal-pie .btn { min-width: 120px; }
.texto-confirmar { font-size: 17px; line-height: 1.5; }
.lista-opciones { display: flex; flex-direction: column; gap: 8px; }
.opcion-grande { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; border: 1px solid var(--borde);
  border-radius: var(--r2); background: var(--sup); font-size: 17px; font-weight: 600; cursor: pointer; text-align: left; width: 100%; }
.opcion-grande.activo { border-color: var(--acento); background: var(--acento-suave); }

/* ---------------- Toasts ---------------- */
.toasts { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 520px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--texto); color: #fff; padding: 12px 16px;
  border-radius: var(--r2); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); width: 100%; }
.toast.ok .ic { color: #4ADE80; } .toast.aviso .ic, .toast.peligro .ic { color: #FBBF24; }
.toast-texto { flex: 1; }
.toast-deshacer { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; min-height: 44px; padding: 0 14px; font-weight: 700; cursor: pointer; }

/* ---------------- Punto de Venta ---------------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pos-col { min-width: 0; }
/* En iPad horizontal la columna derecha se desplaza sola y el botón COBRAR queda siempre a la vista */
.pos-derecha { position: sticky; top: calc(var(--alto-enc, 82px) + 16px); max-height: calc(100vh - var(--alto-enc, 82px) - 32px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 0; overscroll-behavior: contain; }
.pos-derecha #pos-cobrar { position: sticky; bottom: 0; box-shadow: 0 -8px 16px var(--fondo); }
.resultados-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.tarjeta-producto { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--borde); border-radius: var(--r2);
  background: var(--sup); padding: 12px; min-height: 92px; cursor: pointer; }
.tarjeta-producto:hover { border-color: var(--acento); }
.tarjeta-producto .tp-nombre { font-weight: 700; font-size: 15px; line-height: 1.25; }
.tarjeta-producto .tp-det { font-size: 12px; color: var(--texto-2); }
.tarjeta-producto .tp-precio { margin-top: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Cada línea del ticket: descripción arriba (ancho completo) y debajo cajas · precio · subtotal */
.lineas-ticket .lt-fila { display: grid; grid-template-columns: 116px 104px minmax(0, 1fr) 44px;
  grid-template-areas: "d d d x" "c p s s"; gap: 8px 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.lineas-ticket .lt-fila > :nth-child(1) { grid-area: d; }
.lineas-ticket .lt-fila > :nth-child(2) { grid-area: c; }
.lineas-ticket .lt-fila > :nth-child(3) { grid-area: p; }
.lineas-ticket .lt-fila > :nth-child(4) { grid-area: s; }
.lineas-ticket .lt-fila > :nth-child(5) { grid-area: x; align-self: start; justify-self: end; }
.lineas-ticket .lt-cab { display: none !important; }
.lt-desc { font-weight: 600; line-height: 1.3; }
.lt-desc .sub { font-weight: 400; }
.lt-sub { text-align: right; font-weight: 700; font-size: 17px; color: var(--info); font-variant-numeric: tabular-nums; }
.cantidad { display: flex; align-items: center; border: 1px solid var(--borde); border-radius: var(--r2); overflow: hidden; height: 44px; }
.cantidad button { width: 40px; height: 44px; border: 0; background: #F1F4F7; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.cantidad input { width: 100%; min-width: 0; border: 0; text-align: center; font-weight: 700; font-size: 16px; height: 44px; padding: 0; font-variant-numeric: tabular-nums; outline: none; }
.precio-linea input { width: 100%; min-height: 44px; border: 1px solid var(--borde); border-radius: var(--r2); text-align: right; padding: 0 10px; font-size: 15px; font-variant-numeric: tabular-nums; }
.precio-linea.especial input { border-color: var(--info); background: var(--info-suave); }
.totales .t-fila { display: flex; justify-content: space-between; align-items: center; min-height: 34px; font-size: 15px; color: var(--texto-2); gap: 8px; }
.totales .t-fila .monto { color: var(--texto); font-weight: 600; }
.t-total { border-top: 1px solid var(--borde); margin-top: 8px; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.t-total .etq { font-weight: 800; font-size: 15px; }
.t-total .monto { font-size: 38px; font-weight: 800; color: var(--acento); font-variant-numeric: tabular-nums; line-height: 1.1; }
.saldo-linea { text-align: right; font-size: 14px; font-weight: 600; margin-top: 4px; }
.cliente-sel { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--sup); border: 1px solid var(--borde);
  border-radius: var(--r3); padding: 14px 16px; min-height: 64px; cursor: pointer; }
.cliente-sel:hover { border-color: var(--acento); }
.cliente-sel .crece { flex: 1; min-width: 0; }
.cliente-sel .cs-nombre { font-weight: 700; font-size: 16px; }
.metodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metodos button { min-height: 48px; border: 1px solid var(--borde); background: var(--sup); border-radius: var(--r2); font-weight: 600; cursor: pointer; }
.metodos button.activo { background: var(--barra); color: #fff; border-color: var(--barra); }
.mini-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.teclado button { min-height: 60px; font-size: 24px; font-weight: 700; border: 1px solid var(--borde); background: var(--sup); border-radius: var(--r2); cursor: pointer; }
.teclado button:active { background: var(--fondo); }
.cant-grande { display: grid; grid-template-columns: 72px 1fr 72px; gap: 8px; align-items: center; }
.cant-grande button { height: 72px; border-radius: var(--r2); border: 1px solid var(--borde); background: #F1F4F7; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cant-grande input { height: 72px; text-align: center; font-size: 34px; font-weight: 800; border: 2px solid var(--acento); border-radius: var(--r2); width: 100%; font-variant-numeric: tabular-nums; outline: none; }
.opciones-variante { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.opcion-var { border: 1px solid var(--borde); border-radius: var(--r2); background: var(--sup); padding: 10px 12px; text-align: left; cursor: pointer; min-height: 64px; display: flex; flex-direction: column; gap: 2px; }
.opcion-var.activo { border-color: var(--acento); background: var(--acento-suave); box-shadow: inset 0 0 0 1px var(--acento); }
.opcion-var .ov-nombre { font-weight: 700; }
.opcion-var .ov-det { font-size: 12px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.precio-por-definir { color: var(--aviso-texto); font-weight: 700; }

/* Vista previa de recibo */
.vista-recibo { display: flex; justify-content: center; background: #E9ECEF; border-radius: var(--r2); padding: 16px; overflow: auto; max-height: 60vh; }
.vista-recibo-cont { max-width: 100%; }

/* Firma */
.firma-lienzo { width: 100%; height: 50vh; min-height: 260px; border: 2px dashed #C8D0DA; border-radius: var(--r2); background: #fff; touch-action: none; display: block; }
.firma-img { max-width: 260px; max-height: 100px; border: 1px solid var(--borde); border-radius: var(--r1); background: #fff; }

/* Entregas */
.columnas-camiones { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.parada { border: 1px solid var(--borde); border-radius: var(--r2); padding: 12px; background: var(--sup); }
.parada + .parada { margin-top: 10px; }
.parada-num { width: 32px; height: 32px; border-radius: 50%; background: var(--barra); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.parada.entregado { background: #F6FBF7; }
.parada.no_entregado { background: #FFF8F8; }

/* Semáforo de cobros */
.semaforo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.semaforo::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.semaforo.verde { color: var(--ok-texto); } .semaforo.ambar { color: var(--aviso-texto); } .semaforo.rojo { color: var(--peligro-texto); }

/* Pestañas */
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin-bottom: 16px; overflow-x: auto; }
.pestanas button { border: 0; background: transparent; min-height: 48px; padding: 0 16px; font-weight: 600; color: var(--texto-2); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.pestanas button.activo { color: var(--texto); border-bottom-color: var(--acento); }

/* Chips de tamaños/sabores (editor de producto) */
.chips-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--borde); border-radius: var(--r2); padding: 6px; min-height: 52px; background: var(--sup); }
.chips-edit .chip-x { display: inline-flex; align-items: center; gap: 4px; background: #EEF1F5; border-radius: var(--r4); padding: 0 4px 0 12px; font-weight: 600; min-height: 36px; }
.chips-edit .chip-x button { border: 0; background: transparent; width: 32px; height: 32px; cursor: pointer; color: var(--texto-2); }
.chips-edit input { border: 0; outline: none; flex: 1; min-width: 140px; min-height: 40px; font-size: 16px; padding: 0 6px; }
.tabla-variantes input, .tabla-variantes select { min-height: 44px; border: 1px solid var(--borde); border-radius: 8px; padding: 0 8px; font-size: 15px; width: 100%; background: var(--sup); }
.tabla-variantes td { padding: 6px 4px; }
.tabla-variantes .c-num { width: 84px; }
.tabla-variantes .c-dinero { width: 104px; }

.ficha-datos { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 15px; }
.ficha-datos dt { color: var(--texto-2); font-size: 13px; font-weight: 600; padding-top: 2px; }
.ficha-datos dd { margin: 0; word-break: break-word; }

/* ---------------- Pantallas medianas: iPad vertical (≤ 1023 px) ---------------- */
@media (max-width: 1023px) {
  .barra { transform: translateX(-100%); transition: transform .2s ease; z-index: 60; visibility: hidden; }
  body.cajon-abierto .barra { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.cajon-abierto .cajon-fondo { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .principal { margin-left: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .barra-inferior { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--barra);
    padding: 4px 4px env(safe-area-inset-bottom); height: calc(68px + env(safe-area-inset-bottom)); }
  .inf-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--barra-texto);
    text-decoration: none; font-size: 12px; font-weight: 600; border: 0; background: transparent; border-radius: var(--r2); cursor: pointer; min-height: 56px; }
  .inf-item.activo { color: #fff; background: rgba(240,118,30,.9); }
  .pos { grid-template-columns: 1fr; }
  .pos-derecha { position: static; max-height: none; overflow: visible; }
  .pos-derecha #pos-cobrar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .encabezado { padding: 14px 20px; }
  .contenido { padding: 20px; }
}

/* ---------------- Teléfono (≤ 700 px) ---------------- */
@media (max-width: 700px) {
  body { font-size: 15px; }
  .encabezado { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; position: static; }
  .encabezado h1 { font-size: 20px; }
  .enc-derecha { justify-content: space-between; }
  .chip-estado { font-size: 11px; white-space: normal; }
  .contenido { padding: 14px 12px 24px; }
  .r2, .r3 { grid-template-columns: 1fr; }
  .r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tarjeta { padding: 14px; }
  .indicador .valor { font-size: 24px; }
  .indicador { min-height: 100px; }
  .lineas-ticket .lt-fila { grid-template-columns: 116px 100px minmax(0, 1fr) 44px; }
  .modal-capa { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: var(--r3) var(--r3) 0 0; }
  .modal-cuerpo { padding: 16px; }
  .modal-pie { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-pie .btn { flex: 1; min-width: 0; }
  .ficha-datos { grid-template-columns: 1fr; gap: 2px 0; }
  .ficha-datos dd { margin-bottom: 8px; }
  .t-total .monto { font-size: 32px; }
  .columnas-camiones { grid-template-columns: 1fr; }
  .ocultar-movil { display: none !important; }
  .fila-busqueda { flex-wrap: wrap !important; }
  .fila-busqueda > .buscador { flex: 1 1 100% !important; }
  .tabla td, .tabla th { padding: 10px 6px; }
}
@media (min-width: 701px) { .solo-movil { display: none !important; } }
@media print { .barra, .barra-inferior, .encabezado, .toasts { display: none !important; } .principal { margin: 0; } }
/* Con el ticket vacío el botón no flota sobre los campos */
#pos-cobrar:disabled { position: static !important; box-shadow: none; }
/* Editor de presentaciones: tamaño y sabor necesitan ancho para leerse */
.tabla-variantes input[data-k="tamano"], .tabla-variantes input[data-k="sabor"] { min-width: 132px; }
.tabla-variantes input[data-k="sku"] { min-width: 80px; }
@media (max-width: 700px) {
  .modal-pie .btn { flex: 1 1 40%; min-width: 0; padding: 0 10px; }
}

/* Buscador del Punto de Venta: la categoría pasa abajo si no cabe */
.pos .fila-busqueda { flex-wrap: wrap !important; }
.pos .fila-busqueda > .buscador { flex: 1 1 240px !important; }
/* iPad 1024 px horizontal: columna derecha más angosta para que quepan los subtotales */
@media (min-width: 1024px) and (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 316px; gap: 16px; }
  .contenido { padding-left: 20px; padding-right: 20px; }
  .t-total .monto { font-size: 34px; }
}

/* Casilla dentro de una celda: toda la etiqueta (≥ 44×44) cuenta como toque */
.casilla-celda { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; cursor: pointer; }
.casilla-celda input { width: 26px; height: 26px; accent-color: var(--acento); margin: 0; }

/* Editor de producto: cada presentación es una tarjeta de dos renglones */
.lista-variantes { display: flex; flex-direction: column; gap: 10px; }
.var-tarjeta { border: 1px solid var(--borde); border-radius: var(--r2); padding: 12px; background: #FBFCFD; }
.var-tarjeta.inactiva { opacity: .6; }
.var-tarjeta .campo > label, .var-tarjeta .etiqueta { font-size: 12px; }
.var-tarjeta input:not([type=checkbox]) { min-height: 44px; border: 1px solid var(--borde); border-radius: 8px; padding: 0 10px; font-size: 15px; width: 100%; background: var(--sup); }
.var-r1 { display: grid; grid-template-columns: 2fr 1.6fr 1fr 1fr 1.2fr; gap: 10px; }
.var-r2 { display: grid; grid-template-columns: 1.3fr 56px 1.5fr 1.1fr 0.9fr 56px 44px; gap: 10px; margin-top: 10px; align-items: start; }
.var-r2 .btn-chico { margin-top: 6px; min-height: 44px; width: 100%; white-space: normal; line-height: 1.1; font-size: 13px; }
.valor-fijo { min-height: 44px; display: flex; align-items: center; gap: 4px; font-weight: 700; }
@media (max-width: 700px) {
  .var-r1 { grid-template-columns: 1fr 1fr; }
  .var-r2 { grid-template-columns: 1fr 1fr; }
}

/* ---- Lista plana de presentaciones (js/13-lista.js) ---- */
.renglon-var { width: 100%; text-align: left; min-height: 56px; }
.lista-plana { max-height: none; }
.pos-lista .lista-plana { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--borde); border-radius: var(--r2); background: var(--sup); }
.lista-barra .chips { gap: 6px; }
.chip.activo[aria-pressed], .chip[aria-pressed="true"] { background: var(--acento-suave); border-color: var(--acento); }
.var-tarjeta.resaltada { outline: 3px solid var(--acento); background: var(--acento-suave); }
@media (max-width: 700px) { .pos-lista .lista-plana { max-height: 40vh; } }
#li-cats { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
#li-cats .chip { flex: none; }
#li-filtros .chip { min-height: 44px; }
@media (max-width: 700px) { #li-filtros { flex-wrap: nowrap; overflow-x: auto; } #li-filtros .chip { flex: none; } }

/* ---- Marca y asistente de primera vez (js/05-marca.js, js/14-asistente.js) ---- */
#marca-logo { display: block; max-width: 100%; max-height: 56px; margin-bottom: 8px; border-radius: 6px; object-fit: contain; }
.asistente { max-width: 760px; margin: 0 auto; }
.as-pasos { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.as-paso { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #EEF1F5; font-weight: 700; }
.as-paso.activo { background: var(--acento); color: #fff; }
.as-paso.hecho { background: var(--ok-suave); color: var(--ok-texto); }
.as-pie { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.as-opciones .opcion-var { min-height: 72px; }

/* ---- Inicio de sesión y permisos (js/15-login.js, js/06-permisos.js) ---- */
.sin-costos .col-costo { display: none !important; }
.login { position: fixed; inset: 0; z-index: 3000; background: var(--barra); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px; }
.login-caja { background: var(--sup); border-radius: var(--r3); width: 100%; max-width: 460px; padding: 28px 24px; margin: auto; display: flex; flex-direction: column; gap: 14px; }
.login-marca { font-weight: 800; letter-spacing: .5px; color: var(--barra); font-size: 18px; }
.login-titulo { font-size: 26px; line-height: 1.2; }
.login input[type=text], .login input[type=email], .login input[type=password] { min-height: 56px; font-size: 18px; width: 100%; }
.login .btn { min-height: 52px; }
.login .btn-enorme { width: 100%; font-size: 20px; }
.lg-clave { display: flex; gap: 8px; } .lg-clave input { flex: 1; } .lg-ver { min-width: 96px; }
.lg-enlace { background: none; border: 0; color: var(--info); text-decoration: underline; min-height: 44px; font-size: 16px; cursor: pointer; }
.login-error { color: var(--peligro-texto); font-weight: 600; min-height: 0; }
.login-error:not(:empty) { background: var(--peligro-suave); padding: 10px 12px; border-radius: var(--r2); }
.login-pie { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--borde); padding-top: 14px; }
.lg-empresas { display: grid; gap: 10px; }
.lg-empresa { display: flex; justify-content: space-between; align-items: center; min-height: 64px; }
.btn-salir { margin: 8px 12px 0; min-height: 44px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: var(--barra-texto); border-radius: var(--r2); cursor: pointer; }
.codigo-invitacion { font-family: ui-monospace, Menlo, monospace; font-size: 30px; font-weight: 800; letter-spacing: 3px; text-align: center; padding: 14px; background: var(--acento-suave); border-radius: var(--r2); user-select: all; }

/* ---------- Fotos de referencia (miniatura fija, visor, marcador neutro) ---------- */
.foto-mini { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 8px; background: #F3F5F7; border: 1px solid var(--borde); overflow: hidden; box-sizing: border-box; }
.foto-mini img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.foto-mini[data-ver-foto] { cursor: zoom-in; }
.foto-mini.sin-foto { color: #A7B0BB; }
.foto-visor { display: flex; justify-content: center; padding: 8px; }
.foto-visor img { max-width: 100%; max-height: 60vh; object-fit: contain; border-radius: 8px; background: #fff; }
.var-foto { align-items: center; gap: 10px; flex-wrap: wrap; }
.var-foto .etiqueta { margin: 0; }
