/* =========================================================
   VARIABLES
   ========================================================= */
:root {
  --color-bg: #F3F5F9;
  --color-primary: #2563EB;
  --color-primary-light: #EAF1FF;
  --color-white: #FFFFFF;
  --color-text: #1B2430;
  --color-text-muted: #8A94A6;
  --color-border: #E4E8F0;
  --shadow-soft: 0 2px 10px rgba(27, 36, 48, 0.06);
  --shadow-card: 0 4px 16px rgba(27, 36, 48, 0.08);
  --radius-lg: 18px;
  --radius-md: 14px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

/* Altura de referencia fija (100dvh, no min-height): antes .phone/.phone-screen solo tenían
   un mínimo, así que en algunos móviles la altura real calculada no coincidía con la visible.
   El scroll de página se deja como red de seguridad (no forzado con overflow:hidden): cada
   pantalla intenta resolverse sola con su scroll interno (.barra-body/.detail-body), pero si
   en algún dispositivo concreto el contenido no cabe entero, la página puede desplazarse ese
   resto en vez de cortarlo sin más. */
html {
  height: 100%;
  overflow-x: hidden;
  /* iOS Safari hace zoom al detectar taps rápidos y seguidos en el mismo sitio (p. ej. el
     stepper +/- de productos) aunque el viewport ya pida escala fija — touch-action:manipulation
     es lo único que desactiva ESE gesto concreto sin desactivar el pinch-zoom de accesibilidad. */
  touch-action: manipulation;
}

/* Ocultar barras de scroll nativas en todos los contenedores con desplazamiento,
   manteniendo el scroll funcional (solo se oculta el indicador visual) */
.barra-body,
.detail-body,
.categoria-tabs,
.producto-grid-wrap {
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* Edge/IE legacy */
}

.barra-body::-webkit-scrollbar,
.detail-body::-webkit-scrollbar,
.categoria-tabs::-webkit-scrollbar,
.producto-grid-wrap::-webkit-scrollbar {
  display: none; /* Chrome, Safari, navegadores móviles basados en WebKit */
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-text);
}

button { font-family: inherit; }

/* =========================================================
   AVISO DE ORIENTACIÓN (solo landscape en móvil, vía media query)
   ========================================================= */
.aviso-orientacion {
  display: none;
}

@media screen and (orientation: landscape) and (max-width: 900px) {
  .aviso-orientacion {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px;
    background: var(--color-bg);
    color: var(--color-text);
    text-align: center;
  }

  .aviso-orientacion-icono {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    transform: rotate(90deg);
  }

  .aviso-orientacion p {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    max-width: 280px;
  }

  .phone {
    display: none;
  }
}

/* =========================================================
   CONTENEDOR PRINCIPAL (sin marco de móvil)
   ========================================================= */
.phone {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--color-bg);
  overflow: hidden;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  overflow: hidden;
}

/* =========================================================
   PANTALLAS (SPA)
   ========================================================= */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease), visibility 260ms;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* =========================================================
   PANTALLA ACTIVACIÓN DE DISPOSITIVO
   ========================================================= */
.activacion-form {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.activacion-error {
  color: #DC2626;
  text-align: center;
}

.icono-deshabilitado {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  color: var(--color-text-muted);
}

/* =========================================================
   PANTALLA INICIO
   ========================================================= */
.icon-btn-flotante {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  right: 18px;
  z-index: 5;
}

.toggle-notificaciones-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 200ms var(--ease);
}

.toggle-switch-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: var(--color-white);
  border-radius: 50%;
  transition: transform 200ms var(--ease);
}

.toggle-switch input:checked + .toggle-switch-slider {
  background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-switch-slider::before {
  transform: translateX(20px);
}

.home-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 32px;
}

.role-btn {
  width: 100%;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 34px 20px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.role-btn:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-soft);
}

.role-btn svg {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
}

.role-btn span {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
}

.dashboard-link {
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 8px 12px;
  cursor: pointer;
}

.dashboard-link:active {
  color: var(--color-primary);
}

/* =========================================================
   DASHBOARD (CATEGORÍAS Y PRODUCTOS)
   ========================================================= */
.catalogo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalogo-row {
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalogo-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  text-align: left;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.catalogo-row-nombre {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.catalogo-row-precio {
  font-size: 13px;
  color: var(--color-text-muted);
}

.catalogo-row-acciones {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.catalogo-icon-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--color-bg);
  border-radius: 8px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.catalogo-icon-btn svg { width: 14px; height: 14px; }

.catalogo-icon-btn.eliminar:active {
  color: #DC2626;
}

/* =========================================================
   PLACEHOLDER (CAMARERO)
   ========================================================= */
.placeholder-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 32px;
  text-align: center;
}

.placeholder-icon {
  width: 44px;
  height: 44px;
  color: var(--color-text-muted);
}

.placeholder-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin: 0;
}

.back-btn-solo {
  margin-top: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms var(--ease);
}

.back-btn-solo:active { transform: scale(0.95); }

/* =========================================================
   HEADER DE BARRA (TOGGLE)
   ========================================================= */
.barra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 14px 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn svg { width: 18px; height: 18px; }

.header-spacer { width: 36px; flex-shrink: 0; }

.toggle {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.toggle-opt {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: color 240ms var(--ease), font-size 240ms var(--ease), font-weight 240ms var(--ease);
}

.toggle-opt.is-active {
  color: var(--color-primary);
  font-size: 21px;
  font-weight: 700;
}

/* =========================================================
   CUERPO DE BARRA / VISTAS
   ========================================================= */
.barra-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow-y: auto;
  padding: 20px 18px 24px;
}

.view {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--color-text-muted);
  font-size: 15px;
}

/* =========================================================
   CUADRÍCULA DE MESAS
   ========================================================= */
.mesa-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 0;
}

.estado-vacio {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 48px 20px;
}

@media (max-width: 340px) {
  .mesa-grid { grid-template-columns: 1fr; }
}

.mesa-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.mesa-alert {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #DC2626;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.45);
}

.mesa-card:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-card);
}

.mesa-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.mesa-number {
  font-size: 30px;
  font-weight: 700;
  color: var(--color-primary);
}

/* =========================================================
   LISTA DE TICKETS
   ========================================================= */
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}

.ticket-card {
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.ticket-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-card);
}

.ticket-card-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.ticket-card-date {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* =========================================================
   PANTALLAS DE DETALLE
   ========================================================= */
.detail-header {
  padding: calc(18px + env(safe-area-inset-top)) 18px 6px;
  flex-shrink: 0;
}

.detail-header.detail-header-row,
.detail-header:has(.mesa-title-detalle),
.detail-header:has(.ticket-title-detalle) {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mesa-title-detalle,
.ticket-title-detalle {
  margin: 0;
  font-size: 18px;
}

.text-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
}

.text-back-btn svg { width: 18px; height: 18px; }

.detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 22px 28px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.detail-body::-webkit-scrollbar {
  display: none;
}

.product-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 22px 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-list-wrap::-webkit-scrollbar {
  display: none;
}

.scroll-indicator-sticky {
  position: sticky;
  bottom: 6px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.scroll-indicator-btn {
  pointer-events: auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: transform 200ms var(--ease);
}

.scroll-indicator-btn svg {
  width: 18px;
  height: 18px;
}

.scroll-indicator-btn.is-arriba svg {
  transform: rotate(180deg);
}

.scroll-indicator-btn[hidden] {
  display: none;
}

.detail-footer-fixed {
  flex-shrink: 0;
  padding: 4px 22px calc(22px + env(safe-area-inset-bottom));
}

.mesa-title,
.ticket-title {
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0 18px;
}

.detail-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-header-space {
  justify-content: space-between;
}

.mesa-title-inline {
  margin: 0;
  font-size: 18px;
}

.detail-header-titulo-grupo {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* =========================================================
   PANEL INFERIOR "PEDIR" (pantalla mesa del camarero)
   ========================================================= */
.pedir-panel {
  flex-shrink: 0;
  min-height: 56px;
  background: var(--color-white);
  box-shadow: 0 -4px 16px rgba(27, 36, 48, 0.08);
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
}

.cancelar-panel {
  flex-shrink: 0;
  padding: 0 18px calc(10px + env(safe-area-inset-bottom));
}

.cancelar-pedido-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: #FEE2E2;
  color: #DC2626;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease);
}

.cancelar-pedido-btn:active {
  transform: scale(0.97);
  background: #FECACA;
}

.pedir-btn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: #16A34A;
  color: var(--color-white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease);
}

.pedir-btn-secundario {
  background: var(--color-primary);
}

.pedir-btn:active {
  transform: scale(0.97);
  background: #128A3E;
}

/* =========================================================
   PESTAÑAS DE CATEGORÍA (CAMARERO)
   ========================================================= */
.categoria-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 18px 4px;
  overflow-x: auto;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}

.categoria-tabs.arrastrando {
  cursor: grabbing;
}


.categoria-tab {
  flex-shrink: 0;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.categoria-tab.is-active {
  background: var(--color-primary);
  color: var(--color-white);
}

/* =========================================================
   GRID DE PRODUCTOS (CAMARERO)
   ========================================================= */
.producto-grid-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 18px 18px;
}

.producto-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.producto-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  cursor: pointer;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}

.producto-card:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-card);
}

.producto-nombre {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

.producto-precio {
  font-size: 12px;
  color: var(--color-text-muted);
}

.producto-cantidad-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

/* =========================================================
   BARRA DE CARRITO (CAMARERO)
   ========================================================= */
.carrito-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--color-primary);
  color: var(--color-white);
  cursor: pointer;
  min-height: 56px;
}

.carrito-info {
  font-size: 14px;
  font-weight: 600;
}

.carrito-total {
  font-size: 17px;
  font-weight: 700;
}

/* =========================================================
   MODAL DE CONFIRMACIÓN (SALIR CON PRODUCTOS SIN GUARDAR)
   ========================================================= */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 28, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 50;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 300px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.modal-texto {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
}

.modal-botones {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn-secundario {
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.modal-btn-primario {
  background: #DC2626;
  color: var(--color-white);
}

.modal-btn-azul {
  background: var(--color-primary);
  color: var(--color-white);
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text);
}

.modal-card-mini {
  max-width: 260px;
  padding: 18px 20px;
}

.modal-titulo-izquierda {
  text-align: left;
}

/* Panel lateral del Dashboard: no usa el mecanismo hidden/instantáneo del resto de modales
   (display:none no se puede animar), sino una clase que transiciona fondo + deslizamiento. */
.panel-lateral-fondo {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 28, 0);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
  pointer-events: none;
  transition: background 320ms var(--ease);
}

.panel-lateral-fondo[hidden] {
  display: none;
}

.panel-lateral-fondo.abierto {
  background: rgba(15, 20, 28, 0.5);
  pointer-events: auto;
}

.panel-lateral {
  width: 78%;
  max-width: 280px;
  height: 100%;
  background: var(--color-white);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  text-align: left;
  transform: translateX(100%);
  transition: transform 380ms var(--ease);
}

.panel-lateral-fondo.abierto .panel-lateral {
  transform: translateX(0);
}

.resumen-total-label {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

.resumen-total-hoy {
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  color: var(--color-text);
  margin: 2px 0 20px;
}

.barra-metodo-pago-fila {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.barra-metodo-pago-label {
  width: 62px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.barra-metodo-pago {
  flex: 1;
  height: 10px;
  background: var(--color-bg);
  border-radius: 999px;
  overflow: hidden;
}

.barra-metodo-pago-relleno {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 300ms var(--ease);
}

.barra-metodo-pago-porcentaje {
  width: 38px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.grupo-dia-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin: 20px 0 10px;
}

.grupo-dia-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card-mini .modal-texto {
  margin: 0;
  font-weight: 600;
}

/* =========================================================
   CONFIGURACIÓN DE MESAS (CAMARERO)
   ========================================================= */

.modal-titulo {
  font-size: 17px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 18px;
  text-align: center;
}

.modal-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.modal-menu-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

.modal-btn-cerrar {
  width: 100%;
}

.modal-texto-secundario {
  text-align: center;
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin: 0 0 18px;
}

.contador-mesas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-bottom: 14px;
}

.contador-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.contador-numero {
  font-size: 30px;
  font-weight: 800;
  color: var(--color-text);
  min-width: 36px;
  text-align: center;
}

.modal-select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-white);
}

/* lista de productos, compartida entre mesa y ticket */
.product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.product-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

.product-list li:last-child { border-bottom: none; }

.ronda-label {
  padding: 10px 16px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.ronda-label.ronda-finalizada {
  color: var(--color-text-muted);
  background: var(--color-bg);
  font-style: italic;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}

.product-list li.producto-finalizado .product-qty-name,
.product-list li.producto-finalizado .product-price,
.product-list li.producto-finalizado .producto-nota-texto {
  color: var(--color-text-muted);
}

.product-info-simple {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* =========================================================
   PRODUCTO EDITABLE (RESUMEN DEL CAMARERO): +/- y nota
   ========================================================= */

.product-list li.producto-editable {
  align-items: flex-start;
  gap: 12px;
}

.producto-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.producto-nombre-editable {
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}

.producto-nota-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nota-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--color-bg);
  border-radius: 6px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nota-btn svg {
  width: 13px;
  height: 13px;
}

.producto-nota-texto {
  font-size: 12px;
  color: var(--color-primary);
  font-style: italic;
  overflow-wrap: anywhere;
}

.producto-controles {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.stepper-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-btn {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-cantidad {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  min-width: 14px;
  text-align: center;
}

.product-qty-name {
  color: var(--color-text);
}

.product-price {
  font-weight: 800;
  font-size: 15px;
  color: var(--color-text);
  flex-shrink: 0;
}

button.product-price {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.product-price-editable {
  font-size: 19px;
  padding: 4px 2px;
  border-bottom: 1px dashed var(--color-text-muted);
}

.producto-card-otro {
  border: 1.5px dashed var(--color-primary);
}

.producto-linea-derecha {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.total-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
}

.total-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-primary);
}

.total-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.listo-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: #16A34A;
  color: var(--color-white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease);
}

.mesa-botones-row {
  display: flex;
  gap: 10px;
}

.mesa-botones-row .listo-btn {
  flex: 1;
  min-width: 0;
}

.cobrar-btn {
  background: var(--color-primary);
}

.listo-btn:active {
  transform: scale(0.97);
  background: #128A3E;
}

.listo-btn.is-cancelar {
  background: #DC2626;
}

.listo-btn.is-cancelar:active {
  background: #B91C1C;
}

.mesa-card.is-listo {
  background: #16A34A;
}

.mesa-card.is-listo .mesa-label,
.mesa-card.is-listo .mesa-number {
  color: var(--color-white);
}

.mesa-card.is-pedido {
  background: #FDE68A;
}

/* Borrador: pedido sin confirmar que se dejó a medias — azul discontinuo, distinto de los
   colores de estado real (amarillo confirmado / verde listo) para no confundirse con ellos.
   Puede combinarse con is-pedido/is-listo si la mesa ya tenía además un pedido confirmado. */
.mesa-card.tiene-borrador {
  border: 2px dashed var(--color-primary);
}

.mesa-borrador-texto {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mesa-card.is-listo .mesa-borrador-texto {
  color: var(--color-white);
}

/* meta del ticket: fecha / hora */
.ticket-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.ticket-meta-item {
  flex: 1;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ticket-meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.ticket-meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

/* resumen: subtotal / iva / total */
.summary-block {
  margin-top: 18px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 6px 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 14px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.summary-row[hidden] {
  display: none;
}

.summary-row:not([hidden]):last-child { border-bottom: none; }

.summary-total {
  border-bottom: none;
}

#fila-devolver {
  border-bottom: none;
}

.summary-total {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 16px;
}

/* método de pago */
.payment-block { margin-top: 20px; }

.payment-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.payment-options {
  display: flex;
  gap: 10px;
}

.payment-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 999px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.payment-chip svg { width: 16px; height: 16px; }

.payment-chip.is-selected {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-card);
}
