/* RSG catalog (/products) and product detail (/product/:slug).
   Same system as the homepage: compact dark header band, white product tiles
   on pale grey, pill controls. Product photos are small white-background
   catalog shots, so tiles keep them modest and contained (never cover). */

/* ------------------------------------------------------ catalog header */

.catalog-hero {
  position: relative;
  padding: clamp(24px, 4.5vh, 52px) max(var(--gutter), calc((100% - var(--measure-wide)) / 2)) clamp(72px, 10vh, 104px);
  background: var(--hero-mist);
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.catalog-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -8%;
  top: -60%;
  width: min(820px, 65vw);
  height: 200%;
  background: radial-gradient(45% 45% at 60% 50%, rgba(10, 99, 196, 0.1), transparent 70%);
  filter: blur(20px);
}

.catalog-hero .eyebrow {
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--brand);
}

.catalog-hero h1 {
  font-size: clamp(1.875rem, min(3.2vw, 5.4vh), 3.25rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}

.catalog-hero p:not(.eyebrow) {
  margin-top: var(--space-3);
  max-width: 62ch;
  color: var(--ink-muted);
}

/* The search card overlaps the header band, so it is visible in the first
   screen together with the first row of products. */
.catalog-browser {
  position: relative;
  width: min(100% - (var(--gutter) * 2), var(--measure-wide));
  margin: clamp(-64px, -8vh, -48px) auto 0;
  padding-bottom: var(--section-y);
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--hairline-soft);
  transition: box-shadow var(--dur-base) var(--ease-out);
}

.catalog-search:focus-within {
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--brand-ring), 0 0 0 4px var(--brand-tint);
}

.catalog-search > span[aria-hidden] {
  padding-inline-start: var(--space-4);
  font-size: 17px;
  color: var(--ink-faint);
}

.catalog-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  font-size: var(--text-base);
}

.catalog-search input:focus {
  outline: none;
}

.catalog-search button {
  height: 48px;
  padding-inline: var(--space-6);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease-soft);
}

.catalog-search button:hover {
  background: var(--brand-hover);
}

.search-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-5);
  padding-inline: var(--space-4);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.search-examples button {
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  transition: background var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
}

.search-examples button:hover {
  background: var(--brand-tint);
  color: var(--brand);
}

/* --------------------------------------------------------- layout */

.catalog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-6);
}

.catalog-filter-panel {
  position: sticky;
  inset-block-start: calc(var(--topbar-h) + var(--space-4));
  min-width: 0;
}

.catalog-filter-panel > summary {
  display: none;
}

.catalog-controls {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.catalog-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.catalog-filter-heading button {
  border: 0;
  background: none;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand);
}

.catalog-filter-fields {
  display: grid;
  gap: var(--space-4);
}

.catalog-filter-field > span {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
}

.catalog-filter-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
  font-size: var(--text-sm);
}

.catalog-filter-field select:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 4px var(--brand-tint);
}

.catalog-filter-support {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.catalog-filter-support strong {
  font-size: var(--text-sm);
  color: var(--ink);
}

.catalog-filter-support a {
  font-weight: 600;
  color: var(--brand);
}

.catalog-filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-inline-start: var(--space-2);
  padding-inline: 6px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* --------------------------------------------------------- results */

.catalog-results {
  min-width: 0;
}

.catalog-results-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.catalog-results-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
}

.catalog-results-summary strong {
  font-size: var(--text-lg);
  font-weight: 650;
  letter-spacing: -0.015em;
}

.catalog-results-summary span {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.catalog-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.catalog-active-filters button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: 600;
}

.catalog-check-note {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.catalog-check-note strong {
  color: var(--ink);
}

/* --------------------------------------------------------- product tiles */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--hairline-soft);
}

.product-img {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  margin: var(--space-2) var(--space-2) 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.product-img img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  transition: transform var(--dur-slow) var(--ease-out);
}

.product-card:hover .product-img img {
  transform: scale(1.05);
}

.product-info {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--hairline-soft);
}

.product-info h3 {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 650;
  letter-spacing: 0.02em;
}

.product-info h3 a:hover {
  color: var(--brand);
}

.product-family,
.product-meta {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.product-card-specs {
  display: grid;
  gap: 2px;
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
}

.product-card-specs > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
}

.product-card-specs dt {
  color: var(--ink-faint);
}

.product-card-specs dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.card-actions .details {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
}

.card-actions .details:hover {
  color: var(--brand);
}

.card-actions .add {
  padding: 6px var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft),
    transform var(--dur-fast) var(--ease-out);
}

.card-actions .add:hover {
  background: var(--brand);
  color: #fff;
}

.card-actions .add:active {
  transform: scale(0.95);
}

.card-actions .add.added {
  background: var(--ink);
  color: #fff;
}

/* Placeholder drawn when a product has no photograph yet. */
.product-shape {
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid var(--hairline);
}

.product-shape.valve {
  width: 28%;
  aspect-ratio: 3 / 5;
  border-radius: var(--radius-sm);
}

/* Loading / empty */

.catalog-skeletons {
  display: contents;
}

.catalog-skeleton {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
}

.catalog-skeleton span,
.catalog-skeleton i {
  display: block;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface-sunken) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: rsg-shimmer 1.4s linear infinite;
}

.catalog-skeleton span {
  aspect-ratio: 1 / 1;
}

.catalog-skeleton i {
  height: 10px;
  margin-inline: var(--space-2);
}

.catalog-skeleton i:nth-child(3) {
  width: 55%;
}

@keyframes rsg-shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-skeleton span,
  .catalog-skeleton i {
    animation: none;
  }
}

.empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.empty h3 {
  font-size: var(--text-xl);
}

.empty p {
  color: var(--ink-muted);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.empty-actions > button {
  min-height: 46px;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Pagination */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-7) 0 0;
}

.pagination button {
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease-soft);
}

.pagination button:hover:not([disabled]) {
  background: var(--surface-sunken);
}

.pagination button.active {
  background: var(--ink);
  color: #fff;
}

.pagination button[disabled] {
  opacity: 0.35;
}

.pagination-gap {
  color: var(--ink-faint);
}

/* Floating inquiry bar — a compact dark pill pinned to the bottom. */

.catalog-inquiry-bar {
  position: sticky;
  inset-block-end: var(--space-4);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: min(100%, 760px);
  margin: var(--space-7) auto 0;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  background: rgba(16, 16, 18, 0.88);
  color: var(--on-dark);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-base) var(--ease-spring);
}

.catalog-inquiry-bar > div:first-child {
  display: grid;
  min-width: 0;
}

.catalog-inquiry-bar b {
  font-size: var(--text-sm);
  font-weight: 650;
}

.catalog-inquiry-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--on-dark-faint);
}

#basket-items:empty {
  display: none;
}

.catalog-inquiry-bar.has-items {
  animation: rsg-bar-pop var(--dur-slow) var(--ease-spring);
}

@keyframes rsg-bar-pop {
  40% {
    transform: scale(1.02);
  }
}

.basket-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
}

.basket-bar-actions button {
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--on-dark-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.basket-bar-actions button:hover {
  color: #fff;
}

.basket-bar-actions .btn {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
}

.basket-bar-actions .btn:hover {
  --btn-bg: #e8e8ed;
}

/* ------------------------------------------------------ product detail */

.product-page-main {
  width: min(100% - (var(--gutter) * 2), var(--measure-wide));
  margin: 0 auto;
  padding-block: var(--space-5) var(--section-y);
}

#product-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
}

#product-back:hover {
  color: var(--brand);
}

.loading {
  padding: var(--space-8) 0;
  color: var(--ink-faint);
}

/* The gallery is sticky and height-bounded so the photo and the key
   actions share the first screen on a 16:9 display. */
.product-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 4vw, 64px);
}

.product-gallery {
  position: sticky;
  inset-block-start: calc(var(--topbar-h) + var(--space-4));
  display: grid;
  gap: var(--space-3);
}

.gallery-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(320px, 62vh, 640px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
  overflow: hidden;
}

.gallery-stage img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: opacity var(--dur-base) var(--ease-soft);
}

.gallery-stage.is-loading img {
  opacity: 0.35;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--hairline-soft);
  font-size: 16px;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-soft), background var(--dur-fast) var(--ease-soft);
}

.gallery-arrow.previous {
  left: var(--space-4);
}

.gallery-arrow.next {
  right: var(--space-4);
}

.gallery-stage:hover .gallery-arrow,
.gallery-arrow:focus-visible {
  opacity: 1;
}

.gallery-arrow:hover {
  background: #fff;
}

@media (hover: none) {
  .gallery-arrow {
    opacity: 1;
  }
}

.gallery-count {
  position: absolute;
  inset-block-end: var(--space-4);
  inset-inline-start: 50%;
  padding: 4px var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  transform: translateX(-50%);
}

.gallery-thumbnails {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-thumbnail {
  flex: 0 0 64px;
  height: 64px;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
  transition: box-shadow var(--dur-fast) var(--ease-soft);
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumbnail.active {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.gallery-empty {
  background: var(--surface-muted);
}

/* Info column */

.product-page-info {
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-2);
}

.page-kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--brand);
}

.product-page-info h1 {
  font-size: clamp(1.75rem, min(2.8vw, 4.8vh), 2.75rem);
  font-weight: 680;
  letter-spacing: -0.028em;
  line-height: 1.1;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sku {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 650;
  letter-spacing: 0.04em;
}

.copy-value {
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
  transition: background var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
}

.copy-value:hover {
  background: var(--brand-tint);
  color: var(--brand);
  box-shadow: none;
}

#product-description {
  color: var(--ink-muted);
}

.spec-table {
  display: grid;
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  overflow: hidden;
}

.spec-table > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}

.spec-table > div + div {
  border-top: 1px solid var(--hairline-soft);
}

.spec-table dt {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-faint);
}

.spec-table dd {
  margin: 0;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.spec-table dd .copy-value {
  margin-top: var(--space-2);
}

.spec-value-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.spec-value-list span {
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: var(--text-xs);
}

.spec-more {
  margin-top: var(--space-2);
}

.spec-more summary {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}

.spec-more[open] summary {
  margin-bottom: var(--space-2);
}

.catalog-verification {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.catalog-verification:empty {
  display: none;
}

.product-quantity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}

.product-quantity input {
  width: 120px;
  min-height: 46px;
  padding: 0 var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
}

.product-quantity input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.product-actions .btn {
  min-height: 50px;
  padding-inline: var(--space-6);
}

#product-add.added {
  --btn-bg: var(--ink);
}

/* Related products */

.related-products {
  margin-top: var(--section-y);
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.related-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.related-heading h2 {
  font-size: var(--text-2xl);
  font-weight: 670;
  letter-spacing: -0.025em;
}

.related-heading a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

.related-products .product-card {
  box-shadow: none;
}

/* --------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .catalog-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .catalog-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .catalog-filter-panel {
    position: static;
  }
  .catalog-filter-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--surface-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    list-style: none;
    cursor: pointer;
  }
  .catalog-filter-panel > summary::-webkit-details-marker {
    display: none;
  }
  .catalog-filter-panel > summary::after {
    content: "+";
    font-size: 18px;
  }
  .catalog-filter-panel[open] > summary::after {
    content: "−";
  }
  .catalog-filter-panel[open] > summary {
    margin-bottom: var(--space-3);
  }
  .product-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .product-gallery {
    position: static;
  }
  .gallery-stage {
    height: min(80vw, 520px);
  }
}

@media (max-width: 620px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .catalog-search {
    flex-wrap: wrap;
    border-radius: var(--radius-lg);
  }
  .catalog-search button {
    width: 100%;
  }
  .catalog-inquiry-bar {
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  }
  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .card-actions .add {
    text-align: center;
  }
  .spec-table > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .related-heading {
    flex-direction: column;
  }
}

/* Flying thumbnail used by motion.js when a part is added to the inquiry. */
.rsg-fly {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-md);
}

/* ------------------------------------------------ application brand picker */

.brand-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: 42px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
  font-size: var(--text-sm);
  text-align: left;
  transition: box-shadow var(--dur-fast) var(--ease-soft);
}

.brand-picker-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-picker-trigger i {
  font-style: normal;
  color: var(--ink-faint);
}

.brand-picker-trigger:hover {
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.brand-picker-trigger.has-value {
  box-shadow: inset 0 0 0 1.5px var(--brand);
  color: var(--brand);
  font-weight: 600;
}

.brand-picker {
  width: min(560px, calc(100vw - 2 * var(--space-4)));
  max-height: min(78vh, 720px);
  overflow: hidden;
}

.brand-picker[open] {
  display: flex;
  flex-direction: column;
}

.brand-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-6) var(--space-3);
}

.brand-picker-head .eyebrow {
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--brand);
}

.brand-picker-head h2 {
  font-size: var(--text-xl);
  font-weight: 660;
}

.brand-picker-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  font-size: 18px;
  line-height: 1;
}

.brand-picker-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 var(--space-6);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
}

.brand-picker-search:focus-within {
  box-shadow: 0 0 0 4px var(--brand-tint), inset 0 0 0 1px var(--brand);
}

.brand-picker-search > span[aria-hidden] {
  color: var(--ink-faint);
}

.brand-picker-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
}

.brand-picker-search input:focus {
  outline: none;
}

.brand-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6) 0;
}

.brand-picker-chips button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  animation: rsg-chip-in var(--dur-base) var(--ease-spring);
}

@keyframes rsg-chip-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
}

.brand-picker-list {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 2px var(--space-2);
  min-height: 180px;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-6) var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand-picker-letter {
  grid-column: 1 / -1;
  margin-top: var(--space-3);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
}

.brand-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-2);
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft);
}

.brand-option:hover {
  background: var(--surface-muted);
}

.brand-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.brand-option span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-option small {
  font-size: 11px;
  color: var(--ink-faint);
}

.brand-option:has(input:checked) {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 600;
}

.brand-picker-empty {
  grid-column: 1 / -1;
  padding: var(--space-6) 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.brand-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--hairline-soft);
  background: var(--surface);
}

.brand-picker-reset {
  border: 0;
  background: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
}

.brand-picker-reset:hover {
  color: var(--ink);
}

@media (max-width: 620px) {
  .brand-picker-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand-picker {
    position: fixed;
    inset: auto 0 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 86vh;
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* ---------------------------------------------- refine panel refinements */

.catalog-controls {
  gap: var(--space-4);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
}

.catalog-filter-heading {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--hairline-soft);
}

.catalog-filter-heading strong {
  font-size: var(--text-sm);
  font-weight: 650;
}

.catalog-filter-heading button[disabled] {
  opacity: 0.35;
  cursor: default;
}

.catalog-filter-field select,
.brand-picker-trigger {
  background-color: var(--surface-muted);
  box-shadow: none;
}

.catalog-filter-field select:hover,
.brand-picker-trigger:hover {
  background-color: var(--surface-sunken);
  box-shadow: none;
}

.brand-picker-trigger.has-value {
  background-color: var(--brand-tint);
  box-shadow: none;
}

.catalog-filter-support {
  margin: 0 calc(var(--space-5) * -1) calc(var(--space-5) * -1);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface-muted);
}

/* Sort lives in the results toolbar as a compact pill, not in the filter
   stack: it orders results rather than narrowing them. */
.catalog-sort {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.catalog-sort select {
  min-height: 34px;
  padding: 0 var(--space-6) 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink);
}

.catalog-results-toolbar {
  align-items: center;
  gap: var(--space-4);
}

@media (max-width: 620px) {
  .catalog-results-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ----------------------------------------------------- selectable OE list */
/* Deliberately quiet: chips look like plain tokens until selected, and the
   tools are small text links, not buttons. */

.oe-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--space-3);
  margin-bottom: var(--space-2);
  font-size: 11px;
}

.oe-hint {
  margin-inline-end: auto;
  color: var(--ink-faint);
}

.oe-tool {
  padding: 2px 0;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft);
}

.oe-tool:hover:not([disabled]) {
  color: var(--brand);
}

.oe-tool--primary:not([disabled]) {
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
}

.oe-tool--primary:not([disabled]):hover {
  background: var(--brand-hover);
  color: #fff;
}

.oe-tool[disabled] {
  color: var(--hairline);
  cursor: default;
}

.oe-chips {
  gap: 4px;
}

.oe-chip {
  padding: 2px var(--space-2);
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  cursor: pointer;
  user-select: text;
  transition: background var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft),
    box-shadow var(--dur-fast) var(--ease-soft);
}

.oe-chip:hover {
  box-shadow: inset 0 0 0 1px var(--brand-ring);
}

.oe-chip[aria-pressed="true"] {
  background: var(--brand-tint);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.spec-table .oe-chips + .spec-more {
  margin-top: var(--space-2);
}
