@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  /* Palette principal — azul corporativo */
  --primary: #1d4ed8;        /* blue-700 */
  --primary-hover: #1e40af;  /* blue-800 */
  --primary-light: #eff6ff;  /* blue-50  */
  --accent: #2dd4bf;         /* teal accent */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --text-main: #020617;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  /* Bootstrap CSS vars */
  --bs-primary: #1d4ed8;
  --bs-primary-rgb: 29, 78, 216;
  --bs-primary-text-emphasis: #ffffff;
  --bs-primary-bg-subtle: #eff6ff;
  --bs-primary-border-subtle: #bfdbfe;
  --bs-link-color: #1d4ed8;
  --bs-link-hover-color: #1e40af;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-float: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

html {
  font-size: 14px;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .modal-title {
  font-family: 'Outfit', system-ui, sans-serif;
  letter-spacing: 0;
}

/* Scrollbar minimalista */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; border: 2px solid var(--bg-body); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Navbar tipo Glassmorphism */
.navbar-glass {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.navbar-glass .navbar-brand { color: var(--primary) !important; font-weight: 700; letter-spacing: 0;}
.navbar-glass .navbar-collapse { min-width: 0; }
.navbar-glass .nav-link { color: var(--text-muted) !important; font-weight: 500; transition: color 0.15s ease, background-color 0.15s ease; border-radius: 6px; padding: 0.38rem 0.58rem;}
.navbar-glass .nav-link:hover { color: var(--primary) !important; background-color: var(--primary-light); }
.navbar-glass .nav-link.active { color: var(--primary) !important; font-weight: 600; background-color: var(--primary-light); }
.navbar-glass .dropdown-menu { border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); border-radius: var(--radius-md); padding: 0.35rem; }
.navbar-glass .app-menu { min-width: 15.5rem; }
.navbar-glass .dropdown-item { border-radius: 4px; padding: 0.42rem 0.72rem; color: var(--text-main); font-weight: 500; transition: color 0.15s ease, background-color 0.15s ease; }
.navbar-glass .dropdown-item:hover,
.navbar-glass .dropdown-submenu.show > .dropdown-item { background-color: var(--primary-light); color: var(--primary); }
.navbar-glass .navbar-nav { gap: 0.12rem; flex-wrap: nowrap; align-items: center; }
.navbar-glass .dropdown-submenu { position: relative; }
.navbar-glass .dropdown-submenu > .dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.navbar-glass .dropdown-submenu > .dropdown-toggle::after {
  margin-left: auto;
  transform: rotate(-90deg);
}
.navbar-glass .dropdown-submenu > .dropdown-menu {
  top: -0.35rem;
  left: calc(100% + 0.35rem);
  min-width: 15rem;
}
.navbar-glass .dropdown-submenu.is-flipped > .dropdown-menu {
  right: calc(100% + 0.35rem);
  left: auto;
}

@media (min-width: 1400px) {
  .navbar-glass .dropdown-submenu.show > .dropdown-menu,
  .navbar-glass .dropdown-submenu:hover > .dropdown-menu {
    display: block;
  }
}

.navbar-glass .nav-link,
.navbar-glass .dropdown-item,
.navbar-glass .navbar-text,
.navbar-glass .badge {
  white-space: nowrap;
}

@media (max-width: 1399.98px) {
  .navbar-glass .navbar-collapse {
    margin-top: 0.55rem;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-md);
  }

  .navbar-glass .navbar-nav {
    gap: 0.18rem;
  }

  .navbar-glass .nav-link {
    padding: 0.42rem 0.55rem;
  }

  .navbar-glass .dropdown-menu {
    box-shadow: none;
    border-radius: 8px;
    margin-top: 0.15rem;
  }

  .navbar-glass .navbar-nav {
    align-items: stretch;
    flex-wrap: nowrap;
  }

  .navbar-glass .dropdown-submenu > .dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    margin: 0.12rem 0 0.35rem 1rem;
    padding-left: 0.35rem;
    border-left: 2px solid var(--primary-light);
  }

  .navbar-glass .dropdown-submenu.show > .dropdown-menu {
    display: block;
  }

  .navbar-glass .dropdown-submenu > .dropdown-toggle::after {
    transform: rotate(0deg);
  }
}

/* Cards y Superficies */
.card {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
  transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.card-header {
  background-color: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 0.75rem 1rem;
}
.card-body { padding: 1rem; }
.card-footer { padding: 0.75rem 1rem; }

/* Botones Premium */
.btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  border-radius: var(--radius-sm);
  --bs-btn-padding-y: 0.35rem;
  --bs-btn-padding-x: 0.65rem;
  --bs-btn-font-size: 0.875rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn-primary { background-color: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(29, 78, 216, 0.35); }
.btn-primary:hover { background-color: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-primary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Formularios Premium */
.form-label { font-weight: 500; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 0.38rem 0.6rem;
  font-size: 0.88rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.02);
}
.form-control:focus, .form-select:focus { outline: none; } /* Removiendo outline default */
.form-control:focus-visible, .form-select:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
  outline: none;
}
.input-group-text { background-color: #f8fafc; border-color: var(--border-color); color: var(--text-muted); }

/* Ventas Tab Modern */
#ventasTabs { border-bottom: 2px solid var(--border-color); border-radius:0; }
#ventasTabs .nav-link {
  border: none !important;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent !important;
  transition: color 0.15s ease, border-color 0.15s ease;
  border-radius: 0 !important;
}
#ventasTabs .nav-link:hover { color: var(--text-main); border-bottom-color: #cbd5e1 !important;  background-color: transparent; }
#ventasTabs .nav-link.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
  background-color: transparent !important;
}

/* Modales */
.modal-content {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  overscroll-behavior: contain; /* Guideline compliance */
}
.modal-header { border-bottom: 1px solid var(--border-color); background: rgba(255,255,255,0.9); padding: 0.75rem 1rem; }
.modal-body { padding: 1rem; }
.modal-footer { border-top: 1px solid var(--border-color); background: #f8fafc; padding: 0.75rem 1rem; }

/* ── Tablas ──────────────────────────────────────────────────────── */
.table { margin-bottom: 0; font-variant-numeric: tabular-nums; }

/*
 * Regla genérica de celdas — excluye secciones/tablas con table-dark
 * para que nuestro color oscuro no pise el blanco de las cabeceras.
 */
.table:not(.table-dark) > :not(caption) > *:not(.table-dark) > * {
    padding: 0.52rem 0.68rem;
    border-bottom-color: var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

/* Cabecera estándar (sin table-dark): fondo gris claro, texto muted */
.table:not(.table-dark) > thead:not(.table-dark) > tr > th {
    background-color: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover { background-color: var(--primary-light); }

/* ── table-dark: azul corporativo, texto blanco ──────────────────
 *  Se aplica cuando table-dark está en <thead>, <tfoot> o en la
 *  propia <table>. Usamos !important para ganar al reset genérico
 *  que Bootstrap y nuestro propio código colocan sobre las celdas.
 * ──────────────────────────────────────────────────────────────── */

/* Variables de Bootstrap 5 para table-dark */
.table-dark,
.table > .table-dark {
    --bs-table-color:        #fff;
    --bs-table-bg:           #1d4ed8;
    --bs-table-border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    background-color: #1d4ed8;
}

/* Celdas de una sección (thead/tfoot) con table-dark — thead */
.table > thead.table-dark > tr > th,
.table > thead.table-dark > tr > td {
    background-color: #1d4ed8 !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0;
    padding: 0.52rem 0.68rem;
    vertical-align: middle;
}

/* tfoot con table-dark — tono ligeramente más oscuro */
.table > tfoot.table-dark > tr > th,
.table > tfoot.table-dark > tr > td {
    background-color: #1e40af !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    padding: 0.52rem 0.68rem;
    vertical-align: middle;
}

/* Toda la tabla con table-dark (tbody incluido) */
.table.table-dark > :not(caption) > * > * {
    color: #fff !important;
    background-color: #1d4ed8 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    padding: 0.52rem 0.68rem;
    vertical-align: middle;
}

/* ── bg-primary: fondo azul + texto blanco ──────────────────────── */
.bg-primary { background-color: var(--primary) !important; color: #fff !important; }

/* Btn-outline-primary */
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); color: #fff; }

/* Utilidades */
.text-primary { color: var(--primary) !important; }
.btn-action { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

/* Badges */
.badge { padding: 0.35em 0.65em; font-weight: 600; border-radius: 4px; font-variant-numeric: tabular-nums; }
.bg-success { background-color: #10b981 !important; }
.bg-danger { background-color: #ef4444 !important; }
.bg-warning { background-color: #f59e0b !important; color: #fff !important; }
.bg-secondary { background-color: #64748b !important; }

/* Toasts */
.toast-container .toast {
  background-color: rgba(255, 255, 255, 1) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-float) !important;
  color: var(--text-main) !important;
  font-family: inherit;
}
.toast-container .toast .toast-body {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-container .toast.toast-success { border-left: 4px solid #10b981 !important; }

/* Consulta global de producto */
.product-viewer-modal .modal-content {
  border-radius: 18px;
  background: #ffffff;
}

.product-viewer-loading {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.product-viewer {
  --pv-ink: #0f172a;
  --pv-muted: #64748b;
  --pv-line: #e2e8f0;
  color: var(--pv-ink);
}

.product-viewer__hero {
  display: grid;
  grid-template-columns: minmax(220px, 32%) 1fr;
  min-height: 320px;
}

.product-viewer__media {
  background: #f1f5f9;
  border-right: 1px solid var(--pv-line);
  padding: 0.75rem;
  display: grid;
  grid-template-rows: minmax(180px, 240px) auto;
  gap: 0.55rem;
}

.product-viewer__main-image {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--pv-line);
  border-radius: 12px;
}

.product-viewer__empty-image {
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 3rem;
}

.product-viewer__thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.product-viewer__thumb {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}

.product-viewer__thumb.is-active {
  border-color: var(--primary);
}

.product-viewer__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.product-viewer__content {
  padding: 1rem;
}

.product-viewer__topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.product-viewer__title {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.product-viewer__subtitle {
  color: var(--pv-muted);
  font-size: 0.78rem;
  margin-top: 0.28rem;
}

.product-viewer__close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.product-viewer__price-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-viewer__metric {
  border: 1px solid var(--pv-line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
}

.product-viewer__metric--primary {
  background: #fff;
  border-color: rgba(var(--bs-primary-rgb), 0.35);
}

.product-viewer__metric-label {
  color: var(--pv-muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 0.16rem;
}

.product-viewer__metric-value {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 650;
  font-size: 0.94rem;
  line-height: 1.1;
}

.product-viewer__metric--primary .product-viewer__metric-value {
  font-weight: 800;
}

.product-viewer__currency {
  font-size: 0.85em;
  color: var(--pv-muted);
  font-weight: 500;
}

.product-viewer__metric-note {
  color: var(--pv-muted);
  font-size: 0.68rem;
  margin-top: 0.22rem;
  line-height: 1.2;
}

.product-viewer__section {
  border-top: 1px solid var(--pv-line);
  padding-top: 0.65rem;
  margin-top: 0.65rem;
}

.product-viewer__section-title {
  font-size: 0.68rem;
  color: var(--pv-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.product-viewer__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.8rem;
}

.product-viewer__fact-label {
  color: var(--pv-muted);
  font-size: 0.7rem;
  margin-bottom: 0;
}

.product-viewer__fact-value {
  font-weight: 650;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.product-viewer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.product-viewer__chip {
  border: 1px solid var(--pv-line);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 650;
  background: #fff;
  color: #334155;
}

.product-viewer__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.product-viewer__table th {
  color: var(--pv-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.32rem 0.3rem;
  border-bottom: 1px solid var(--pv-line);
}

.product-viewer__table td {
  padding: 0.34rem 0.3rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

@media (max-width: 991.98px) {
  .product-viewer__hero {
    grid-template-columns: 1fr;
  }

  .product-viewer__media {
    border-right: 0;
    border-bottom: 1px solid var(--pv-line);
  }
}

@media (max-width: 575.98px) {
  .product-viewer__content {
    padding: 1rem;
  }

  .product-viewer__price-row,
  .product-viewer__facts {
    grid-template-columns: 1fr;
  }
}
.toast-container .toast.toast-danger { border-left: 4px solid #ef4444 !important; }
.toast-container .toast.toast-warning { border-left: 4px solid #f59e0b !important; }
.toast-container .toast.toast-info { border-left: 4px solid #3b82f6 !important; }
.btn-close { opacity: 0.5; transition: opacity 0.2s ease; }
.btn-close:hover { opacity: 1; }
.btn-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Selector universal de productos */
.product-selector-modal .modal-content {
  border-radius: 18px;
  overflow: hidden;
}

.product-selector {
  --ps-ink: #111827;
  --ps-muted: #64748b;
  --ps-line: #e5e7eb;
  --ps-soft: #f8fafc;
  --ps-accent: #0f766e;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.16), transparent 32rem),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: var(--ps-ink);
}

.product-selector__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.2rem 0.75rem;
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}

.product-selector__eyebrow {
  color: var(--ps-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-selector__title {
  margin: 0.1rem 0 0;
  font-weight: 800;
}

.product-selector__close {
  border-radius: 999px;
}

.product-selector__toolbar {
  padding: 1rem 1.2rem 0.65rem;
}

.product-selector__input-group {
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
}

.product-selector__input-group .input-group-text,
.product-selector__input-group .form-control,
.product-selector__input-group .btn {
  border-color: #dbe4ef;
}

.product-selector__chips,
.product-selector__selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.product-selector__filter-chip,
.product-selector__selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  padding: 0.24rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.product-selector__selected {
  padding: 0 1.2rem 0.65rem;
  margin-top: 0;
}

.product-selector__bulk-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 1.2rem 0.65rem;
}

.product-selector__selected-chip {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.product-selector__filter-chip button,
.product-selector__selected-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.product-selector__filters {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--ps-line);
  border-radius: 14px;
}

.product-selector__filters .form-label {
  color: var(--ps-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-selector__status {
  min-height: 1.4rem;
  padding: 0 1.2rem;
  color: var(--ps-muted);
  font-size: 0.82rem;
}

.product-selector__results {
  max-height: min(54vh, 520px);
  overflow-y: auto;
  padding: 0.35rem 0.65rem 0.9rem;
}

.product-selector__row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.72rem 0.85rem;
  margin-bottom: 0.35rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.product-selector__row:hover,
.product-selector__row.is-active {
  background: #ffffff;
  border-color: rgba(15, 118, 110, 0.38);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.product-selector__row-title {
  font-weight: 800;
  line-height: 1.2;
}

.product-selector__row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.55rem;
  margin-top: 0.22rem;
  color: var(--ps-muted);
  font-size: 0.76rem;
}

.product-selector__row-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  min-width: 170px;
}

.product-selector__metric {
  color: var(--ps-muted);
  font-size: 0.76rem;
}

.product-selector__price {
  color: #047857;
  font-weight: 800;
}

.product-selector__prices {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
  max-width: 260px;
}

.product-selector__price-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #047857;
  font-size: 0.72rem;
  padding: 0.16rem 0.48rem;
}

.product-selector__price-chip span {
  color: #0f766e;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-selector__empty {
  display: grid;
  place-items: center;
  gap: 0.25rem;
  padding: 3rem 1rem;
  color: var(--ps-muted);
  text-align: center;
}

.product-selector__empty i {
  font-size: 2rem;
  opacity: 0.35;
}

.product-selector__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem 1.1rem;
  border-top: 1px solid var(--ps-line);
  background: rgba(255, 255, 255, 0.75);
}

@media (max-width: 575.98px) {
  .product-selector__header,
  .product-selector__toolbar,
  .product-selector__selected,
  .product-selector__bulk-actions,
  .product-selector__footer {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .product-selector__row {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-selector__row-side {
    justify-content: flex-start;
    min-width: 0;
  }
}

/* Barcode Pills - Optimized for readability and aesthetics */
.barcode-pill {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    padding: 0.25rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.barcode-pill:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.barcode-pill .btn-close {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    margin: 0;
    background-size: 0.5rem;
}

/* ─── Estado "cargando" en botones/links (UI.setLoading) ─────────── */
.is-loading {
    pointer-events: none !important;
    cursor: progress !important;
    opacity: 0.85;
}
.is-loading .spinner-border-sm {
    width: 0.95rem;
    height: 0.95rem;
    border-width: 0.14em;
    vertical-align: -0.135em;
}

[x-cloak] { display: none !important; }

/* Compactacion global para pantallas chicas */
@media (max-width: 1199.98px) {
  html { font-size: 13px; }
  body { font-size: 0.875rem; }

  h1, .h1 { font-size: 1.65rem; }
  h2, .h2 { font-size: 1.45rem; }
  h3, .h3 { font-size: 1.25rem; }
  h4, .h4 { font-size: 1.12rem; }
  h5, .h5 { font-size: 1rem; }
  h6, .h6 { font-size: 0.9rem; }

  main.container-fluid {
    padding: 1rem !important;
  }

  .navbar .container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .navbar-glass .navbar-brand {
    font-size: 1rem;
  }

  .navbar-glass .nav-link {
    font-size: 0.84rem;
    padding: 0.32rem 0.46rem;
  }

  .navbar-glass .dropdown-item {
    font-size: 0.84rem;
    padding: 0.32rem 0.6rem;
  }

  .card,
  .modal-content,
  .toast-container .toast {
    border-radius: 10px !important;
  }

  .card-body,
  .modal-body {
    padding: 0.8rem !important;
  }

  .card-header,
  .card-footer,
  .modal-header,
  .modal-footer {
    padding: 0.65rem 0.8rem !important;
  }

  .btn {
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-padding-x: 0.55rem;
    --bs-btn-font-size: 0.82rem;
  }

  .btn-lg {
    --bs-btn-padding-y: 0.42rem;
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-font-size: 0.95rem;
  }

  .form-control,
  .form-select,
  .input-group-text {
    min-height: 32px;
    padding: 0.32rem 0.5rem;
    font-size: 0.84rem;
  }

  .form-control-lg,
  .form-select-lg {
    min-height: 38px;
    padding: 0.42rem 0.65rem;
    font-size: 0.95rem;
  }

  .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.18rem;
  }

  .row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }

  .table:not(.table-dark) > :not(caption) > *:not(.table-dark) > *,
  .table > thead.table-dark > tr > th,
  .table > thead.table-dark > tr > td,
  .table > tfoot.table-dark > tr > th,
  .table > tfoot.table-dark > tr > td,
  .table.table-dark > :not(caption) > * > * {
    padding: 0.42rem 0.5rem;
  }

  .table {
    font-size: 0.82rem;
  }

  .badge {
    padding: 0.24em 0.46em;
    font-size: 0.72rem;
  }

  .display-1 { font-size: 3rem; }
  .display-2 { font-size: 2.75rem; }
  .display-3 { font-size: 2.45rem; }
  .display-4 { font-size: 2.15rem; }
  .display-5 { font-size: 1.9rem; }
  .display-6 { font-size: 1.65rem; }
}

@media (max-width: 767.98px) {
  html { font-size: 12.5px; }
  body { font-size: 0.84rem; }

  main.container-fluid {
    padding: 0.65rem !important;
  }

  .navbar .container-fluid {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }

  .navbar-collapse {
    max-height: calc(100vh - 58px);
    overflow-y: auto;
    padding-top: 0.4rem;
  }

  .navbar-nav {
    gap: 0.15rem;
  }

  .navbar .d-flex.align-items-center.gap-3 {
    gap: 0.45rem !important;
    flex-wrap: wrap;
  }

  .d-flex.justify-content-between,
  .d-flex.align-items-center {
    min-width: 0;
  }

  .card-body,
  .modal-body {
    padding: 0.65rem !important;
  }

  .card-header,
  .card-footer,
  .modal-header,
  .modal-footer {
    padding: 0.55rem 0.65rem !important;
  }

  .modal-dialog {
    margin: 0.45rem;
  }

  .table-responsive {
    margin-left: -0.65rem;
    margin-right: -0.65rem;
    width: calc(100% + 1.3rem);
  }

  .table {
    font-size: 0.78rem;
  }

  .table:not(.table-dark) > :not(caption) > *:not(.table-dark) > *,
  .table > thead.table-dark > tr > th,
  .table > thead.table-dark > tr > td,
  .table > tfoot.table-dark > tr > th,
  .table > tfoot.table-dark > tr > td,
  .table.table-dark > :not(caption) > * > * {
    padding: 0.34rem 0.42rem;
  }

  .btn-action {
    padding: 0.18rem 0.32rem;
    min-width: 30px;
  }

  .p-4 { padding: 0.9rem !important; }
  .px-4 { padding-left: 0.9rem !important; padding-right: 0.9rem !important; }
  .py-4 { padding-top: 0.9rem !important; padding-bottom: 0.9rem !important; }
  .pt-4 { padding-top: 0.9rem !important; }
  .pb-4 { padding-bottom: 0.9rem !important; }
  .ps-4 { padding-left: 0.9rem !important; }
  .pe-4 { padding-right: 0.9rem !important; }

  .p-5 { padding: 1.1rem !important; }
  .px-5 { padding-left: 1.1rem !important; padding-right: 1.1rem !important; }
  .py-5 { padding-top: 1.1rem !important; padding-bottom: 1.1rem !important; }

  .mb-4 { margin-bottom: 0.9rem !important; }
  .mt-4 { margin-top: 0.9rem !important; }
  .my-4 { margin-top: 0.9rem !important; margin-bottom: 0.9rem !important; }
  .gap-3 { gap: 0.55rem !important; }
  .gap-4 { gap: 0.75rem !important; }

  .fs-1 { font-size: 1.65rem !important; }
  .fs-2 { font-size: 1.45rem !important; }
  .fs-3 { font-size: 1.25rem !important; }
  .fs-4 { font-size: 1.08rem !important; }
  .fs-5 { font-size: 0.95rem !important; }

  .display-1 { font-size: 2.35rem; }
  .display-2 { font-size: 2.15rem; }
  .display-3 { font-size: 1.95rem; }
  .display-4 { font-size: 1.75rem; }
  .display-5 { font-size: 1.55rem; }
  .display-6 { font-size: 1.35rem; }

  .product-viewer__hero {
    min-height: auto;
  }

  .product-viewer__media {
    grid-template-rows: minmax(150px, 180px) auto;
  }

  .product-viewer__content {
    padding: 0.65rem !important;
  }
}

@media (max-width: 575.98px) {
  h4, .h4 { font-size: 1rem; }

  .btn {
    --bs-btn-padding-y: 0.26rem;
    --bs-btn-padding-x: 0.46rem;
    --bs-btn-font-size: 0.78rem;
  }

  .btn-sm {
    --bs-btn-padding-y: 0.18rem;
    --bs-btn-padding-x: 0.36rem;
    --bs-btn-font-size: 0.72rem;
  }

  .form-control,
  .form-select,
  .input-group-text {
    min-height: 30px;
    font-size: 0.8rem;
  }

  .modal-xl,
  .modal-lg {
    max-width: none;
  }

  .product-viewer__price-row,
  .product-viewer__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-viewer__metric {
    padding: 0.42rem 0.48rem;
  }
}
