﻿/* ==========================================================================
   Grace POS — hoja de estilos del punto de venta
   Distribuciones Grace · sistema visual derivado del logotipo

   Todo se declara bajo el ámbito .gx y con prefijo gx- porque el master
   carga Bootstrap 5 (.card, .btn, .badge, .chip colisionan) y Site.css.
   No modifica ningún estilo global.

   Índice
     1. Tokens
     2. Ámbito y reset
     3. Armazón (shell)
     4. Riel de módulos
     5. Barra superior — escáner
     6. Franja de contexto
     7. Catálogo — filtros, grupos, tarjetas
     8. Ticket
     9. Modal de cobro
    10. Responsivo
    11. Accesibilidad e impresión
   ========================================================================== */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
.gx {
  /* Superficies */
  --gx-paper:      #F2F0EE;
  --gx-surface:    #FFFFFF;
  --gx-surface-2:  #FAF8F7;

  /* Líneas */
  --gx-line:        #E5E1DD;
  --gx-line-strong: #D4CEC8;

  /* Tinta */
  --gx-ink:   #16130F;
  --gx-ink-2: #4E4741;
  --gx-ink-3: #8B827A;

  /* Rosa institucional. --gx-rose NUNCA lleva texto (1.9:1 sobre blanco);
     para texto e iconos se usa --gx-rose-ink, que es AA. */
  --gx-rose:      #E9A3AD;
  --gx-rose-ink:  #B0616F;
  --gx-rose-tint: #FBF1F3;
  --gx-rose-line: #EFD2D7;
  --gx-on-rose:   #16130F;

  /* Semánticos, desaturados para no competir con el rosa de marca */
  --gx-ok:        #2F7355;
  --gx-ok-tint:   #E9F2EC;
  --gx-warn:      #8F6A24;
  --gx-warn-tint: #F6EFE0;
  --gx-crit:      #A8453C;
  --gx-crit-tint: #F8ECEA;

  /* Sobre fondo tinta */
  --gx-on-ink: #FFFFFF;

  /* Auxiliares */
  --gx-shadow:      0 1px 2px rgba(22,19,15,.05), 0 8px 24px -12px rgba(22,19,15,.12);
  --gx-shadow-lift: 0 2px 4px rgba(22,19,15,.06), 0 20px 48px -20px rgba(22,19,15,.22);
  --gx-scrim:       rgba(22,19,15,.42);
  --gx-focus:       var(--gx-rose-ink);

  /* Métrica */
  --gx-rail:     68px;
  --gx-ticket:   372px;
  --gx-radius:   6px;
  --gx-tap:      44px;   /* objetivo táctil mínimo */
  --gx-tap-lg:   56px;   /* acciones de cobro */
}

/* Tema oscuro: sólo se redefinen tokens, nunca componentes. */
@media (prefers-color-scheme: dark) {
  .gx:not([data-gx-theme="light"]) {
    --gx-paper:      #131110;
    --gx-surface:    #1C1918;
    --gx-surface-2:  #232020;
    --gx-line:        #2E2926;
    --gx-line-strong: #3E3733;
    --gx-ink:   #F3F0ED;
    --gx-ink-2: #B7AEA7;
    --gx-ink-3: #867C76;
    --gx-rose-ink:  #F0B4BE;
    --gx-rose-tint: #2A1D20;
    --gx-rose-line: #3F2C30;
    --gx-ok:        #74C09A;
    --gx-ok-tint:   #17251E;
    --gx-warn:      #D4A75C;
    --gx-warn-tint: #282116;
    --gx-crit:      #E28277;
    --gx-crit-tint: #2C1C1A;
    --gx-on-ink: #16130F;
    --gx-shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --gx-shadow-lift: 0 2px 4px rgba(0,0,0,.5), 0 20px 48px -20px rgba(0,0,0,.8);
    --gx-scrim:       rgba(0,0,0,.62);
  }
}
.gx[data-gx-theme="dark"] {
  --gx-paper:      #131110;
  --gx-surface:    #1C1918;
  --gx-surface-2:  #232020;
  --gx-line:        #2E2926;
  --gx-line-strong: #3E3733;
  --gx-ink:   #F3F0ED;
  --gx-ink-2: #B7AEA7;
  --gx-ink-3: #867C76;
  --gx-rose-ink:  #F0B4BE;
  --gx-rose-tint: #2A1D20;
  --gx-rose-line: #3F2C30;
  --gx-ok:        #74C09A;
  --gx-ok-tint:   #17251E;
  --gx-warn:      #D4A75C;
  --gx-warn-tint: #282116;
  --gx-crit:      #E28277;
  --gx-crit-tint: #2C1C1A;
  --gx-on-ink: #16130F;
  --gx-shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --gx-shadow-lift: 0 2px 4px rgba(0,0,0,.5), 0 20px 48px -20px rgba(0,0,0,.8);
  --gx-scrim:       rgba(0,0,0,.62);
}

/* ==========================================================================
   2. ÁMBITO Y RESET
   ========================================================================== */
.gx,
.gx *,
.gx *::before,
.gx *::after { box-sizing: border-box; }

.gx {
  font-family: "Instrument Sans", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gx-ink);
  background: var(--gx-paper);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Neutraliza herencias de Site.css / Bootstrap dentro del POS.
   Todo el reset va envuelto en :where() para que su especificidad sea CERO.
   Sin esto, `.gx button` (0,1,1) le ganaría a `.gx-btn--primary` (0,1,0) y
   el botón de cobro saldría transparente y sin borde. */
:where(.gx) :where(h1, h2, h3, h4, p, ul, ol, figure) {
  margin: 0;
  padding: 0;
}
:where(.gx) :where(ul, ol) { list-style: none; }
:where(.gx) :where(button, input, select) { font: inherit; color: inherit; }
:where(.gx) :where(button) {
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
:where(.gx) :where(img, svg) { display: block; max-width: 100%; }
:where(.gx) :where(a) { color: var(--gx-rose-ink); text-decoration: none; }
:where(.gx) :where(a:hover) { color: var(--gx-ink); }

.gx-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.gx-serif {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
}
.gx-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   3. ARMAZÓN
   ========================================================================== */
.gx-shell {
  display: grid;
  grid-template-columns: var(--gx-rail) minmax(0, 1fr) var(--gx-ticket);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.gx-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ==========================================================================
   4. RIEL DE MÓDULOS
   ========================================================================== */
.gx-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 0 12px;
  background: var(--gx-surface);
  border-right: 1px solid var(--gx-line);
}
.gx-rail__mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  margin-bottom: 18px;
  border: 1px solid var(--gx-line-strong);
  border-radius: 50%;
  flex: none;
}
.gx-rail__mark span {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 21px;
  line-height: 1;
  padding-right: 1px;
}
.gx-rail__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--gx-tap); height: var(--gx-tap);
  border-radius: var(--gx-radius);
  color: var(--gx-ink-3);
  flex: none;
}
.gx-rail__btn:hover { background: var(--gx-surface-2); color: var(--gx-ink-2); }
.gx-rail__btn.is-active { background: var(--gx-ink); color: var(--gx-on-ink); }
.gx-rail__btn.is-active::before {
  content: "";
  position: absolute;
  left: -14px; top: 11px; bottom: 11px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--gx-rose);
}
.gx-rail__spacer { flex: 1 1 auto; }
.gx-rail__avatar {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gx-rose-tint);
  border: 1px solid var(--gx-rose-line);
  color: var(--gx-rose-ink);
  font-size: 12px; font-weight: 600;
  flex: none;
}

/* ==========================================================================
   5. BARRA SUPERIOR — ESCÁNER
   ========================================================================== */
.gx-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--gx-surface);
  border-bottom: 1px solid var(--gx-line);
  flex: none;
}

/* El campo de código de barras es el control más grande de la vista.
   Nace enfocado y recupera el foco tras cada acción. */
.gx-scan {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  background: var(--gx-surface);
  border: 1.5px solid var(--gx-line-strong);
  border-radius: var(--gx-radius);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.gx-scan:focus-within {
  border-color: var(--gx-ink);
  box-shadow: 0 0 0 3px var(--gx-rose-tint);
}
.gx-scan__icon { color: var(--gx-ink-2); flex: none; }
.gx-scan__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  letter-spacing: .01em;
}
.gx-scan__input::placeholder { color: var(--gx-ink-3); }

.gx-kbd {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--gx-line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--gx-surface-2);
  color: var(--gx-ink-3);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  white-space: nowrap;
}

.gx-tbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--gx-line-strong);
  border-radius: var(--gx-radius);
  background: var(--gx-surface);
  color: var(--gx-ink-2);
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}
.gx-tbtn:hover { border-color: var(--gx-ink-3); color: var(--gx-ink); }

/* ==========================================================================
   6. FRANJA DE CONTEXTO
   Sucursal · caja · turno · cajero, siempre visibles: cada venta pertenece
   a alguien. La píldora de conexión importa porque la base es remota.
   ========================================================================== */
.gx-ctx {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  background: var(--gx-surface-2);
  border-bottom: 1px solid var(--gx-line);
  color: var(--gx-ink-3);
  font-size: 12.5px;
  flex: none;
}
.gx-ctx b { color: var(--gx-ink-2); font-weight: 600; }
.gx-ctx__sep { color: var(--gx-line-strong); }
.gx-ctx__spacer { flex: 1 1 auto; }

.gx-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.gx-pill--ok   { background: var(--gx-ok-tint);   color: var(--gx-ok); }
.gx-pill--warn { background: var(--gx-warn-tint); color: var(--gx-warn); }
.gx-pill--crit { background: var(--gx-crit-tint); color: var(--gx-crit); }
.gx-pill--rose { background: var(--gx-rose-tint); color: var(--gx-rose-ink); }
.gx-led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ==========================================================================
   7. CATÁLOGO
   ========================================================================== */
.gx-cat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 20px;
}

/* --- filtros de categoría ------------------------------------------------
   La lista sale de Smart_Categorias, así que tolera N: nunca parte en dos
   renglones, se desplaza en horizontal y se desvanece en el borde. */
.gx-chiprow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
          mask-image: linear-gradient(to right, #000 90%, transparent 100%);
}
.gx-chiprow::-webkit-scrollbar { display: none; }

.gx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--gx-line-strong);
  border-radius: 999px;
  background: var(--gx-surface);
  color: var(--gx-ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.gx-chip:hover { border-color: var(--gx-ink-3); }
.gx-chip.is-active {
  background: var(--gx-ink);
  border-color: var(--gx-ink);
  color: var(--gx-on-ink);
  font-weight: 500;
}
.gx-chip__n { font-size: 11px; font-weight: 600; color: var(--gx-ink-3); }
.gx-chip.is-active .gx-chip__n { color: var(--gx-on-ink); opacity: .62; }
/* Cajón de CategoriaID NULL: siempre existe y siempre va al final. */
.gx-chip--none { border-style: dashed; color: var(--gx-ink-3); }
/* El nombre largo se trunca; la tipografía no se encoge. */
.gx-chip__t {
  display: inline-block;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* --- grupo por categoría ------------------------------------------------- */
.gx-group { margin-bottom: 18px; }
.gx-group:last-child { margin-bottom: 0; }
.gx-group__head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 9px;
}
.gx-group__name {
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gx-ink-2);
  white-space: nowrap;
}
.gx-group__count { font-size: 11px; font-weight: 600; color: var(--gx-ink-3); }
.gx-group__rule { flex: 1 1 auto; height: 1px; background: var(--gx-line); }

/* --- rejilla y tarjeta ---------------------------------------------------
   La tarjeta ES el botón: un toque suma una pieza al ticket. */
.gx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 10px;
}
.gx-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  background: var(--gx-surface);
  border: 1px solid var(--gx-line);
  border-radius: var(--gx-radius);
  transition: border-color .12s ease, box-shadow .12s ease, transform .06s ease;
}
.gx-card:hover { border-color: var(--gx-ink-3); }
.gx-card:active { transform: scale(.985); }
.gx-card.is-incart { border-color: var(--gx-rose-ink); }
.gx-card.is-focus  { border-color: var(--gx-ink); box-shadow: 0 0 0 3px var(--gx-rose-tint); }
/* Agotado se atenúa, no se oculta: el cajero puede ofrecer el pedido. */
.gx-card.is-out { opacity: .5; }

.gx-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--gx-surface-2);
  border-bottom: 1px solid var(--gx-line);
  color: var(--gx-ink-3);
  overflow: hidden;
}
.gx-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Sin foto: iniciales sobre marco punteado, mismo tamaño que con foto,
   para que el catálogo no se vea disparejo mientras suben las imágenes. */
.gx-thumb--none::after {
  content: "";
  position: absolute; inset: 8px;
  border: 1px dashed var(--gx-line-strong);
  border-radius: 4px;
}
.gx-thumb__init {
  position: relative; z-index: 1;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 25px; line-height: 1;
  color: var(--gx-ink-3);
}
/* Servicios: categoría no inventariable. */
.gx-thumb--svc { background: var(--gx-rose-tint); color: var(--gx-rose-ink); }

/* Piezas ya cargadas al ticket. Si es cero, no se pinta. */
.gx-qty {
  position: absolute; z-index: 2;
  top: 7px; right: 7px;
  display: grid; place-items: center;
  min-width: 25px; height: 25px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gx-ink);
  color: var(--gx-on-ink);
  font-size: 12px; font-weight: 600;
  box-shadow: var(--gx-shadow);
}
.gx-promo {
  position: absolute; z-index: 2;
  top: 7px; left: 7px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--gx-rose);
  color: var(--gx-on-rose);
  font-size: 10px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}

.gx-card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  padding: 10px 11px 11px;
}
.gx-card__name {
  font-size: 13px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.gx-card__sku {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; color: var(--gx-ink-3);
}
.gx-card__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.gx-price { font-size: 16px; font-weight: 600; letter-spacing: -.012em; }
.gx-price s { margin-right: 5px; font-size: 12px; font-weight: 400; color: var(--gx-ink-3); }
.gx-stock { font-size: 11px; font-weight: 600; }
.gx-stock--ok  { color: var(--gx-ok); }
.gx-stock--low { color: var(--gx-warn); }
.gx-stock--no  { color: var(--gx-crit); }
.gx-stock--svc { color: var(--gx-rose-ink); }

/* Catálogo vacío */
.gx-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 56px 20px;
  color: var(--gx-ink-3);
  text-align: center;
}
.gx-empty strong { color: var(--gx-ink-2); font-size: 15px; font-weight: 600; }

/* ==========================================================================
   8. TICKET
   Columna fija: el total nunca se sale de pantalla.
   ========================================================================== */
.gx-ticket {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--gx-surface);
  border-left: 1px solid var(--gx-line);
}
.gx-ticket__head {
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--gx-line);
  flex: none;
}
.gx-ticket__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gx-ticket__title { font-size: 15px; font-weight: 600; letter-spacing: -.018em; }

.gx-cust {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 11px;
  padding: 9px 11px;
  background: var(--gx-surface-2);
  border: 1px solid var(--gx-line);
  border-radius: 5px;
}
.gx-cust:hover { border-color: var(--gx-line-strong); }
.gx-cust__icon { color: var(--gx-rose-ink); flex: none; }
.gx-cust__name { font-size: 13px; font-weight: 500; }
.gx-cust__sub  { font-size: 11.5px; color: var(--gx-ink-3); }

/* El cuerpo del ticket vive dentro de un ASPxCallbackPanel, así que entre
   .gx-ticket y sus partes hay un contenedor de por medio. Ese contenedor tiene
   que heredar el comportamiento flexible o la cadena se rompe: la lista de
   renglones crece sin tope y termina empujando el botón de cobrar fuera de la
   pantalla, justo cuando el ticket es largo y más falta hace.

   El :not() cubre las dos formas en que DevExpress puede rendirlo —con o sin
   un div propio envolviendo el contenido— sin tocar a los hijos reales. */
.gx-ticket__cp,
.gx-ticket__cp > div:not(.gx-lines):not(.gx-sums) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gx-lines {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 18px;
}
.gx-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--gx-line);
}
.gx-line:last-child { border-bottom: 0; }
.gx-line__name { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.gx-line__amt  { font-size: 13.5px; font-weight: 600; text-align: right; white-space: nowrap; }
.gx-line__meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--gx-ink-3);
}
/* Explica la promoción en palabras: cuánto se ahorró. */
.gx-line__save {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--gx-rose-ink);
}

.gx-stepper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--gx-line-strong);
  border-radius: 5px;
  background: var(--gx-surface);
  flex: none;
}
.gx-stepper button {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  color: var(--gx-ink-2);
  font-size: 14px;
}
.gx-stepper button:hover { background: var(--gx-surface-2); color: var(--gx-ink); }
/* La cantidad es un campo, no una etiqueta: se teclea. Más ancho que antes
   porque ahora tiene que caber "1000" sin recortarse. */
.gx-stepper__n {
  width: 48px;
  padding: 0;
  text-align: center;
  font: inherit;
  font-size: 12.5px; font-weight: 600; line-height: 26px;
  height: 26px;
  color: var(--gx-ink);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--gx-line);
  border-right: 1px solid var(--gx-line);
  border-radius: 0;
  cursor: text;
  -moz-appearance: textfield;
}
.gx-stepper__n::-webkit-outer-spin-button,
.gx-stepper__n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Al enfocarlo se nota que se está editando: en una caja con prisa, un campo
   que no se distingue de una etiqueta no se usa. */
.gx-stepper__n:focus {
  outline: 2px solid var(--gx-focus);
  outline-offset: -2px;
  background: var(--gx-rose-tint);
}

.gx-tag {
  padding: 1px 6px;
  border: 1px solid var(--gx-rose-line);
  border-radius: 3px;
  background: var(--gx-rose-tint);
  color: var(--gx-rose-ink);
  font-size: 10px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.gx-disc { color: var(--gx-rose-ink); font-weight: 600; }

.gx-sums {
  padding: 14px 18px;
  border-top: 1px solid var(--gx-line);
  background: var(--gx-surface-2);
  flex: none;
}
.gx-sum {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--gx-ink-2);
}
.gx-sum--total {
  align-items: baseline;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--gx-line-strong);
  color: var(--gx-ink);
}
.gx-sum--total .gx-sum__k {
  font-size: 12.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.gx-sum--total .gx-sum__v {
  font-size: 32px; font-weight: 600;
  letter-spacing: -.032em; line-height: 1;
}

.gx-pay {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--gx-line);
  flex: none;
}
.gx-pay__row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* --- botones ------------------------------------------------------------- */
.gx-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: var(--gx-tap-lg);
  border: 1px solid transparent;
  border-radius: var(--gx-radius);
  font-size: 16px; font-weight: 600; letter-spacing: -.005em;
  transition: background-color .12s ease, border-color .12s ease, opacity .12s ease;
}
/* Una sola acción primaria negra por vista. */
.gx-btn--primary {
  background: var(--gx-ink);
  color: var(--gx-on-ink);
  box-shadow: var(--gx-shadow);
}
.gx-btn--primary:hover { opacity: .9; }
.gx-btn--primary .gx-kbd {
  border-color: rgba(255,255,255,.30);
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
}
.gx[data-gx-theme="dark"] .gx-btn--primary .gx-kbd {
  border-color: rgba(0,0,0,.28);
  background: rgba(0,0,0,.12);
  color: rgba(0,0,0,.62);
}
.gx-btn--ghost {
  height: 42px;
  background: var(--gx-surface);
  border-color: var(--gx-line-strong);
  color: var(--gx-ink-2);
  font-size: 14px; font-weight: 500;
}
.gx-btn--ghost:hover { border-color: var(--gx-ink-3); color: var(--gx-ink); }
.gx-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ==========================================================================
   9. MODAL DE COBRO
   ========================================================================== */
.gx-modal-scrim {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 20px;
  background: var(--gx-scrim);
}
.gx-modal {
  width: min(720px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--gx-surface);
  border: 1px solid var(--gx-line-strong);
  border-radius: 8px;
  box-shadow: var(--gx-shadow-lift);
}
/* ==========================================================================
   AVISOS — .gx-alert

   Vive aquí, en la hoja base, y no en grace-erp.css: el POS sólo carga
   grace-pos.css, así que cualquier regla que el punto de venta necesite tiene
   que estar en este archivo o simplemente no existe para él.
   ========================================================================== */
.gx-alert {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 5px;
  font-size: 13.5px;
  line-height: 1.5;
}
.gx-alert.alert-danger {
  background: var(--gx-crit-tint);
  color: var(--gx-crit);
  border: 1px solid var(--gx-crit);
}
.gx-alert.alert-warn {
  background: var(--gx-warn-tint);
  color: var(--gx-warn);
  border: 1px solid var(--gx-warn);
}
.gx-alert.alert-success {
  background: var(--gx-ok-tint);
  color: var(--gx-ok);
  border: 1px solid var(--gx-ok);
}
/* Informativo: explica una regla, no reporta un problema. Por eso va en la
   paleta neutral y no en un color de alarma — si todo grita, nada grita. */
.gx-alert.alert-info {
  background: var(--gx-surface-2);
  color: var(--gx-ink-2);
  border: 1px solid var(--gx-line-strong);
}
.gx-alert strong { font-weight: 600; }

/* Lo que se está cobrando, dentro del modal.
   Con tope de altura y scroll propio: un ticket de cuarenta renglones no puede
   empujar los campos del cobro fuera de la pantalla. */
.gx-cobro-lineas {
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gx-line);
  border-radius: 5px;
  background: var(--gx-surface-2);
}
.gx-cobro-linea {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 11px;
  font-size: 13px;
}
.gx-cobro-linea + .gx-cobro-linea { border-top: 1px solid var(--gx-line); }
.gx-cobro-linea__n {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gx-ink-3);
}
.gx-cobro-linea__d {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-cobro-linea__i {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.gx-modal__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--gx-line);
}
.gx-modal__k {
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gx-ink-3);
}
.gx-modal__amt {
  margin-top: 6px;
  font-size: 34px; font-weight: 600;
  letter-spacing: -.032em; line-height: 1;
}
.gx-modal__body { display: grid; grid-template-columns: minmax(0,1fr) 268px; }
/* ---------------------------------------------------------------------------
   Entrega del ticket, dentro del modal de cobro.

   Los botones son grandes y con área tocable completa: se usan de pie, con
   prisa y a veces con el mouse en la otra mano. Un radio de 13 px del navegador
   no se atina.
   --------------------------------------------------------------------------- */
.gx-entrega {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--gx-line);
}
.gx-entrega__op { display: flex; flex-wrap: wrap; gap: 8px; }

/* ASP.NET envuelve cada opción en un <span> con su input y su label. */
.gx-entrega__op > span {
  display: inline-flex;
  align-items: center;
}
.gx-entrega__op input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.gx-entrega__op label {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--gx-line);
  border-radius: var(--gx-radius);
  background: var(--gx-surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gx-ink-2);
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, background .12s, color .12s;
}
.gx-entrega__op label:hover { border-color: var(--gx-ink-3); }

.gx-entrega__op input[type="radio"]:checked + label {
  border-color: var(--gx-rose-ink);
  background: var(--gx-rose-tint);
  color: var(--gx-ink);
}

/* El foco del teclado tiene que verse: esta pantalla se opera sin mouse. */
.gx-entrega__op input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--gx-focus);
  outline-offset: 2px;
}

.gx-modal__l { padding: 20px 24px; border-right: 1px solid var(--gx-line); }
.gx-modal__r { padding: 20px 24px; background: var(--gx-surface-2); }
.gx-modal__foot {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--gx-line);
}

.gx-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 20px; }
.gx-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 62px;
  border: 1px solid var(--gx-line-strong);
  border-radius: var(--gx-radius);
  background: var(--gx-surface);
  color: var(--gx-ink-2);
  font-size: 12.5px; font-weight: 500;
}
.gx-tab.is-active { background: var(--gx-ink); border-color: var(--gx-ink); color: var(--gx-on-ink); }

.gx-fld { margin-bottom: 16px; }
.gx-fld:last-child { margin-bottom: 0; }
.gx-fld__label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--gx-ink-3);
}
.gx-money {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 62px;
  padding: 0 16px;
  background: var(--gx-surface);
  border: 1.5px solid var(--gx-line-strong);
  border-radius: var(--gx-radius);
}
.gx-money:focus-within { border-color: var(--gx-ink); box-shadow: 0 0 0 3px var(--gx-rose-tint); }
.gx-money__cur { font-size: 22px; font-weight: 500; color: var(--gx-ink-3); }
.gx-money__input {
  flex: 1 1 auto; min-width: 0;
  height: 100%;
  border: 0; outline: 0; background: transparent;
  font-size: 30px; font-weight: 600; letter-spacing: -.03em;
}

.gx-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.gx-quick button {
  display: grid; place-items: center;
  height: var(--gx-tap);
  border: 1px solid var(--gx-line-strong);
  border-radius: var(--gx-radius);
  background: var(--gx-surface);
  color: var(--gx-ink-2);
  font-size: 13.5px; font-weight: 600;
}
.gx-quick button.is-active {
  border-color: var(--gx-rose-ink);
  background: var(--gx-rose-tint);
  color: var(--gx-rose-ink);
}

/* El cambio es lo más grande de la pantalla: es donde se pierde dinero. */
.gx-change {
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--gx-ok-tint);
  border: 1px solid var(--gx-ok);
  border-radius: var(--gx-radius);
}
.gx-change__k {
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gx-ok);
}
.gx-change__v {
  margin-top: 5px;
  font-size: 40px; font-weight: 600;
  letter-spacing: -.035em; line-height: 1.05;
  color: var(--gx-ok);
}
.gx-change--short { background: var(--gx-crit-tint); border-color: var(--gx-crit); }
.gx-change--short .gx-change__k,
.gx-change--short .gx-change__v { color: var(--gx-crit); }

.gx-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--gx-line);
  font-size: 13px;
  color: var(--gx-ink-2);
}
.gx-kv:last-of-type { border-bottom: 0; }

/* ==========================================================================
   10. RESPONSIVO
   ========================================================================== */

/* Barra de total: sólo existe cuando el ticket se colapsa. Se declara ANTES
   de los media queries; si se declarara después anularía el display:flex,
   porque tienen la misma especificidad. */
.gx-totalbar { display: none; }
.gx-totalbar__count {
  display: grid; place-items: center;
  width: var(--gx-tap); height: var(--gx-tap);
  border-radius: var(--gx-radius);
  background: var(--gx-rose-tint);
  border: 1px solid var(--gx-rose-line);
  color: var(--gx-rose-ink);
  font-size: 14px; font-weight: 600;
  flex: none;
}
.gx-totalbar__body { flex: 1 1 auto; min-width: 0; }
.gx-totalbar__k {
  font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--gx-ink-3);
}
.gx-totalbar__v {
  font-size: 26px; font-weight: 600;
  letter-spacing: -.03em; line-height: 1.1;
}
.gx-totalbar .gx-btn { width: auto; padding: 0 26px; }

/* --- escritorio angosto -------------------------------------------------- */
@media (max-width: 1279px) {
  .gx-shell { --gx-ticket: 330px; }
}

/* --- tablet: el ticket se colapsa en barra inferior ----------------------
   No es la vista de escritorio encogida: el ticket sale del flujo y deja
   una barra anclada con piezas, total y botón de cobro. */
@media (max-width: 1023px) {
  .gx-shell {
    grid-template-columns: var(--gx-rail) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .gx-rail { grid-row: 1 / 3; }

  .gx-ticket {
    position: fixed;
    z-index: 50;
    top: 0; right: 0; bottom: 0;
    width: min(400px, 88vw);
    border-left: 1px solid var(--gx-line-strong);
    box-shadow: var(--gx-shadow-lift);
    transform: translateX(100%);
    transition: transform .2s ease;
  }
  .gx-ticket.is-open { transform: translateX(0); }

  .gx-totalbar {
    display: flex;
    align-items: center;
    gap: 14px;
    grid-column: 2;
    padding: 12px 16px;
    background: var(--gx-surface);
    border-top: 1px solid var(--gx-line);
  }
  .gx-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* --- teléfono: se escanea, no se navega ---------------------------------- */
@media (max-width: 767px) {
  .gx-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .gx-rail { display: none; }
  .gx-totalbar { grid-column: 1; }

  .gx-topbar { gap: 9px; padding: 12px 14px; }
  .gx-tbtn { padding: 0 13px; }
  .gx-tbtn span:not(.gx-kbd) { display: none; }   /* sólo el icono */
  .gx-tbtn .gx-kbd { display: none; }
  .gx-ctx { padding: 7px 14px; font-size: 11.5px; }
  .gx-cat { padding: 12px 14px 16px; }
  .gx-grid { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 8px; }
  .gx-ticket { width: 100vw; }

  .gx-modal__body { grid-template-columns: minmax(0, 1fr); }
  .gx-modal__l { border-right: 0; border-bottom: 1px solid var(--gx-line); }
  .gx-modal__foot { grid-template-columns: 1fr; }
  .gx-tabs { grid-template-columns: repeat(2, 1fr); }
}

/* --- táctil --------------------------------------------------------------
   En pantallas táctiles no hay hover (no lo simulamos) y ningún objetivo
   puede bajar de 44 px: con el dedo, el chip de 32 px y el ± de 26 px que
   funcionan con ratón se vuelven inoperables. */
@media (hover: none) {
  .gx-card:hover  { border-color: var(--gx-line); }
  .gx-chip:hover  { border-color: var(--gx-line-strong); }
  .gx-tbtn:hover  { border-color: var(--gx-line-strong); color: var(--gx-ink-2); }
  .gx-stepper button:hover { background: none; color: var(--gx-ink-2); }

  .gx-chip { min-height: var(--gx-tap); padding: 5px 15px; }

  .gx-stepper button { width: var(--gx-tap); height: var(--gx-tap); font-size: 17px; }
  .gx-stepper__n { width: 40px; font-size: 14px; line-height: var(--gx-tap); }
  .gx-line__meta { gap: 11px; }
}

/* ==========================================================================
   11. ACCESIBILIDAD E IMPRESIÓN
   ========================================================================== */
.gx :focus-visible {
  outline: 2px solid var(--gx-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .gx *,
  .gx *::before,
  .gx *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .gx-rail, .gx-topbar, .gx-ctx, .gx-cat,
  .gx-pay, .gx-totalbar, .gx-modal-scrim { display: none !important; }
  .gx-shell { display: block; height: auto; }
  .gx-ticket { position: static; transform: none; border: 0; box-shadow: none; }
}
