/**
 * Shared structural styles for all filter presets.
 * No preset-specific colors, borders, or typography here.
 */

/* fbt theme floats all h1 — archive header collapses and content overlaps the title. */
.bsftfilt-filter-hub .woocommerce-products-header,
.bsftfilt-landing-page .woocommerce-products-header {
  display: flow-root;
  width: 100%;
  margin: 0 0 20px;
  clear: both;
}

.bsftfilt-filter-hub .woocommerce-products-header__title,
.bsftfilt-landing-page .woocommerce-products-header__title {
  float: none;
  width: auto;
  margin: 0;
}

.bsftfilt-filter-hub #main.site-main,
.bsftfilt-filter-hub #primary.content-area,
.bsftfilt-landing-page #main.site-main,
.bsftfilt-landing-page #primary.content-area {
  display: flow-root;
  width: 100%;
  min-width: 0;
}

.bsftfilt__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bsftfilt-field__label {
  font-weight: 600;
  margin-bottom: 8px;
}

.bsftfilt-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bsftfilt-options--scroll {
  max-height: var(--bsftfilt-options-max-height, 220px);
  overflow-y: auto;
  box-sizing: border-box;
}

.bsftfilt-options--scroll .bsftfilt-option {
  padding: 2px 0;
}

.bsftfilt-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.bsftfilt-option__count {
  margin-left: auto;
  font-size: 12px;
}

.bsftfilt-select,
.bsftfilt-select-multi__trigger,
.bsftfilt-text,
.bsftfilt-range__input {
  width: 100%;
  box-sizing: border-box;
  color: #0f172a;
}

.bsftfilt-select-multi {
  position: relative;
  width: 100%;
}

.bsftfilt-select-multi__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.bsftfilt-select-multi__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsftfilt-select-multi__caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.15s ease;
}

.bsftfilt-select-multi.is-open .bsftfilt-select-multi__caret {
  transform: rotate(180deg);
}

.bsftfilt-select-multi__panel {
  position: absolute;
  z-index: 101;
  top: calc(100% + 4px);
  left: 0;
  right: auto;
  min-width: 100%;
  width: max-content;
  max-width: min(480px, calc(100vw - 24px));
  box-sizing: border-box;
}

.bsftfilt-select-multi__panel-body {
  min-width: 100%;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
}

.bsftfilt-select-multi__panel .bsftfilt-options--scroll {
  max-height: var(--bsftfilt-options-max-height, 240px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border: 0;
  padding: 0;
  box-sizing: border-box;
}

.bsftfilt-select-multi__panel .bsftfilt-option {
  white-space: nowrap;
  padding-right: 2px;
  box-sizing: border-box;
}

.bsftfilt-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.bsftfilt-range--slider {
  display: block;
  grid-template-columns: none;
}

.bsftfilt-range-slider {
  position: relative;
  height: 32px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
}

.bsftfilt-range-slider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
  pointer-events: none;
}

.bsftfilt-range-slider__input {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  pointer-events: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  height: 32px;
  z-index: 1;
}

.bsftfilt-range-slider__input::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border: none;
  border-radius: 999px;
}

.bsftfilt-range-slider__input::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
  cursor: pointer;
}

.bsftfilt-range-slider__input::-moz-range-track {
  height: 6px;
  background: transparent;
  border: none;
  border-radius: 999px;
}

.bsftfilt-range-slider__input::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
  cursor: pointer;
}

.bsftfilt-range-slider__values {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.bsftfilt-range-slider__input--max {
  z-index: 2;
}

.bsftfilt-range--single-value .bsftfilt-range-slider__input::-webkit-slider-thumb,
.bsftfilt-range--single-value .bsftfilt-range-slider__input::-moz-range-thumb {
  pointer-events: none;
  cursor: default;
}

.bsftfilt-range--single-value .bsftfilt-range-slider__number[readonly] {
  cursor: default;
  opacity: 1;
}

.bsftfilt__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
}

.bsftfilt__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.bsftfilt__btn--apply {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.bsftfilt__btn--reset {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.bsftfilt__apply-icon {
  display: inline-flex;
}

.bsftfilt__reset-icon {
  display: inline-flex;
}

.bsftfilt__apply-icon .dashicons,
.bsftfilt__apply-icon svg,
.bsftfilt__reset-icon .dashicons,
.bsftfilt__reset-icon svg {
  max-width: 100%;
  max-height: 100%;
}

.bsftfilt-option--disabled,
.bsftfilt-chip--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bsftfilt-option--disabled input,
.bsftfilt-chip--disabled input {
  pointer-events: none;
}

.bsftfilt.bsftfilt-loading,
.bsftfilt.is-loading {
  opacity: 1;
  pointer-events: auto;
}

.bsftfilt-loading:not(.bsftfilt) {
  opacity: 0.55;
  pointer-events: none;
}

.bsftfilt-loading .bsftfilt-field__control > .bsftfilt-options,
.bsftfilt-loading .bsftfilt-field__control > .bsftfilt-select,
.bsftfilt-loading .bsftfilt-field__control > .bsftfilt-chips,
.bsftfilt-loading .bsftfilt-field__control > .bsftfilt-text,
.bsftfilt-loading .bsftfilt-field__control > .bsftfilt-range,
.bsftfilt-loading .bsftfilt-select-multi__trigger {
  opacity: 0.55;
  pointer-events: none;
}

.bsftfilt-loading .bsftfilt-select-multi__panel {
  opacity: 1;
  pointer-events: auto;
}

.bsftfilt-loading .bsftfilt-select-multi__panel .bsftfilt-options {
  opacity: 0.55;
  pointer-events: none;
}

.bsftfilt-loading .bsftfilt__actions {
  opacity: 0.55;
  pointer-events: none;
}

.bsftfilt-empty {
  list-style: none;
  padding: 24px;
  text-align: center;
}

.bsftfilt__status {
  margin-top: 8px;
  font-size: 12px;
  min-height: 1.2em;
}

.bsftfilt__status--error {
  color: #dc2626;
}

.bsftfilt-landing-links {
  display: block;
  width: 100%;
  margin: 0 0 16px;
}

.bsftfilt-landing-links__title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.bsftfilt-landing-links__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bsftfilt-landing-links__item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bsftfilt-landing-links__item:hover,
.bsftfilt-landing-links__item:focus-visible {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.bsftfilt-landing-links__item.is-current {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
