/* =========================================
   PALETA DE COLORES (Editá acá para probar tonos)
   ========================================= */
:root {
  /* Fondos y superficies (Negro puro + Cuadros en Vino marcado) */
  --bg-app: #080607;              /* Negro profundo para el fondo general */
  --bg-surface: #290910;          /* Color vino intenso para las tarjetas, paneles y modales */
  --bg-surface-alt: #290a12;      /* Vino un poco más claro para botones secundarios y chips */
  --bg-selected: #2f0e0c;         /* Fondo de tarjeta seleccionada (vino rojizo) */
  --bg-overlay: rgba(5, 3, 4, 0.85);

  /* Acento principal (Naranja bien oscuro / Óxido) */
  --accent-primary: #742602;      /* Naranja oscuro intenso para botones principales y activos */
  --accent-text: #ffffff;         /* Texto blanco puro para mantener buen contraste */

  /* Estados semánticos (Éxito / Peligro) */
  --success: #34d399;             /* Verde esmeralda para precios y ganancias */
  --success-bg: #13382b;          /* Fondo botón activar */
  --success-text: #6ee7b7;        /* Texto botón activar */

  --danger: #fca5a5;              /* Textos de alerta (.rojo) aclarados para leerse bien sobre el vino */
  --danger-bg: #4d0c16;           /* Fondo botón borrar / pausar (vino casi negro) */
  --danger-text: #fda4af;         /* Texto botón borrar / pausar */

  /* Textos */
  --text-primary: #ffffff;        /* Títulos y valores principales */
  --text-body: #f5ebed;           /* Texto general */
  --text-secondary: #ebd5da;      /* Texto en botones secundarios */
  --text-muted: #d3bdc2;          /* Chips inactivos */
  --text-subtle: #b3a0a5;         /* Subtítulos, tabs inactivos y días */
  --text-disabled: #7d5c64;       /* Productos pausados */

  /* Bordes */
  --border-subtle: #6a162b;       /* Divisores y bordes de tarjetas */
  --border-strong: #89223c;       /* Bordes de inputs y modales */
}

/* =========================================
   ESTILOS GENERALES
   ========================================= */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}

.hidden {
  display: none !important;
}

.contenedor {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100dvh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
}

.login-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

.tab-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 64px;
}

.scroll-contenido {
  padding: 14px 14px 32px;
}

.bloqueo-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
}

.centrado {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-app);
}

.centrado-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

.fila-encabezado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  gap: 8px;
}

.fila-acciones {
  display: flex;
  gap: 8px;
}

.titulo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.titulo-flex {
  flex: 1 1 140px;
}

.subtitulo {
  font-size: 14px;
  color: var(--text-subtle);
  margin: 4px 0 14px;
}

.titulo-seccion {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.texto-principal {
  font-size: 15px;
  color: var(--text-body);
  font-weight: 600;
}

.texto-secundario {
  font-size: 13px;
  color: var(--text-subtle);
}

.rojo {
  color: var(--danger) !important;
}

/* Utilidades de margen */
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mt-0  { margin-top: 0 !important; }
.mt-6  { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }

.filtros-tipo {
  margin-top: 2px;
  margin-bottom: 10px;
}

.fila-buscador {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.input {
  width: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 12px;
  min-height: 46px;
  margin-bottom: 10px;
  font-size: 16px;
}

.input-busqueda {
  flex: 1;
  margin-bottom: 0;
}

.btn-limpiar {
  background-color: var(--bg-surface-alt);
  padding: 0 12px;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.grilla-productos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 419px) {
  .grilla-productos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tarjeta-producto {
  position: relative;
  background-color: var(--bg-surface);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  text-align: left;
  cursor: pointer;
}

.tarjeta-seleccionada {
  border-color: var(--accent-primary);
  background-color: var(--bg-selected);
}

.categoria-tag {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.nombre-producto {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  word-break: break-word;
}

.precio-producto {
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
}

.badge-cantidad {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--accent-primary);
  border-radius: 12px;
  padding: 2px 8px;
  color: var(--accent-text);
  font-weight: 700;
  font-size: 12px;
}

.panel-ticket {
  background-color: var(--bg-surface);
  border-radius: 14px;
  padding: 14px;
  margin-top: 16px;
  border: 1px solid var(--border-subtle);
}

.selector-rango-btn {
  width: 100%;
  background-color: var(--bg-app);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 10px;
  cursor: pointer;
}

.fila-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
}

.fila-item:last-child {
  border-bottom: none;
}

.item-info {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

.controles-cantidad {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-cantidad {
  min-width: 40px;
  min-height: 40px;
  border-radius: 8px;
  background-color: var(--bg-surface-alt);
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.cantidad-texto {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.fila-metodos {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.metodos-pago {
  margin-top: 14px;
}

.chip-pago {
  flex: 1;
  min-width: 85px;
  min-height: 42px;
  padding: 10px 6px;
  border-radius: 10px;
  background-color: var(--bg-surface-alt);
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.chip-pago.active {
  background-color: var(--accent-primary);
  color: var(--accent-text);
  font-weight: 700;
}

.resumen-cobro {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fila-resumen {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3px 0;
  gap: 8px;
}

.total-grande {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.ganancia-texto {
  font-size: 15px;
  font-weight: 700;
  color: var(--success);
}

.boton-primario {
  width: 100%;
  background-color: var(--accent-primary);
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  color: var(--accent-text);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  margin-top: 14px;
  cursor: pointer;
}

.boton-primario:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.boton-secundario {
  background-color: var(--bg-surface-alt);
  padding: 8px 12px;
  min-height: 38px;
  border-radius: 8px;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.btn-full {
  width: 100%;
  min-height: 44px;
}

.boton-catalogo {
  width: 100%;
  background-color: var(--bg-surface-alt);
  margin-top: 16px;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-borrar {
  background-color: var(--danger-bg);
  padding: 8px 10px;
  min-height: 38px;
  border-radius: 8px;
  border: none;
  color: var(--danger-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-pausar {
  background-color: var(--danger-bg);
  color: var(--danger-text);
}

.btn-activar {
  background-color: var(--success-bg);
  color: var(--success-text);
}

.producto-pausado {
  color: var(--text-disabled) !important;
}

.catalogo-item-col {
  flex-direction: column;
  align-items: stretch;
}

.catalogo-botones {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tarjeta-destacada {
  background-color: var(--bg-surface);
  border-radius: 14px;
  padding: 16px;
  margin-top: 10px;
  border: 1px solid var(--success);
}

.etiqueta-destacada {
  font-size: 11px;
  color: var(--success);
  font-weight: 700;
  margin: 0 0 6px;
}

.monto-destacado {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.mini-tarjeta {
  flex: 1;
  min-width: 130px;
  background-color: var(--bg-surface);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  margin-top: 10px;
}

.valor-mini {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0 0;
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: 58px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  z-index: 50;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--accent-primary);
}

.modal-fondo {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-caja {
  background-color: var(--bg-surface);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  max-width: 460px;
  max-height: 92dvh;
  overflow-y: auto;
  width: 100%;
}

.fila-semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}

.grilla-calendario {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.celda-dia {
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.celda-dia-activa {
  background-color: var(--accent-primary);
  color: var(--accent-text);
  font-weight: 800;
}

.texto-dia-semana {
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 700;
}

.caja-hora {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.fila-hora-controles {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-paso-hora {
  background-color: var(--bg-surface-alt);
  padding: 8px;
  min-height: 38px;
  border-radius: 8px;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.display-hora {
  color: var(--accent-primary);
  font-size: 18px;
  font-weight: 800;
  padding: 0 4px;
}

.modal-botones {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.modal-btn-cancel {
  flex: 1;
  min-height: 44px;
}

.modal-btn-ok {
  flex: 1;
  margin-top: 0;
}