/* ═══════════════════════════════════════════════════════
   PRODUCT FILTERS SIDEBAR
   ═══════════════════════════════════════════════════════ */

.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ── Mobile filter overlay (backdrop) ──────────────────── */
.mobile-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 299;
  opacity: 0;
  transition: opacity 0.28s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ── Mobile: sidebar becomes a bottom-sheet drawer ──────── */
@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
  }

  .mobile-filter-overlay.is-visible {
    display: block;
    opacity: 1;
  }

  .filters-sidebar {
    /* Override sidebar to act as a fixed drawer */
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto !important;
    max-height: 88vh;
    z-index: 300;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    overflow-y: auto;
    padding: 0.75rem 1.25rem 2rem;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  }

  .filters-sidebar.is-open {
    transform: translateY(0);
  }
}

/* ── Mobile drawer grip bar ─────────────────────────────── */
.mobile-drawer-grip-bar {
  display: none;
}

@media (max-width: 900px) {
  .mobile-drawer-grip-bar {
    display: block;
    width: 44px;
    height: 5px;
    background: var(--color-border);
    border-radius: 9999px;
    margin: 0 auto 1rem;
    flex-shrink: 0;
  }
}

/* ── Mobile drawer top header ────────────────────────────── */
.mobile-drawer-top {
  display: none;
}

@media (max-width: 900px) {
  .mobile-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--color-primary);
  }

  /* Hide the desktop filters-title on mobile (replaced by mobile-drawer-top) */
  .filters-sidebar .filters-title {
    display: none;
  }
}

.mobile-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.mobile-filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35em;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9999px;
  line-height: 1;
}

.mobile-drawer-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.mobile-drawer-close-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

@media (max-width: 900px) {
  .mobile-drawer-close-btn {
    display: inline-flex;
  }
}

/* ── Mobile filter apply button ─────────────────────────── */
.mobile-filter-apply {
  display: none;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 900px) {
  .mobile-filter-apply {
    display: block;
  }
}

.filters-sidebar {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.filters-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
}

.filters-title svg {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

.filter-group {
  margin-bottom: 1.25rem;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-group:last-child { margin-bottom: 0; }

.filter-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.filter-range input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.filter-range input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #eff6ff;
  border-radius: var(--radius);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--color-surface);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-tag-remove {
  color: var(--color-danger);
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.2rem;
  text-decoration: none;
  transition: transform 0.15s;
}

.filter-tag-remove:hover { transform: scale(1.2); }

.clear-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-danger);
  text-decoration: none;
  border: 1px solid var(--color-danger);
  border-radius: 6px;
  transition: all 0.2s;
  background: var(--color-surface);
}

.clear-filters:hover {
  background: #fef2f2;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}

.products-main {
  min-width: 0;
}

.auto-brand-notice {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 6px;
  flex-wrap: wrap;
}

.auto-detected-chip {
  padding: 0.1rem 0.4rem;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.auto-brand-dismiss {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.auto-brand-dismiss:hover { color: var(--color-danger); }

/* ── Products toolbar (filter btn + count + sort) ───────── */
.products-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

/* Filter toggle button (hidden on desktop, shown on mobile) */
.btn-mobile-filter {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-mobile-filter:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-mobile-filter.has-filters {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .btn-mobile-filter {
    display: inline-flex;
  }
}

.products-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.products-count-pages {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.products-sort {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.products-sort form {
  display: flex;
}

.products-sort select {
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  min-width: 170px;
}

/* ── Mobile toolbar: filter + sort on row 1, count on row 2 ── */
@media (max-width: 900px) {
  .products-toolbar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .btn-mobile-filter {
    order: 1;
    flex-shrink: 0;
  }

  .products-sort {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
  }

  .products-sort select {
    min-width: 0;
    font-size: 0.8rem;
  }

  .products-count {
    order: 3;
    flex: 0 0 100%; /* own line below */
    font-size: 0.8rem;
    color: var(--color-text-muted);
  }
}

/* ── OEM chip list ───────────────────────────────────────────────────────── */
.oem-list { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; }
.oem-chip {
  font-size: 0.68rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   PHOTO GALLERY
   ═══════════════════════════════════════════════════════ */

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.photo-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.photo-link {
  display: block;
  width: 100%;
  height: 100%;
}

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

@media (max-width: 640px) {
  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
}

/* ═══════════════════════════════════════════════════════
   PRODUCT SHOW — Overview layout (info + image)
   ═══════════════════════════════════════════════════════ */

.product-show-overview {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.product-show-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.product-show-image {
  position: sticky;
  top: 1rem;
}

.product-main-image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-main-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.product-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0.5rem;
}

.product-main-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.product-main-image-wrap:hover .product-main-image-overlay {
  opacity: 1;
}

@media (max-width: 800px) {
  .product-show-overview {
    grid-template-columns: 1fr;
  }
  .product-show-image {
    position: static;
    max-width: 220px;
    justify-self: center;
  }
}

/* ═══════════════════════════════════════════════════════
   SUPPLIER PRODUCT CARDS
   ═══════════════════════════════════════════════════════ */

.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.sp-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.sp-card--best {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.sp-card--best:hover {
  border-color: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

/* Header: supplier name + status */
.sp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.sp-card-supplier {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.sp-supplier-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.sp-card--best .sp-supplier-avatar {
  background: var(--color-primary-dark);
}

.sp-supplier-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sp-supplier-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-supplier-name:hover {
  color: var(--color-primary);
}

.sp-best-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.1rem 0.4rem;
  width: fit-content;
}

/* SKU row */
.sp-card-sku-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
}

.sp-card-sku-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sp-card-sku-value {
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  color: var(--color-text);
  font-weight: 500;
  word-break: break-all;
}

/* Metrics: price + stock */
.sp-card-metrics {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sp-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.5rem;
  gap: 0.15rem;
}

.sp-metric-divider {
  width: 1px;
  background: var(--color-border);
  flex-shrink: 0;
  margin: 0.4rem 0;
}

.sp-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.sp-metric-value--best {
  color: var(--color-primary);
}

.sp-metric-value--stock {
  color: var(--color-success);
}

.sp-metric-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* OEM section */
.sp-card-oem {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sp-card-oem-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding-top: 0.1rem;
  white-space: nowrap;
}

/* Image thumbnails */
.sp-card-thumbs {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.sp-thumb-link {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.sp-thumb-link:hover {
  border-color: var(--color-primary);
}

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

.sp-thumb-more {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Actions */
.sp-card-actions {
  display: flex;
  gap: 0.4rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.sp-card-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0.3rem 0.5rem;
}

/* Notice banner */
.sp-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* Empty state */
.sp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--color-text-muted);
  text-align: center;
}

.sp-empty p {
  font-size: 0.875rem;
}

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

/* ── Supplier card: fabricante / origen ─────────────── */
.sp-card-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
}

.sp-card-attr {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.sp-card-attr-key {
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sp-card-attr-val {
  color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════
   PRODUCT SHOW — Metrics row (replaces stats-grid)
   ═══════════════════════════════════════════════════════ */

.pshow-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.pshow-metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: border-color 0.15s;
}

.pshow-metric-card:hover { border-color: #cbd5e1; }

.pshow-metric-card--price {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.pshow-metric-card--highlight {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.pshow-metric-card--zero {
  opacity: 0.75;
}

.pshow-metric-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.pshow-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pshow-metric-card--price .pshow-metric-value { color: var(--color-primary); }
.pshow-metric-card--highlight .pshow-metric-value { color: var(--color-success); }

.pshow-metric-sub {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pshow-margin-badge {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  color: var(--color-success);
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
}

@media (max-width: 900px) {
  .pshow-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .pshow-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   VEHICLE COMPATIBILITY SECTION
   ═══════════════════════════════════════════════════════ */

.compat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.compat-brand-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.compat-brand-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.compat-brand-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}

.compat-brand-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  text-transform: uppercase;
}

.compat-brand-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.compat-brand-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compat-brand-count {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.compat-models-list {
  padding: 0.4rem 0;
}

.compat-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  transition: background 0.1s;
}

.compat-model-row:hover {
  background: #fafbfe;
}

.compat-model-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compat-year-range {
  flex-shrink: 0;
}

.compat-year-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.compat-year-badge--all {
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-color: var(--color-border);
}

.compat-empty-card {
  padding: 1rem 1.25rem;
}

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

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

/* ═══════════════════════════════════════════════════════
   PRODUCT METADATA FOOTER
   ═══════════════════════════════════════════════════════ */

.product-meta-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.6rem 0;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.product-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.product-meta-sep {
  color: var(--color-border);
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════
   PRODUCT SHOW — KPI STRIP (replaces pshow-metrics)
   ═══════════════════════════════════════════════════════ */

.ps-kpi-strip {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.ps-kpi {
  padding: 1.1rem 1.4rem;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ps-kpi:last-child { border-right: none; }

.ps-kpi--price {
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 100%);
  border-right-color: rgba(255,255,255,0.12);
}

.ps-kpi--stock-ok {
  background: linear-gradient(145deg, #14532d 0%, #15803d 100%);
  border-right-color: rgba(255,255,255,0.12);
}

.ps-kpi-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
  display: block;
}

.ps-kpi--price .ps-kpi-eyebrow,
.ps-kpi--stock-ok .ps-kpi-eyebrow {
  color: rgba(255,255,255,0.6);
}

.ps-kpi-number {
  display: block;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.ps-kpi--price .ps-kpi-number,
.ps-kpi--stock-ok .ps-kpi-number {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ps-kpi-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
  line-height: 1.3;
}

.ps-kpi--price .ps-kpi-sub,
.ps-kpi--stock-ok .ps-kpi-sub {
  color: rgba(255,255,255,0.65);
}

.ps-kpi-margin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  margin-top: 0.45rem;
  width: fit-content;
}

.ps-kpi-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.45rem;
  width: fit-content;
}

@media (max-width: 860px) {
  .ps-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }
  .ps-kpi {
    border-bottom: 1px solid var(--color-border);
  }
  .ps-kpi:nth-child(2n) { border-right: none; }
  .ps-kpi:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 480px) {
  .ps-kpi-strip { grid-template-columns: 1fr; }
  .ps-kpi { border-right: none !important; }
  .ps-kpi:last-child { border-bottom: none; }
}

/* ═══════════════════════════════════════════════════════
   PRODUCT SHOW — Metrics layout (price panel + side KPIs)
   ═══════════════════════════════════════════════════════ */

.ps-metrics-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

/* ── Price panel ── */
.ps-price-panel {
  background: linear-gradient(150deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  box-shadow: 0 4px 24px rgba(37,99,235,0.22), 0 1px 4px rgba(0,0,0,0.12);
  border: 1px solid rgba(255,255,255,0.07);
}

.ppp-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.ppp-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-bottom: 0.4rem;
}

.ppp-hero-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ppp-hero-price {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 1;
}

.ppp-copy-btn {
  opacity: 0.5;
  filter: invert(1);
  margin-top: 0.2rem;
}
.ppp-copy-btn:hover { opacity: 0.9; }

/* ── Breakdown rows ── */
.ppp-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
}

.ppp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ppp-row--iva { border-bottom: none; }

.ppp-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ppp-row-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-end;
}

.ppp-row-operator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ppp-row-operator--cost {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}
.ppp-row-operator--margin {
  background: rgba(52,211,153,0.2);
  color: #6ee7b7;
  font-size: 0.9rem;
}
.ppp-row-operator--iva {
  background: rgba(251,191,36,0.2);
  color: #fcd34d;
  font-size: 0.9rem;
}

.ppp-row-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}

.ppp-row-hint {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.38);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppp-row-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
}
.ppp-row-badge--margin {
  background: rgba(52,211,153,0.18);
  color: #6ee7b7;
}
.ppp-row-badge--iva {
  background: rgba(251,191,36,0.18);
  color: #fcd34d;
}

/* Proportional bars */
.ppp-bar-track {
  width: 80px;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.ppp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.ppp-bar--cost   { background: rgba(255,255,255,0.35); }
.ppp-bar--margin { background: #6ee7b7; }
.ppp-bar--iva    { background: #fcd34d; }

.ppp-row-value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-align: right;
  white-space: nowrap;
  min-width: 80px;
}
.ppp-row-value--margin { color: #6ee7b7; }
.ppp-row-value--iva    { color: #fcd34d; }

/* Total row */
.ppp-total-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}
.ppp-total-operator {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  width: 20px;
  text-align: center;
}
.ppp-total-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.ppp-total-value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-align: right;
  white-space: nowrap;
}

.ppp-stale-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fcd34d;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  width: fit-content;
}

.ppp-no-breakdown {
  padding: 1rem 0;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  font-style: italic;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── Side KPIs ── */
.ps-side-kpis {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ps-skpi {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}
.ps-skpi:last-child { border-bottom: none; }

.ps-skpi--ok {
  background: linear-gradient(145deg, #f0fdf4, #dcfce7);
}

.ps-skpi-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
  display: block;
}

.ps-skpi-number {
  display: block;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.ps-skpi--ok .ps-skpi-number {
  color: var(--color-success);
}

.ps-skpi-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .ps-metrics-layout {
    grid-template-columns: 1fr;
  }
  .ps-side-kpis {
    flex-direction: row;
  }
  .ps-skpi {
    flex: 1;
    border-bottom: none;
    border-right: 1px solid var(--color-border);
  }
  .ps-skpi:last-child { border-right: none; }
  .ppp-bar-track { width: 50px; }
}

@media (max-width: 560px) {
  .ps-side-kpis { flex-direction: column; }
  .ps-skpi { border-right: none; border-bottom: 1px solid var(--color-border); }
  .ps-skpi:last-child { border-bottom: none; }
  .ppp-hero-price { font-size: 1.9rem; }
  .ppp-bar-track { display: none; }
}

/* ═══════════════════════════════════════════════════════
   SUPPLIER CARDS — Enhanced Design
   ═══════════════════════════════════════════════════════ */

/* vs-best badge on non-cheapest suppliers */
.sp-vs-best {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-warning);
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 100px;
  padding: 0.08rem 0.45rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Price value gets monospace treatment */
.sp-metric-value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Price comparison mini-bar */
.sp-price-bar-track {
  height: 3px;
  border-radius: 100px;
  background: var(--color-border);
  overflow: hidden;
  margin-top: 0.2rem;
}

.sp-price-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp-price-bar-fill--mid {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.sp-price-bar-fill--high {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

/* Best card gets a subtle top-accent stripe */
.sp-card--best {
  border-top: 3px solid var(--color-success);
  border-color: #16a34a;
}

.sp-card--best:hover {
  border-color: #15803d;
  box-shadow: 0 4px 16px rgba(22,163,74,0.12);
}

.sp-card--best .sp-supplier-avatar {
  background: #16a34a;
}

.sp-best-badge {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

/* Improved supplier card SKU — monospace */
.sp-card-sku-value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 400;
}

/* Images: slightly larger thumbs */
.sp-thumb-link {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
}

.sp-thumb-more {
  width: 48px;
  height: 48px;
}

/* ═══════════════════════════════════════════════════════
   COMPATIBILITY — Enhanced Cards
   ═══════════════════════════════════════════════════════ */

.compat-brand-card {
  border-top: 3px solid var(--color-primary);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.compat-brand-card:hover {
  border-color: var(--color-primary-dark);
  box-shadow: 0 6px 16px rgba(37,99,235,0.1);
  transform: translateY(-1px);
}

.compat-brand-avatar {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  font-weight: 800;
  letter-spacing: 0.02em;
}

.compat-model-row {
  padding: 0.35rem 0;
}

.compat-year-badge {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  color: var(--color-text);
  white-space: nowrap;
}

.compat-year-badge--all {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════
   PRODUCT INFO CARD — Enhanced ficha
   ═══════════════════════════════════════════════════════ */

/* SKU/OEM codes use DM Mono */
.product-sku,
.oem-chip {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* WooCommerce section: monospace IDs */
code {
  font-family: 'DM Mono', ui-monospace, monospace;
}

/* ── ps-kpi-strip: keep 2×2 grid until very small ──────── */
/* Override the previous 1-col at 480px — keep 2-col until 380px */
@media (max-width: 480px) {
  .ps-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }

  .ps-kpi {
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
  }

  .ps-kpi:nth-child(2n) { border-right: none; }
  .ps-kpi:nth-last-child(-n+2) { border-bottom: none; }

  .ps-kpi-number {
    font-size: 1.45rem;
  }

  .ps-kpi {
    padding: 0.875rem 0.875rem;
  }
}

@media (max-width: 360px) {
  .ps-kpi-strip {
    grid-template-columns: 1fr;
  }

  .ps-kpi {
    border-right: none !important;
  }

  .ps-kpi:not(:last-child) {
    border-bottom: 1px solid var(--color-border) !important;
  }
}

/* ═══════════════════════════════════════════════════════
   PATENTE SEARCH BAR
   ═══════════════════════════════════════════════════════ */

.patente-search-bar {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.patente-form {
  margin: 0;
}

.patente-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  transition: border-color 0.15s, background 0.15s;
}

.patente-input-group:focus-within {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.55);
}

.patente-icon {
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}

.patente-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.25rem;
  min-width: 0;
}

.patente-input::placeholder {
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 0;
}

.patente-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  color: var(--color-primary);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.patente-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.patente-btn:active {
  transform: scale(0.97);
}

.patente-result-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  color: #fff;
  flex-wrap: wrap;
}

.patente-vehicle-label {
  font-weight: 600;
}

.patente-raw-model {
  color: rgba(255,255,255,0.65);
  font-size: 0.8rem;
  font-style: italic;
}

.patente-clear-link {
  margin-left: auto;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}

.patente-clear-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

@media (max-width: 600px) {
  .patente-search-bar {
    padding: 1rem;
    border-radius: var(--radius);
  }

  .patente-btn {
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
  }

  .patente-btn span {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════
   PRODUCT CARDS — index listing
   ═══════════════════════════════════════════════════════ */

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Card shell ── */
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.14s ease;
}
.product-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

/* Status-based left accent */
.product-card--active   { border-left-color: #16a34a; }
.product-card--draft    { border-left-color: #94a3b8; }
.product-card--inactive { border-left-color: #d97706; }

/* ── Thumbnail ── */
.product-card-img {
  width: 96px;
  min-height: 96px;
  flex-shrink: 0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--color-border);
  overflow: hidden;
}
.product-card-thumb {
  width: 96px;
  height: 96px;
  object-fit: contain;
  padding: 0.55rem;
  display: block;
}
.product-card-img-placeholder {
  width: 36px;
  height: 36px;
  color: #cbd5e1;
}

/* ── Center body ── */
.product-card-body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Name + badge row */
.product-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.product-card-name {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.12s;
}
.product-card-name:hover { color: var(--color-primary); }
.product-card-header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding-top: 0.05rem;
}

/* IDs row: OEM · SKU · Fabricante */
.product-card-ids {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.pc-oem {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 5px;
  padding: 0.12rem 0.5rem;
}
.pc-oem-label {
  font-size: 0.57rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4ade80;
  line-height: 1;
}
.pc-oem-value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.77rem;
  color: #15803d;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pc-sku {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}
.pc-manufacturer {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text);
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

/* Vehicle compat chips */
.product-card-compat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.compat-icon {
  width: 12px;
  height: 12px;
  color: #64748b;
  flex-shrink: 0;
}
.compat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  font-size: 0.63rem;
  font-weight: 600;
  color: #0369a1;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.compat-chip-more {
  background: #f8fafc;
  border-color: var(--color-border);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Category line */
.pc-category {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.69rem;
  color: var(--color-text-muted);
  margin-top: auto;
}
.pc-category svg {
  width: 10px;
  height: 10px;
  opacity: 0.45;
  flex-shrink: 0;
}

/* ── Stats sidebar (right column) ── */
.product-card-stats {
  flex-shrink: 0;
  width: 130px;
  border-left: 1px solid var(--color-border);
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.6rem;
  gap: 0.45rem;
}
.pc-stat-price-wrap {
  text-align: center;
}
.pc-stat-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text);
  display: block;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.pc-stat-price--empty {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.pc-stat-stock-wrap {
  display: flex;
  justify-content: center;
}
.pc-stat-provs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.67rem;
  color: var(--color-text-muted);
}
.pc-stat-provs svg {
  width: 11px;
  height: 11px;
  opacity: 0.5;
  flex-shrink: 0;
}
.product-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

/* Empty state */
.products-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  gap: 0.625rem;
}
.products-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.products-empty-icon svg {
  width: 28px;
  height: 28px;
  color: #94a3b8;
}
.products-empty-state h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}
.products-empty-state p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  max-width: 380px;
  line-height: 1.5;
}
.products-empty-hint {
  font-size: 0.8rem !important;
  color: #94a3b8 !important;
}

/* ── Mobile: 2-row layout (image+body | stats footer) ── */
@media (max-width: 640px) {
  .product-card {
    flex-wrap: wrap;
    /* flex-direction stays row — image left, content right */
  }

  .product-card-img {
    width: 72px;
    min-height: 72px;
    flex-shrink: 0;
  }
  .product-card-thumb {
    width: 72px;
    height: 72px;
  }
  .product-card-img-placeholder {
    width: 28px;
    height: 28px;
  }

  .product-card-body {
    padding: 0.6rem 0.7rem;
    flex: 1;
    min-width: 0;
  }
  .product-card-name {
    font-size: 0.83rem;
    -webkit-line-clamp: 2;
  }
  .pc-oem-value { font-size: 0.72rem; }
  .pc-sku { font-size: 0.66rem; }
  .compat-chip { font-size: 0.6rem; }
  .pc-category { font-size: 0.65rem; }

  /* Stats wraps to a full-width footer row */
  .product-card-stats {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: 0.45rem 0.7rem;
    gap: 0.65rem;
    background: #fafbfc;
  }
  .pc-stat-price-wrap { flex-shrink: 0; }
  .pc-stat-price { font-size: 0.92rem; letter-spacing: -0.01em; }
  .pc-stat-stock-wrap { flex-shrink: 0; }
  .pc-stat-provs { font-size: 0.63rem; }
  .product-card-actions {
    margin-left: auto;
    margin-top: 0;
    gap: 0.15rem;
  }
}

/* ═══════════════════════════════════════════════════════
   GROUPED RESULTS — agrupado por modelo de vehículo
   ═══════════════════════════════════════════════════════ */

.grouped-results-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0 0.75rem;
  flex-wrap: wrap;
}
.grouped-results-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text);
}
.grouped-results-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  padding: 0.1rem 0.6rem;
}

.product-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Group block ── */
.product-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ── Group header ── */
/* Fusión (split Fase 0): la definición base de .product-group-header (gradiente azul)
   vivía aquí; la pisaba la del bloque "GROUPED VIEW — remove blue gradients" (más abajo).
   Se conservó la definición ganadora en esa posición — incluida tras el @media de 640px,
   donde su padding seguía ganando por orden — sumándole las únicas declaraciones
   supervivientes de esta: display/align-items/gap/flex-wrap. */

.pg-brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #93c5fd;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(147,197,253,0.3);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  flex-shrink: 0;
}
.pg-model-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  flex: 1;
  min-width: 0;
}
.pg-years {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  color: #bfdbfe;
  flex-shrink: 0;
}
.pg-count {
  font-size: 0.65rem;
  color: #93c5fd;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Product rows inside group ── */
.product-group-rows {
  display: flex;
  flex-direction: column;
}

.product-group-row {
  display: grid;
  grid-template-columns: 48px 1fr 160px 90px 110px 100px 72px 80px;
  align-items: center;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.12s;
}
.product-group-row:last-child { border-bottom: none; }
.product-group-row:hover { background: #f8faff; }

.product-group-row > div {
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  color: var(--color-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Thumbnail */
.pgr-thumb {
  padding: 0.35rem 0.5rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pgr-thumb-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}
.pgr-thumb-placeholder {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Name */
.pgr-name { border-right: 1px solid var(--color-border); }
.pgr-name-link {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.3;
  display: block;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}
.pgr-name-link:hover { color: var(--color-primary); }

/* OEM */
.pgr-oem {
  border-right: 1px solid var(--color-border);
}
.pgr-oem-value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.73rem;
  font-weight: 700;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  display: inline-block;
}

/* Fabricante */
.pgr-brand {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-border);
}

/* SKU */
.pgr-sku {
  border-right: 1px solid var(--color-border);
}
.pgr-sku code {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* Precio */
.pgr-price {
  text-align: right;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-right: 1px solid var(--color-border);
}

/* Stock */
.pgr-stock {
  text-align: center;
  border-right: 1px solid var(--color-border);
}

/* Actions */
.pgr-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.pgr-empty { color: var(--color-text-muted); }

/* ── Mobile: grupos en layout compacto ── */
@media (max-width: 640px) {
  .product-group-header {
    padding: 0.55rem 0.75rem;
  }
  .pg-model-name { font-size: 0.72rem; }

  .product-group-row {
    grid-template-columns: 40px 1fr auto;
    grid-template-rows: auto auto;
  }
  .product-group-row > div {
    padding: 0.4rem 0.6rem;
    white-space: normal;
  }
  /* Thumb: col 1, rows 1-2 */
  .pgr-thumb {
    grid-column: 1;
    grid-row: 1 / 3;
    padding: 0.4rem !important;
    border-right: 1px solid var(--color-border);
  }
  /* Name: col 2, row 1 */
  .pgr-name {
    grid-column: 2;
    grid-row: 1;
    border-right: none;
    border-bottom: none;
    padding-bottom: 0.1rem;
  }
  .pgr-name-link { -webkit-line-clamp: 1; }
  /* Actions: col 3, row 1 */
  .pgr-actions {
    grid-column: 3;
    grid-row: 1;
    padding: 0.4rem 0.5rem;
  }
  /* Second row: OEM + price + stock */
  .pgr-oem {
    grid-column: 2;
    grid-row: 2;
    border-right: none;
    border-bottom: none;
    padding-top: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
  }
  /* Hide brand, SKU on mobile */
  .pgr-brand, .pgr-sku { display: none; }
  /* Price and stock in OEM cell */
  .pgr-price {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
    border-right: none;
    padding-top: 0;
    font-size: 0.82rem !important;
  }
  .pgr-stock { display: none; }
}

/* ═══════════════════════════════════════════════════════
   PRODUCTS HERO — clean white multi-search panel
   ═══════════════════════════════════════════════════════ */

.products-hero {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.5rem 1.75rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.products-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.products-hero-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.875rem;
  display: block;
}

.products-hero-form { margin: 0; }

/* ── Primary search bar ── */
.phs-bar {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.25rem 0.25rem 0.25rem 1rem;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.phs-bar:focus-within {
  border-color: #111827;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.07);
}

.phs-icon {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: color 0.15s;
}

.phs-bar:focus-within .phs-icon { color: #374151; }

.phs-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #111827;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.6rem 0;
  min-width: 0;
  line-height: 1.4;
  caret-color: #374151;
}

.phs-input::placeholder { color: #9ca3af; font-weight: 400; }

.phs-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.phs-clear svg { width: 13px; height: 13px; }
.phs-clear:hover { background: #e5e7eb; color: #111827; }

.phs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, transform 0.1s;
  letter-spacing: 0.01em;
  line-height: 1;
}

.phs-btn svg { width: 15px; height: 15px; }
.phs-btn:hover { background: #1f2937; }
.phs-btn:active { transform: scale(0.97); }

/* ── Secondary search inputs: Patente + VIN ── */
.products-hero-secondary-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

.phs-secondary-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.phs-secondary-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  user-select: none;
}

.phs-secondary-label svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  flex-shrink: 0;
}

.phs-secondary-form { margin: 0; }

.phs-secondary-bar {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 9px;
  padding: 0.2rem 0.2rem 0.2rem 0.75rem;
  gap: 0.4rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.phs-secondary-bar:focus-within {
  border-color: #374151;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(55,65,81,0.08);
}

.phs-secondary-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #111827;
  font-size: 0.84rem;
  padding: 0.42rem 0;
  min-width: 0;
  line-height: 1.3;
}

.phs-secondary-input::placeholder { color: #9ca3af; }

.phs-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  color: #374151;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.phs-secondary-btn svg { width: 14px; height: 14px; }
.phs-secondary-btn:hover { background: #e5e7eb; color: #111827; }
.phs-secondary-btn:active { transform: scale(0.96); }

/* ── Hero footer: auto-detected notices ── */
.products-hero-footer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.products-hero-detected {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: 7px;
  font-size: 0.78rem;
  color: #065f46;
  flex-wrap: wrap;
}

.products-hero-chip {
  display: inline-flex;
  padding: 0.1rem 0.4rem;
  background: #e0f2fe;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0369a1;
}

.products-hero-dismiss {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.73rem;
  margin-left: 0.15rem;
  transition: color 0.12s;
}

.products-hero-dismiss:hover { color: #374151; }

/* Inline VIN result within hero */
.phs-vin-result {
  margin-top: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.phs-vin-result--ok  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.phs-vin-result--warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.phs-vin-result--err  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }

/* Patente active result */
.phs-patente-result {
  margin-top: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.phs-patente-clear {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.7rem;
  margin-left: auto;
  white-space: nowrap;
  transition: color 0.12s;
}

.phs-patente-clear:hover { color: #374151; }

/* Mobile */
@media (max-width: 680px) {
  .products-hero {
    padding: 1.1rem 1rem 1rem;
    border-radius: 12px;
  }

  .phs-input { font-size: 0.93rem; }
  .phs-btn-label { display: none; }
  .phs-btn { padding: 0.6rem 0.7rem; }

  .products-hero-secondary-inputs {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   ADVANCED FILTERS ACCORDION (inside hero)
   ═══════════════════════════════════════════════════════ */

.filters-accordion {
  margin-top: 0.875rem;
}

.filters-accordion-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  padding: 0.45rem 0.875rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filters-accordion-summary::-webkit-details-marker { display: none; }

.filters-accordion-summary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

.filters-accordion[open] .filters-accordion-summary {
  background: #eff6ff;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filters-accordion-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.filters-accordion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35em;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9999px;
  line-height: 1;
}

.filters-accordion-chevron {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.filters-accordion[open] .filters-accordion-chevron {
  transform: rotate(180deg);
}

.filters-accordion-body {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 0 0;
  padding-top: 1rem;
}

.fag-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 1.5rem;
}

.fag-section + .fag-section {
  border-left: 1px solid #e5e7eb;
  padding-left: 1.5rem;
}

.fag-section:last-child {
  padding-right: 0;
}

.fag-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.fag-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  gap: 0.5rem;
}

.fag-fields--price {
  grid-template-columns: 1fr;
}

@media (max-width: 640px) {
  .fag-fields {
    grid-template-columns: 1fr;
  }
}

.filters-accordion .filter-group {
  margin-bottom: 0;
}

.filters-accordion .filter-label {
  font-size: 0.68rem;
  margin-bottom: 0.35rem;
}

.filters-accordion .filter-label-icon {
  width: 13px;
  height: 13px;
}

/* filter-range dentro del acordeón: el wrapper ya provee borde/padding, solo layout interno */
.filters-accordion .filter-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* Wrapper externo: replica la capa .ts-wrapper > .ts-control de TomSelect */
.filters-accordion .filter-native-wrap {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.46rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filters-accordion .filter-native-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Input interno: sin borde ni fondo propio */
.filters-accordion .filter-native-wrap input.filter-input {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  font-size: 0.875rem;
  line-height: inherit;
  color: var(--color-text);
  outline: none;
}

.filters-accordion .filter-native-wrap input.filter-input::placeholder {
  color: var(--color-text-muted);
}

/* ── Accordion responsive breakpoints ── */

/* Tablet: 2 columns — Producto | Vehículo, Precio below */
@media (max-width: 1100px) {
  .filters-accordion-body {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 0;
  }

  .fag-section:last-child {
    grid-column: 1 / -1;
    border-left: none;
    padding-left: 0;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
  }

  .fag-section:last-child .fag-fields {
    grid-template-columns: repeat(auto-fill, minmax(155px, 280px));
  }
}

/* Mobile: 1 column, all stacked */
@media (max-width: 640px) {
  .filters-accordion-body {
    grid-template-columns: 1fr;
    gap: 1rem 0;
  }

  .fag-section + .fag-section {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
  }

  .fag-section:last-child {
    grid-column: auto;
    padding-top: 1rem;
  }
}

.filters-accordion-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.875rem;
  margin-top: 0.875rem;
  border-top: 1px solid #f3f4f6;
}

/* Products list section (replaces grid layout with sidebar) */
.products-list-section {
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════
   PRODUCTS PAGE HEADER
   ═══════════════════════════════════════════════════════ */

.products-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.products-page-title-area {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.products-page-title-area h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.pph-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.pph-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 0.16rem 0.55rem;
}

.pph-clear-all {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.pph-clear-all:hover {
  color: var(--color-danger);
  border-color: #fca5a5;
  background: #fff5f5;
}

/* ═══════════════════════════════════════════════════════
   FILTERS — section labels & hint messages
   ═══════════════════════════════════════════════════════ */

.filters-section-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 0.5rem 0;
  border-top: 1px solid var(--color-border);
  margin-top: 0.75rem;
}

.filters-section-label:first-of-type {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.filter-hint {
  margin-top: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.filter-hint--ok   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.filter-hint--warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.filter-hint--error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }

/* ═══════════════════════════════════════════════════════
   GROUPED VIEW — remove blue gradients, clean treatment
   ═══════════════════════════════════════════════════════ */

/* Override the blue gradient header */
/* Fusión (split Fase 0): definición ÚNICA de .product-group-header — absorbe el layout
   (display/align-items/gap/flex-wrap) de la definición base de GROUPED RESULTS. */
.product-group-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: #f9fafb !important;
  border-bottom: 1px solid #e5e7eb !important;
  padding: 0.55rem 1rem;
  border-left: 3px solid #374151;
}

.pg-brand-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #374151 !important;
  background: #e5e7eb !important;
  border: none !important;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  flex-shrink: 0;
}

.pg-model-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827 !important;
}

.pg-years {
  font-size: 0.68rem;
  color: #6b7280 !important;
}

.pg-count {
  font-size: 0.65rem;
  color: #6b7280 !important;
  margin-left: auto;
}

/* Row hover: neutral */
.product-group-row:hover { background: #f9fafb !important; }

/* Grouped view header strip */
.grouped-results-hint {
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  color: #6b7280 !important;
}

/* ═══════════════════════════════════════════════════════
   PRODUCT CARDS — refined details
   ═══════════════════════════════════════════════════════ */

.pc-stat-price { font-variant-numeric: tabular-nums; }

.product-card {
  transition: box-shadow 0.18s ease, transform 0.15s ease;
}

.product-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

/* Aviso de patente sin configurar en el hero de productos */
.phs-patente-result--warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.phs-patente-result--warn a {
  color: inherit;
  font-weight: 700;
}

/* Tags de motor/VIN en el chip de resultado de patente */
.phs-patente-tag {
  background: #d1fae5;
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-weight: 700;
  font-size: 0.66rem;
  white-space: nowrap;
}

.phs-patente-tag--vin {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Links a catálogos OEM externos en el chip de patente */
.phs-oem-links {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
}

.phs-oem-links a {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.phs-oem-links a:hover { color: var(--color-primary-dark); }

/* ═══════════════════════════════════════════════════════
   F3.5 / F3.6 — Drenaje de estilos inline + componentes nuevos
   (chips removibles, indicador fotos listas, leyenda de dots,
   form con derivados). Solo tokens — sin hex nuevos.
   ═══════════════════════════════════════════════════════ */

/* ── Hero: inputs secundarios ─────────────────────────── */
.phs-secondary-input--plate {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.phs-secondary-input--vin {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

a.phs-secondary-btn { text-decoration: none; }

/* «Limpiar VIN»: afford secundario junto al submit (que ahora queda siempre visible) */
.phs-secondary-btn--clear {
  background: transparent;
  color: var(--color-text-muted);
}
.phs-secondary-btn--clear:hover {
  background: var(--color-bg);
  color: var(--color-danger);
}

.phs-result-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.phs-result-icon--ok { color: var(--color-success); }

.phs-detected-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--color-success);
}

.products-hero-dismiss--plain {
  opacity: 0.75;
  font-weight: 400;
  text-decoration: underline dotted;
}

/* ── Filtros: labels y estados ────────────────────────── */
.filter-label-count {
  font-weight: normal;
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.filter-label-cue {
  font-weight: normal;
  color: var(--color-warning);
  font-size: 0.7rem;
}

.filter-group--locked {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Chips removibles ─────────────────────────────────── */
.filter-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
}

.filter-chip-x:hover {
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

/* ── Vista agrupada ───────────────────────────────────── */
.pg-years-icon { opacity: 0.6; flex-shrink: 0; }
.pgr-thumb-placeholder-icon { color: var(--gray-300); }

.pgr-price-iva {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ── Cards del index ──────────────────────────────────── */
.pc-compat-icon { color: var(--gray-500); flex-shrink: 0; }
.pc-category-icon { opacity: 0.45; flex-shrink: 0; }
.pc-provs-icon { opacity: 0.5; flex-shrink: 0; }
.pc-inline-form { display: inline; }

.pc-price-breakdown {
  font-size: 0.67rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: block;
  margin-top: 0.1rem;
}

.pc-price-iva {
  color: var(--color-primary);
  font-weight: 600;
}

.pc-stat-photos {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.pc-stat-photos--ready { color: var(--color-success); font-weight: 600; }

/* ── Show: header y ficha ─────────────────────────────── */
.pshow-head-main { min-width: 0; flex: 1; }

.pshow-title {
  font-size: var(--text-xl);
  word-break: break-word;
  line-height: 1.3;
}

.pshow-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.pshow-sku-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.pshow-sep { color: var(--color-border); }

.pshow-oem-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.pshow-cat-link {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.pshow-actions { flex-shrink: 0; }
.pshow-svg-fix { flex-shrink: 0; }

.pshow-svg-caret {
  flex-shrink: 0;
  opacity: 0.7;
  margin-left: -0.1rem;
}

.pshow-btn-images {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--c-cost-strong);
  border-color: var(--c-cost-border);
}

.woo-menu-icon { flex-shrink: 0; color: var(--color-text-muted); }
.woo-menu-item--danger { color: var(--color-danger); }
.woo-menu-info--danger { color: var(--color-danger); }
.woo-dropdown-menu--narrow { min-width: 220px; }

.pshow-badge-lg {
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
}

.ps-skpi-badge-row { margin-top: 0.5rem; }
.ps-skpi-sub--spaced { margin-top: 0.5rem; }

.pshow-strong { color: var(--color-text); font-weight: 600; }
.pshow-card-flush { margin-bottom: 0; }

.pshow-detail-flex {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.pshow-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.pshow-detail-desc {
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.pshow-desc-copy { margin-top: 3px; flex-shrink: 0; }
.pshow-capitalize { text-transform: capitalize; }

.pshow-image-count {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* ── Show: compatibilidades vacías (CTA honesto) ──────── */
.pshow-compat-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pshow-compat-empty-icon { color: var(--color-border); flex-shrink: 0; }

.pshow-compat-empty-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
}

.pshow-compat-empty-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
  max-width: 60ch;
}

.pshow-compat-empty-cta { margin-left: auto; flex-shrink: 0; }

/* ── Show: tabla de tiendas ───────────────────────────── */
.pshow-section-count { font-size: 0.85rem; font-weight: 400; }

.pshow-th-hint {
  font-weight: 400;
  font-size: 0.72rem;
  opacity: 0.65;
}

.pshow-store-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pshow-store-avatar {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.pshow-store-link { font-weight: 500; }

.pshow-external-id {
  font-size: 0.78rem;
  background: var(--color-bg);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.pshow-td-muted {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.product-meta-icon { flex-shrink: 0; opacity: 0.5; }
.product-wm-actions { margin-top: 1rem; }

/* ── Sección proveedores ──────────────────────────────── */
.sp-section-header { margin-bottom: 1rem; }
.sp-section-count { font-size: 0.85rem; font-weight: 400; }

.sp-notices {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.sp-notice-icon { flex-shrink: 0; }
.sp-notice-icon--ok { color: var(--color-success); }
.sp-notice-icon--warn { color: var(--color-warning); }
.sp-notice-icon--err { color: var(--color-danger); }
.sp-notice-icon--info { color: var(--color-primary); }
.sp-notice-code { font-size: 0.78rem; }

.sp-sale-panel {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  margin-top: 0.1rem;
}

.sp-sale-eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.sp-sale-hero {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sp-sale-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.sp-sale-iva-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-primary);
}

.sp-sale-chain {
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.71rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.sp-sale-chain strong { color: var(--color-text); }

.sp-sale-iva-line {
  color: var(--color-primary);
  font-weight: 600;
}

.oem-list--wrap { flex-wrap: wrap; }
.oem-chip--more { color: var(--color-text-muted); }

/* ── Dots de estado de watermark por thumbnail ────────── */
.sp-thumb-wrap {
  position: relative;
  display: inline-block;
}

.sp-thumb-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-400);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow);
}

.sp-thumb-dot--published    { background: var(--state-green); }
.sp-thumb-dot--review       { background: var(--state-violet); }
.sp-thumb-dot--awaiting     { background: var(--c-cost-strong); }
.sp-thumb-dot--cleaning     { background: var(--state-blue); }
.sp-thumb-dot--queued       { background: var(--state-gray); }
.sp-thumb-dot--manual       { background: var(--state-rose); }
.sp-thumb-dot--failed       { background: var(--state-red); }
.sp-thumb-dot--reverted     { background: var(--state-sky); }
.sp-thumb-dot--wm-bg        { background: var(--state-amber); }
.sp-thumb-dot--wm-product   { background: var(--state-orange); }
.sp-thumb-dot--unclassified { background: var(--gray-400); }

/* Variante para la leyenda (en línea, sin posicionamiento) */
.sp-thumb-dot--legend {
  position: static;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-width: 1px;
  box-shadow: none;
  vertical-align: middle;
}

.sp-wm-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.sp-wm-summary-item--published { color: var(--state-green); }
.sp-wm-summary-item--review { color: var(--state-violet); font-weight: 600; }
.sp-wm-summary-item--awaiting { color: var(--c-cost-strong); }
.sp-wm-summary-item--failed { color: var(--state-red); }

.sp-wm-summary-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.sp-dot-legend {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--color-border);
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.sp-dot-legend-title { font-weight: 600; }

.sp-dot-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.sp-empty-icon { color: var(--color-border); }

/* ── Refresh button (estados del broadcast) ───────────── */
.refresh-btn-loading { opacity: 0.75; cursor: default; }
.refresh-caret { pointer-events: none; }

/* ── Galería de imágenes (header) ─────────────────────── */
.pimg-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Compatibilidades: pills y specs ──────────────────── */
.compat-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.compat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.6rem;
}

.compat-pill-icon { opacity: 0.6; }

.compat-model-spec {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 1px;
}

.compat-model-all {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.78rem;
}

/* ── Form: campos derivados ───────────────────────────── */
.pform-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.pform-derived {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--gray-50);
}

.pform-derived-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
  font-size: 0.74rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.pform-derived-hint svg { flex-shrink: 0; margin-top: 1px; }
