.inventory-public,
.inventory-dashboard-shell,
.inventory-detail-public {
  max-width: 100%;
}

.inventory-public-results {
  margin-left: auto;
  margin-right: auto;
  /* max-width eliminado 2026-04-21: el wrapper heredaba 1200px y
   * restringia el grid de cards a 1200px mientras el container-xl ya
   * ofrece 1320px. Se dejaba ~120px de hueco lateral y forzaba un
   * layout mas estrecho que /directorio. */
  max-width: none;
}

[data-bs-theme="light"] .inventory-public {
  --inventory-filter-surface: rgba(var(--bs-body-bg-rgb), 0.96);
  --inventory-filter-border: rgba(var(--bs-body-color-rgb), 0.14);
  --inventory-filter-muted: rgba(var(--bs-body-color-rgb), 0.72);
  --inventory-filter-text: var(--bs-body-color);
  --inventory-filter-chip-bg: rgba(var(--bs-body-bg-rgb), 0.88);
  --inventory-filter-chip-hover: rgba(var(--bs-primary-rgb), 0.08);
  --inventory-filter-chip-active: rgba(var(--bs-primary-rgb), 0.14);
  --inventory-filter-dropdown-bg: rgba(var(--bs-body-bg-rgb), 0.99);
  --inventory-filter-dropdown-shadow: 0 1.25rem 2.5rem rgba(15, 23, 42, 0.16);
  --inventory-filter-overlay: rgba(15, 23, 42, 0.42);
}

[data-bs-theme="dark"] .inventory-public {
  --inventory-filter-surface: rgba(20, 30, 52, 0.9);
  --inventory-filter-border: rgba(255, 255, 255, 0.12);
  --inventory-filter-muted: rgba(248, 251, 255, 0.72);
  --inventory-filter-text: rgba(248, 251, 255, 0.82);
  --inventory-filter-chip-bg: transparent;
  --inventory-filter-chip-hover: rgba(96, 165, 250, 0.08);
  --inventory-filter-chip-active: rgba(96, 165, 250, 0.14);
  --inventory-filter-dropdown-bg: rgba(20, 30, 52, 0.98);
  --inventory-filter-dropdown-shadow: 0 1.25rem 2.5rem rgba(3, 10, 28, 0.35);
  --inventory-filter-overlay: rgba(3, 10, 28, 0.56);
}

.inventory-hero {
  display: grid;
  gap: 1rem;
}

.inventory-secondary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.inventory-secondary-btn,
.inventory-filter-chip {
  border-radius: 999px;
}

.inventory-search-bar {
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 30;
}

.inventory-search-bar > .form-control {
  border-radius: 999px;
  min-height: 3.4rem;
  padding-left: 3rem;
}

.inventory-search-icon {
  color: var(--bs-secondary-color);
  font-size: 1rem;
  left: 1rem;
  pointer-events: none;
  position: absolute;
  top: 1.12rem;
  z-index: 2;
}

.inventory-filter-box {
  background: var(--inventory-filter-surface);
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.12);
  border-radius: 1.4rem;
  overflow: visible;
  position: relative;
  z-index: 40;
}

.inventory-filters-header {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1rem 1.2rem;
}

.inventory-filters-count {
  color: var(--inventory-filter-muted);
  font-size: 0.84rem;
  margin-left: auto;
}

.inventory-filters-body {
  border-top: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
  overflow: visible;
  padding: 1rem 1.2rem 1.2rem;
  position: relative;
  z-index: 45;
}

.inventory-filter-box.collapsed .inventory-filters-body {
  display: none;
}

.inventory-filter-box.collapsed .inventory-filters-chevron {
  transform: rotate(-90deg);
}

.inventory-filters-chevron {
  transition: transform 0.18s ease;
}

.inventory-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.inventory-filters-grid {
  display: grid;
  gap: 1rem;
}

.filter-chip {
  align-items: center;
  background: var(--inventory-filter-chip-bg);
  border: 1px solid var(--inventory-filter-border);
  border-radius: 999px;
  color: var(--inventory-filter-text);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.88rem;
  gap: 0.45rem;
  min-height: 2.65rem;
  padding: 0.55rem 1rem;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-chip:hover,
.filter-chip.active,
.filter-chip.has-value {
  border-color: rgba(96, 165, 250, 0.6);
  color: var(--inventory-filter-text);
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--inventory-filter-chip-hover);
}

.filter-chip.has-value {
  background: var(--inventory-filter-chip-active);
}

.filter-chip-reset {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding-inline: 0.9rem;
}

.filters-separator {
  background: var(--inventory-filter-border);
  height: 1.8rem;
  width: 1px;
}

.sort-chip.active {
  background: rgba(59, 130, 246, 0.16);
}

.sort-icon {
  opacity: 0.7;
}

.inventory-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.category-wrapper {
  position: relative;
  z-index: 60;
}

.category-dropdown {
  background: var(--inventory-filter-dropdown-bg);
  border: 1px solid var(--inventory-filter-border);
  border-radius: 1rem;
  box-shadow: var(--inventory-filter-dropdown-shadow);
  display: none;
  left: 0;
  max-height: 19rem;
  min-width: 16rem;
  overflow: hidden;
  position: absolute;
  top: calc(100% + 0.45rem);
  z-index: 1200;
}

.category-dropdown.open {
  display: block;
}

.category-dropdown-header {
  align-items: center;
  border-bottom: 1px solid var(--inventory-filter-border);
  color: var(--inventory-filter-text);
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.category-reset-btn {
  background: transparent;
  border: 0;
  color: #60a5fa;
  font-size: 0.82rem;
}

.category-dropdown-list {
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.category-dropdown-list label {
  align-items: center;
  color: var(--inventory-filter-text);
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
}

.category-dropdown-list label:hover {
  background: var(--inventory-filter-chip-hover);
}

.filter-modal-overlay {
  align-items: center;
  background: var(--inventory-filter-overlay);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 1055;
}

.filter-modal-overlay.open {
  display: flex;
}

.inventory-filter-modal-card {
  background: var(--inventory-filter-dropdown-bg);
  border: 1px solid var(--inventory-filter-border);
  border-radius: 1.2rem;
  box-shadow: var(--inventory-filter-dropdown-shadow);
  color: var(--inventory-filter-text);
  display: grid;
  gap: 1rem;
  max-width: 32rem;
  padding: 1.25rem;
  width: 100%;
}

.filter-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

[data-bs-theme="light"] .filter-chip-reset {
  background: rgba(239, 68, 68, 0.08);
}

[data-bs-theme="light"] .inventory-filter-modal-card .form-control {
  background: rgba(var(--bs-body-bg-rgb), 0.92);
  border-color: rgba(var(--bs-body-color-rgb), 0.14);
  color: var(--bs-body-color);
}

[data-bs-theme="light"] .inventory-filter-modal-card .form-control::placeholder {
  color: rgba(var(--bs-body-color-rgb), 0.55);
}

.inventory-results-summary {
  color: var(--bs-secondary-color);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

/* Cards publicas de repuestos: reglas especificas movidas a
   repuestos_cards_desktop.css y repuestos_cards_mobile.css.
   Aqui solo quedan reglas compartidas entre cards y detalle/dashboard. */

.inventory-detail-panel {
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.98), rgba(28, 38, 62, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.7rem;
  box-shadow: 0 1rem 2.5rem rgba(7, 12, 30, 0.24);
  color: #f8fbff;
  overflow: hidden;
  position: relative;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

[data-bs-theme="dark"] .inventory-detail-panel {
  background: linear-gradient(
    145deg,
    rgba(30, 41, 68, 0.75) 0%,
    rgba(17, 27, 48, 0.88) 100%
  );
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.3);
}

.inventory-card-media {
  background: rgba(0, 0, 0, 0.28);
  height: 15rem;
  overflow: hidden;
  position: relative;
}

.inventory-card-media--detail {
  height: min(34rem, 68vh);
}

.inventory-card-media--placeholder {
  align-items: center;
  display: flex;
  justify-content: center;
}

.inventory-card-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.inventory-zoomable-image {
  cursor: zoom-in;
}

.inventory-card-placeholder {
  align-items: center;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  font-size: 2.4rem;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.inventory-detail-gallery {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  gap: 0.5rem;
  min-height: 5rem;
  overflow-x: auto;
  padding: 0.75rem 1rem;
}

.inventory-card-category {
  color: #4b7dff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.inventory-card-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  gap: 0.35rem;
  padding: 0.24rem 0.5rem;
}

.inventory-card-badge--sale {
  color: #26d399;
}

.inventory-card-badge--used {
  color: #f5b942;
}

.inventory-card-badge--community {
  color: #4cc9f0;
}

.inventory-card-badge--hidden {
  color: rgba(255, 255, 255, 0.7);
}

.inventory-empty-state {
  border: 1px dashed rgba(var(--bs-body-color-rgb), 0.16);
  border-radius: 1.4rem;
}

.inventory-empty-icon {
  color: var(--bs-secondary-color);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.inventory-pagination-wrap {
  margin-top: 1.5rem;
}

.inventory-detail-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  color: #f8fbff;
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
}

.inventory-detail-label,
.inventory-detail-heading {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inventory-detail-heading {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.inventory-table-thumb {
  align-items: center;
  background: rgba(var(--bs-body-color-rgb), 0.06);
  border-radius: 0.9rem;
  display: inline-flex;
  height: 3.8rem;
  justify-content: center;
  overflow: hidden;
  width: 3.8rem;
}

.inventory-table-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.inventory-table-thumb--placeholder {
  color: var(--bs-secondary-color);
}

.inventory-table td,
.inventory-table th {
  vertical-align: middle;
}

/* ----------------------------------------------------------------------------
   Dashboard interno: toolbar + tabla (paridad visual con clientes.css)

   Replica el aspecto de .clientes-dashboard-toolbar y .clientes-table-wrapper:
   ambas zonas envueltas en caja con border + sombra + radius, y la tabla con
   scroll horizontal en pantallas pequenyas. Variables --inv-dash-* con los
   mismos valores que --cli-* para que el resultado sea identico.
---------------------------------------------------------------------------- */

[data-bs-theme="light"] .inventory-dashboard-shell {
  --inv-dash-surface: rgba(var(--bs-body-bg-rgb), 0.96);
  --inv-dash-surface-soft: rgba(var(--bs-body-bg-rgb), 0.86);
  --inv-dash-border: rgba(var(--bs-body-color-rgb), 0.14);
  --inv-dash-text: var(--bs-body-color);
  --inv-dash-text-muted: rgba(var(--bs-body-color-rgb), 0.66);
  --inv-dash-card-bg: rgba(var(--bs-body-bg-rgb), 0.98);
  --inv-dash-card-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.06);
  --inv-dash-row-hover: rgba(var(--bs-primary-rgb), 0.04);
  --inv-dash-row-divider: rgba(var(--bs-body-color-rgb), 0.08);
}

[data-bs-theme="dark"] .inventory-dashboard-shell {
  --inv-dash-surface: rgba(20, 30, 52, 0.92);
  --inv-dash-surface-soft: rgba(20, 30, 52, 0.78);
  --inv-dash-border: rgba(255, 255, 255, 0.12);
  --inv-dash-text: rgba(248, 251, 255, 0.88);
  --inv-dash-text-muted: rgba(248, 251, 255, 0.6);
  --inv-dash-card-bg: rgba(20, 30, 52, 0.96);
  --inv-dash-card-shadow: 0 0.5rem 1.5rem rgba(3, 10, 28, 0.4);
  --inv-dash-row-hover: rgba(96, 165, 250, 0.08);
  --inv-dash-row-divider: rgba(255, 255, 255, 0.06);
}

/* Toolbar de filtros como caja (mantiene el row g-3 de Bootstrap dentro) */
.inventory-dashboard-shell .inventory-dashboard-toolbar {
  padding: 1rem;
  background-color: var(--inv-dash-surface);
  border: 1px solid var(--inv-dash-border);
  border-radius: 1rem;
  box-shadow: var(--inv-dash-card-shadow);
}

.inventory-dashboard-shell .inventory-dashboard-toolbar .form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--inv-dash-text-muted);
}

/* Tabla envuelta en caja con border + sombra */
.inventory-table-wrapper {
  background-color: var(--inv-dash-card-bg);
  border: 1px solid var(--inv-dash-border);
  border-radius: 1rem;
  box-shadow: var(--inv-dash-card-shadow);
  overflow: hidden;
}

.inventory-table-wrapper--scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.inventory-table {
  margin-bottom: 0;
  color: var(--inv-dash-text);
}

.inventory-table--scroll {
  min-width: 64rem;
  width: 100%;
}

.inventory-table thead th {
  background-color: var(--inv-dash-surface-soft);
  color: var(--inv-dash-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--inv-dash-border);
}

.inventory-table tbody tr {
  border-bottom: 1px solid var(--inv-dash-row-divider);
}

.inventory-table tbody tr:last-child {
  border-bottom: 0;
}

.inventory-table tbody tr:hover {
  background-color: var(--inv-dash-row-hover);
}

.inventory-table tbody td {
  color: var(--inv-dash-text);
  border: 0;
}

.inventory-image-dialog {
  justify-content: center;
  margin: 1rem auto;
  max-width: none;
  width: auto;
}

.inventory-image-modal .modal-content {
  background-color: rgba(var(--bs-body-bg-rgb), 0.96);
  border-radius: 1.15rem;
  backdrop-filter: blur(10px);
  width: auto;
  /* Glow azul apple como halo permanente mientras el modal esta
   * abierto — coherente con el sistema de cards. */
  box-shadow: 0 18px 52px rgba(0, 122, 255, 0.3);
}

[data-bs-theme="dark"] .inventory-image-modal .modal-content {
  box-shadow: 0 18px 52px rgba(0, 122, 255, 0.45);
}

.inventory-image-modal .modal-header {
  padding: 0.5rem 0.5rem 0 0.5rem;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
}

.inventory-image-modal .modal-body {
  padding: 0.75rem;
}

#inventoryModalImage {
  height: auto;
  max-height: min(82vh, 56rem);
  max-width: min(92vw, 72rem);
  width: auto;
}

@media (max-width: 767.98px) {
  .inventory-card-media {
    height: 12rem;
  }
}
