/* Catalogue filters, Figma "Spare parts" sidebar (see catalog-filters-ux.js). */
.tf-catalog-listing-block .tf-catalog__filters,
.tf-catalog .tf-catalog__filters {
  gap: 0;
  font-family: Inter, Arial, sans-serif;
}

.tf-fx-block {
  padding: 0 0 20px;
  margin: 0 0 20px;
  border-bottom: 1px solid #d9d9d9;
}

.tf-fx-block label,
.tf-fx-price__title {
  display: block;
  margin: 0 0 8px;
  font: 700 15px/1.3 Inter, Arial, sans-serif;
  color: #111;
}

/* Search: compact field with a magnifier. */
.tf-fx-search input[type="search"] {
  min-height: 40px;
  padding: 8px 10px 8px 34px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font-size: 14px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 10px 50%;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.tf-fx-block input:focus-visible,
.tf-fx-block select:focus-visible {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .12);
}

/* Price: title + current range, one dual-thumb track, Min/Max fields. */
.tf-fx-price__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.tf-fx-price__value {
  font: 700 13px/1.3 Inter, Arial, sans-serif;
  color: #555;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tf-catalog .tf-fx-price fieldset.tf-fx-track {
  position: relative;
  height: 28px;
  margin: 6px 0 12px;
  padding: 0;
  border: 0;
}

.tf-fx-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: #d6d6d6;
  transform: translateY(-50%);
}

.tf-fx-track__fill {
  position: absolute;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: #111;
  transform: translateY(-50%);
  pointer-events: none;
}

.tf-catalog .tf-fx-track > input[type="range"] {
  position: absolute;
  top: 0;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  accent-color: #111;
}

.tf-fx-track > input[type="range"]::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.tf-fx-track > input[type="range"]::-moz-range-track { height: 28px; background: transparent; }

.tf-fx-track > input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  margin-top: 6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 0 0 1px #111, 0 1px 3px rgba(0, 0, 0, .25);
  cursor: grab;
  transition: transform .15s ease;
}

.tf-fx-track > input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 0 0 1px #111;
  cursor: grab;
}

.tf-fx-track > input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); cursor: grabbing; }
.tf-fx-track > input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 0 0 1px #111; }
.tf-fx-track > input[type="range"]:focus-visible { outline: none; }

.tf-fx-price__inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
}

.tf-fx-price__dash { padding-top: 7px; color: #777; }

.tf-catalog .tf-fx-price__field input[type="text"] {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tf-fx-price__field label {
  margin: 4px 0 0;
  font: 400 12px/1.2 Inter, Arial, sans-serif;
  color: #888;
}

/* Sort: two compact selects side by side. */
.tf-fx-sort {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tf-fx-sort label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #555;
}

.tf-catalog .tf-fx-sort select {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font-size: 14px;
}

/* Accordion groups: bold title, chevron, rule; compact uppercase options. */
.tf-catalog .tf-catalog__group > summary {
  padding: 10px 0;
  border-bottom: 1px solid #d9d9d9;
  font: 700 15px/1.3 Inter, Arial, sans-serif;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.tf-catalog .tf-catalog__group fieldset label {
  min-height: 28px;
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s ease;
}

.tf-catalog .tf-catalog__group fieldset label:hover { color: #000; }
.tf-catalog .tf-catalog__group fieldset label span { color: #888; }
.tf-catalog .tf-catalog__group input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #111; cursor: pointer; }

.tf-catalog .tf-catalog__reset {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: #9b0000;
}

/* Active filter chips above the grid. */
.tf-fx-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.tf-fx-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px 4px 12px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: 500 13px/1.2 Inter, Arial, sans-serif;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
  animation: tf-fx-in .2s ease both;
}

.tf-fx-chip:hover,
.tf-fx-chip:focus-visible { background: #111; color: #fff; outline: none; }
.tf-fx-chip__x { font-size: 16px; line-height: 1; }

.tf-fx-chips__reset {
  margin-left: 4px;
  font-size: 13px;
  color: #9b0000;
}

/* Loading: keep the grid visible but quiet, with a thin progress bar. */
.tf-catalog__results { position: relative; }
.tf-catalog__results .tf-product-grid { transition: opacity .2s ease; }
.tf-catalog__results[aria-busy="true"] .tf-product-grid { opacity: .45; }
.tf-catalog__results[aria-busy="true"]::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  height: 2px;
  width: 40%;
  background: #9b0000;
  animation: tf-fx-progress 1s ease-in-out infinite;
  z-index: 3;
}

/* New results fade in instead of popping. */
.tf-catalog__results .tf-product-card { animation: tf-fx-in .3s ease both; }

@keyframes tf-fx-progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

@keyframes tf-fx-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tf-fx-chip,
  .tf-catalog__results .tf-product-card { animation: none; }
  .tf-catalog__results[aria-busy="true"]::before { animation: none; width: 100%; }
  .tf-catalog__results .tf-product-grid,
  .tf-fx-track > input[type="range"]::-webkit-slider-thumb { transition: none; }
}

/* Help line as a quiet caption, only when there is no track to explain itself. */
.tf-fx-price small { display: block; margin-top: 6px; font-size: 12px; line-height: 1.4; color: #888; }
.tf-fx-price:has(> fieldset.tf-fx-track:not([hidden])) > small { display: none; }
/* Counts stay glued to their option. */
.tf-catalog .tf-catalog__group fieldset label span { white-space: nowrap; }
/* The track's own legend/labels duplicate the Min/Max fields: screen readers only. */
.tf-fx-track > legend,
.tf-fx-track > label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
