/* Sistema de Venta · Fénix Electrónica
   Misma identidad que el panel del taller (theme.css): fondo nocturno, naranja ascua. */

.hidden { display: none !important; }
.mt { margin-top: 12px; }
.mono { font-family: var(--font-mono); }
.sub-chica { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.texto-suave { color: var(--ink-soft); }
.texto-tenue { color: var(--ink-faint); }
.texto-ok { color: #4ade80; }
.texto-alerta { color: var(--orange-bright); }
.texto-error { color: #f87171; }
.derecha { text-align: right; }
.centro { text-align: center; }
.nowrap { white-space: nowrap; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.pantalla-centro {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.logo-grande { height: 72px; }

/* ---------- BOTONES ---------- */
.btn-primario {
  background: var(--orange);
  color: #1a0f00;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn-primario:hover:not(:disabled) { background: var(--orange-bright); box-shadow: var(--glow-orange); }
.btn-primario:disabled, .btn-texto:disabled, .btn-mini:disabled { opacity: 0.55; cursor: default; }
.btn-bloque { width: 100%; margin-top: 18px; padding: 13px; }

.btn-texto {
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--line-strong);
}
.btn-texto:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-faint); }

.btn-mini {
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  padding: 7px 12px;
  font-size: 12px;
  transition: all 0.15s ease;
}
.btn-mini:hover:not(:disabled) { border-color: var(--ink-faint); color: var(--ink); }
.btn-mini.peligro, .btn-texto.peligro { color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.btn-mini.peligro:hover, .btn-texto.peligro:hover { background: rgba(239, 68, 68, 0.1); border-color: var(--danger); }
.btn-mini.ok { color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }

.btn-icono { background: transparent; font-size: 16px; color: var(--ink-soft); padding: 4px 8px; }
.btn-icono:hover { color: var(--ink); }

/* Botón ocupado: se ve que está procesando y no se puede volver a tocar. */
.ocupado { position: relative; pointer-events: none; }
.ocupado::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card { width: 100%; max-width: 360px; padding: 36px 32px; display: flex; flex-direction: column; }
.logo-fenix--login { margin-bottom: 24px; justify-content: center; }
.logo-fenix--login .logo-fenix-img { height: 68px; }
.login-card h1 { font-size: 22px; margin-bottom: 18px; text-transform: uppercase; }
.error-text { color: var(--danger); font-size: 13px; margin: 10px 0 0; }

/* ---------- LAYOUT ---------- */
.panel-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: 84px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }

.sidebar-item {
  width: 68px;
  padding: 8px 0 7px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-item:hover { color: var(--ink); background: var(--bg-card-raised); }
.sidebar-item .icono { font-size: 19px; line-height: 1; }
.sidebar-item .sidebar-texto { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.sidebar-item.activo {
  background: rgba(245, 130, 12, 0.14);
  border-color: rgba(245, 130, 12, 0.3);
  color: var(--orange);
}
.sidebar-item .contador {
  position: absolute;
  top: 3px;
  right: 8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--fire);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-fenix { flex: 1; width: 100%; min-height: 120px; position: relative; overflow: hidden; }
.fenix-ave--sidebar {
  position: absolute;
  left: 50%;
  bottom: -6%;
  transform: translateX(-50%);
  width: 220%;
  max-width: none;
  height: auto;
  opacity: 0.9;
}

.panel-main { flex: 1; min-width: 0; padding: 26px 30px 80px; }

/* ---------- TOPBAR ---------- */
.topbar { margin-bottom: 22px; }
.topbar-fila { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.topbar-izq { display: flex; align-items: center; gap: 18px; min-width: 0; }
.logo-topbar { height: 40px; }
.topbar h1 { font-size: 28px; text-transform: uppercase; }
.topbar-derecha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.selector-sucursal { width: auto; padding: 8px 10px; font-size: 13px; }
.btn-usuario { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip-estado {
  font-size: 11px;
  padding: 7px 12px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip-estado.ok { color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.chip-estado.pendiente { color: var(--orange-bright); border-color: rgba(245, 130, 12, 0.35); }
.chip-estado.error { color: #f87171; border-color: rgba(239, 68, 68, 0.35); }

.banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 130, 12, 0.35);
  background: rgba(245, 130, 12, 0.08);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.banner.error { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }

/* ---------- COMPONENTES ---------- */
.seccion { margin-bottom: 26px; }
.seccion-titulo {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.barra { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.barra > input[type="search"], .barra > .crecer { flex: 1; min-width: 200px; }
.barra select { width: auto; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.tab:hover { border-color: var(--line-strong); color: var(--ink); }
.tab.activo { background: var(--orange); color: #1a0f00; border-color: var(--orange); }

.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tarjeta-dato { padding: 16px 18px; }
.tarjeta-dato .valor { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-top: 4px; }
.tarjeta-dato.destacada { border-color: rgba(245, 130, 12, 0.4); box-shadow: var(--glow-orange); }

.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: var(--bg-card-raised); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.miniatura {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-input);
  border: 1px solid var(--line);
  display: block;
}
.miniatura.vacia { display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--ink-faint); }

.etiqueta {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  white-space: nowrap;
}
.etiqueta.ok { color: #4ade80; border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.08); }
.etiqueta.alerta { color: var(--orange-bright); border-color: rgba(245, 130, 12, 0.3); background: rgba(245, 130, 12, 0.08); }
.etiqueta.error { color: #f87171; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }
.etiqueta.info { color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); background: rgba(59, 130, 246, 0.08); }

.mensaje-vacio { text-align: center; color: var(--ink-soft); padding: 36px 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .col-2 { grid-column: span 2; }
.ayuda-campo { font-size: 11.5px; color: var(--ink-faint); margin: 6px 0 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
details.desplegable summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); padding: 4px 0; }
details.desplegable[open] summary { margin-bottom: 12px; }

/* ---------- MODALES ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-contenido { width: 100%; max-width: 560px; padding: 24px; max-height: 92vh; overflow-y: auto; }
.modal-contenido.ancho { max-width: 760px; }
.modal-contenido.chico { max-width: 400px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; }
.modal-header h2 { font-size: 19px; text-transform: uppercase; }
.modal-acciones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card-raised);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 100;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}
.toast.error { border-color: rgba(239, 68, 68, 0.45); color: #f87171; }
.toast.ok { border-color: rgba(34, 197, 94, 0.4); color: #4ade80; }

/* =====================================================================
   MOSTRADOR
   ===================================================================== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

.pos-buscador { position: relative; margin-bottom: 16px; }
.pos-buscador input {
  font-size: 18px;
  padding: 16px 18px 16px 50px;
  border-color: var(--line-strong);
  background: var(--bg-card);
}
.pos-buscador .lupa { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 18px; opacity: 0.6; pointer-events: none; }

.sugerencias {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  padding: 6px;
  max-height: 380px;
  overflow-y: auto;
}
.sugerencia {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
}
.sugerencia:hover, .sugerencia.activa { background: var(--bg-card-raised); }
.sugerencia .detalle { font-size: 12px; color: var(--ink-faint); }

.carrito { padding: 0; overflow: hidden; }
.carrito-vacio { padding: 60px 20px; text-align: center; color: var(--ink-faint); }
.carrito-vacio .grande { font-size: 40px; margin-bottom: 10px; }

.linea {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.linea:last-child { border-bottom: none; }
.linea.recien { animation: destello 0.9s ease; }
@keyframes destello { from { background: rgba(245, 130, 12, 0.16); } to { background: transparent; } }
.linea-nombre { font-weight: 600; font-size: 14.5px; word-break: break-word; }
.linea-detalle { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.linea-subtotal { font-family: var(--font-mono); font-weight: 700; min-width: 96px; text-align: right; }

.cantidad { display: flex; align-items: center; gap: 4px; }
.cantidad button {
  width: 32px;
  height: 32px;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}
.cantidad input { width: 56px; text-align: center; padding: 6px; font-weight: 700; }

.pos-resumen { padding: 22px; position: sticky; top: 20px; }
.pos-total-label { font-size: 12px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: 0.08em; }
.pos-total { font-family: var(--font-display); font-size: 48px; font-weight: 700; line-height: 1.05; margin: 6px 0 4px; word-break: break-all; }
.pos-unidades { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.btn-cobrar { width: 100%; padding: 18px; font-size: 17px; }
.atajo { font-size: 11px; opacity: 0.7; margin-left: 6px; font-weight: 600; }

.pagos-fila { display: grid; grid-template-columns: 1fr 150px 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.cobro-total { font-family: var(--font-display); font-size: 36px; font-weight: 700; color: var(--orange); }
.cobro-estado { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-input); font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.cobro-estado strong { font-family: var(--font-mono); }
.vuelto { font-size: 22px; font-weight: 700; color: #4ade80; font-family: var(--font-mono); }

/* ---------- FOTOS DE PRODUCTO ---------- */
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.foto-item { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-input); }
.foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-item button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 13px; }
.subir-foto { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.subir-foto input { display: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr; }
  .pos-resumen { position: static; }
}

@media (max-width: 900px) {
  .panel-layout { flex-direction: column; }
  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--line);
    z-index: 40;
  }
  .sidebar-nav { flex-direction: row; gap: 0; width: 100%; justify-content: space-between; }
  .sidebar-item { width: auto; min-width: 0; flex: 1; padding: 6px 0 5px; }
  .sidebar-item .icono { font-size: 18px; }
  .sidebar-item .sidebar-texto { font-size: 9px; letter-spacing: 0; }
  .sidebar-item .contador { right: 2px; }
  .sidebar-fenix { display: none; }
  .panel-main { padding: 18px 16px 110px; }
  .logo-topbar { display: none; }
  .topbar h1 { font-size: 23px; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-2 { grid-column: span 1; }
  .linea { grid-template-columns: minmax(0, 1fr) auto; }
  .linea .cantidad { grid-column: 1; }
  .linea-subtotal { grid-column: 2; grid-row: 1; }
  .linea .btn-icono { grid-column: 2; grid-row: 2; justify-self: end; }
  .pagos-fila { grid-template-columns: 1fr 110px 32px; }
  .pos-total { font-size: 40px; }
  .modal-contenido { padding: 18px; }
}

/* Ajustes finos */
.subir-foto { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink-soft); margin: 0; font-weight: 600; }
.crecer select, .crecer input { width: 100%; }
@media (max-width: 560px) { .ocultar-cel { display: none; } }
@media (max-width: 420px) {
  .sidebar-item .sidebar-texto { display: none; }
  .sidebar-item .icono { font-size: 20px; }
  .sidebar-item { padding: 9px 0; }
}
