/*
 * a11y.css — Accesibilidad visual TúPOS (contraste, bordes, tipografía 55+)
 * =========================================================
 * Loaded LAST in v4/base.html, DESPUÉS de {% block extra_css %}, para ganar
 * por orden de documento al CSS por vista (pos.css, inventory.css, etc.)
 * que hoy quita el foco y hardcodea pasteles sin borde.
 *
 * Contiene SOLO reglas de comportamiento/estado que no pueden vivir en el
 * archivo de origen (foco, pisos de tamaño, bordes reforzados, disabled,
 * objetivos táctiles, prefers-reduced-motion). El corte a tokens de color
 * de los literales sueltos (Paso 5d) se hace en el archivo de origen, no
 * aquí: parchearlo desde acá dejaría dos verdades.
 */

/* ============================================================
   5a. ANILLO DE FOCO UNIVERSAL
   :focus-visible no dispara en clics de mouse — no ensucia el POS táctil.
   ============================================================ */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, [role="button"]:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus) !important;
  outline-offset: 2px !important;
  border-radius: var(--r-sm);
}

/* ============================================================
   5b. PISO DE TAMAÑO DE LETRA — 13px
   Selectores medidos por debajo de 13px (lista cerrada, ver plan 5b).
   ============================================================ */
.footer-btn span {
  font-size: calc(13px * var(--kx-scale)) !important; /* ~16px */
}

.font-tweaker__title, .font-tweaker__label {
  font-size: 13px !important;
}

.asi-field label, .asi-flabel {
  font-size: 13px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.asi-itm__sub {
  font-size: 13px !important;
}

.asi-itm__input {
  font-size: 15px !important;
}

.asi-chip {
  font-size: 14px !important;
}

.kx-badge, .kx-chip {
  font-size: 14px !important;
  font-weight: 700 !important;
}

.scanned-item-sku, .card-product-sku {
  font-size: calc(13px * var(--kx-scale)) !important;
}

[class*="tab-btn"], [class*="filter-btn"], .tab {
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* Cualquier utilidad que herede: nunca por debajo de 13px */
small, .text-xs, .text-tiny, [class$="__hint"], [class$="__meta"] {
  font-size: 13px !important;
}

/* ============================================================
   5c. RETIRAR EL UPPERCASE MICRO-TRACKEADO
   ============================================================ */
.font-tweaker__title, .font-tweaker__label,
.asi-field label, .asi-flabel,
th, [class$="__label"], [class$="__eyebrow"] {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-family: var(--font-body) !important;
}

/* ============================================================
   5e. BORDES DE CARD Y DIV MÁS PRESENTES
   ============================================================ */
.card, .product-card, .stat-card, .kpi-card, .action-card,
.kx-kpi-card, .modal, .modal-content, .kx-sheet__panel {
  border-width: 1.5px !important;
}
[class*="-card"]:hover:not(:disabled) {
  border-color: var(--border-strong) !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select, textarea {
  border: 1.5px solid var(--border) !important;
}
tr:last-child td { border-bottom: 1px solid var(--border-weak) !important; }

/* ============================================================
   5f. ESTADOS DESHABILITADOS LEGIBLES
   ============================================================ */
.btn-primary:disabled, .btn-danger:disabled,
button:disabled, [aria-disabled="true"] {
  opacity: 1 !important;
  background: var(--surface-3) !important;
  color: var(--fg-2) !important;
  border: 1.5px solid var(--border) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

/* ============================================================
   5g. OBJETIVOS TÁCTILES ≥48px
   ============================================================ */
.page-back-btn { width: 48px !important; height: 48px !important; }
.navbar-btn, .navbar-btn.bell-btn { width: 48px !important; height: 48px !important; }

/* ============================================================
   5h. PESO DE LAS CIFRAS
   ============================================================ */
.total-amount-compact, .scanned-item-subtotal, .card-price,
.row-stock-value, .kx-kpi-card__value, .sale-number-compact {
  font-weight: 700 !important;
}

/* ============================================================
   5i. PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
