.sbf {
  --sbf-accent: #b5985a;
  --sbf-border: #e6e6e6;
  --sbf-text: #2b2b2b;
  --sbf-soft: #5f5f5f;
  --sbf-muted: #767676;
  --sbf-hover: #f7f5f0;
  --sbf-thumb: 18px;
  margin-bottom: 2rem;
  color: var(--sbf-text);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.sbf [hidden] {
  display: none !important;
}

.sbf-section {
  margin-bottom: 2.25rem;
}

/* ---- Filters moved above the product list (small screens, set by the script) ---- */

.sbf.sbf-moved {
  grid-column: 1 / -1;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  margin-bottom: 1.25rem;
  box-sizing: border-box;
}

.sbf.sbf-moved .sbf-section:last-child {
  margin-bottom: 0;
}

/* ---- Filters button (small screens only) ---- */

.sbf-mobile-toggle {
  display: none;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 46px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--sbf-border);
  border-radius: 4px;
  background: #fff;
  color: var(--sbf-text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.sbf-mobile-toggle[aria-expanded="true"] {
  border-color: var(--sbf-accent);
}

.sbf-mobile-icon {
  flex: 0 0 auto;
  color: var(--sbf-accent);
}

.sbf-mobile-info {
  padding: 0.0625rem 0.5rem;
  border-radius: 999px;
  background: var(--sbf-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.sbf-mobile-arrow {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: -4px 4px 0 auto;
  border-right: 2px solid var(--sbf-muted);
  border-bottom: 2px solid var(--sbf-muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.sbf-mobile-toggle[aria-expanded="true"] .sbf-mobile-arrow {
  margin-top: 4px;
  transform: rotate(-135deg);
}

@media (max-width: 575.98px) {
  .sbf-bp-576 .sbf-mobile-toggle {
    display: flex;
  }

  .sbf-bp-576:not(.sbf-mobile-open) .sbf-panel {
    display: none;
  }

  .sbf-bp-576 .sbf-panel {
    padding-top: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .sbf-bp-768 .sbf-mobile-toggle {
    display: flex;
  }

  .sbf-bp-768:not(.sbf-mobile-open) .sbf-panel {
    display: none;
  }

  .sbf-bp-768 .sbf-panel {
    padding-top: 1.5rem;
  }
}

@media (max-width: 991.98px) {
  .sbf-bp-992 .sbf-mobile-toggle {
    display: flex;
  }

  .sbf-bp-992:not(.sbf-mobile-open) .sbf-panel {
    display: none;
  }

  .sbf-bp-992 .sbf-panel {
    padding-top: 1.5rem;
  }
}

.sbf-title {
  position: relative;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sbf-border);
  color: var(--sbf-text);
  font-size: 1.125rem;
  font-weight: 700;
}

.sbf-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 60px;
  height: 2px;
  background: var(--sbf-accent);
}

/* ---- Price slider ---- */

.sbf-range {
  --sbf-from: 0%;
  --sbf-to: 100%;
  position: relative;
  height: 28px;
  margin-bottom: 0.75rem;
}

.sbf-range-track {
  position: absolute;
  top: 50%;
  left: calc(var(--sbf-thumb) / 2);
  right: calc(var(--sbf-thumb) / 2);
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--sbf-border) var(--sbf-from),
    var(--sbf-accent) var(--sbf-from),
    var(--sbf-accent) var(--sbf-to),
    var(--sbf-border) var(--sbf-to)
  );
}

.sbf-range-input {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.sbf-range-input:focus {
  outline: none;
}

.sbf-range-input::-webkit-slider-runnable-track {
  height: 28px;
  background: none;
  border: 0;
}

.sbf-range-input::-moz-range-track {
  height: 28px;
  background: none;
  border: 0;
}

.sbf-range-input::-webkit-slider-thumb {
  width: var(--sbf-thumb);
  height: var(--sbf-thumb);
  margin-top: 5px;
  border: 2px solid var(--sbf-accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
}

.sbf-range-input::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--sbf-thumb);
  height: var(--sbf-thumb);
  border: 2px solid var(--sbf-accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
}

.sbf-range-input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.12);
}

.sbf-range-input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.12);
}

.sbf-fields {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.sbf-field {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0 0.625rem;
  border: 1px solid var(--sbf-border);
  border-radius: 4px;
  background: #fff;
}

.sbf-field:focus-within {
  border-color: var(--sbf-accent);
}

.sbf-field input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sbf-text);
  font-size: 0.9375rem;
  -moz-appearance: textfield;
  appearance: textfield;
}

.sbf-field input:focus {
  outline: none;
}

.sbf-field input::-webkit-outer-spin-button,
.sbf-field input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.sbf-sign,
.sbf-dash {
  color: var(--sbf-muted);
}

.sbf-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sbf-apply {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--sbf-accent);
  border-radius: 4px;
  background: var(--sbf-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.sbf-apply:hover,
.sbf-apply:focus {
  background: #fff;
  color: var(--sbf-accent);
}

.sbf-reset:not(#sbf-x) {
  color: var(--sbf-muted);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: underline;
}

.sbf-reset:not(#sbf-x):hover {
  color: var(--sbf-text);
}

/* ---- Brand filter ----
   ":not(#sbf-x)": see the category tree below. Keeps theme list and label rules off the brand list. */

.sbf-checks:not(#sbf-x) {
  max-height: 290px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-y: auto;
  list-style: none;
}

.sbf-check-item:not(#sbf-x) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.sbf-check-item:not(#sbf-x)::before,
.sbf-check-item:not(#sbf-x)::after {
  content: none;
}

.sbf-check:not(#sbf-x) {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  padding: 0.4375rem 0.625rem;
  border-radius: 4px;
  color: var(--sbf-text);
  font-weight: 400;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: background-color 0.15s;
}

.sbf-check:hover {
  background: var(--sbf-hover);
}

.sbf-check input:not(#sbf-x) {
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  opacity: 0;
}

.sbf-check-box {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  background: #fff;
  transition: background-color 0.15s, border-color 0.15s;
}

.sbf-check input:checked + .sbf-check-box {
  border-color: var(--sbf-accent);
  background: var(--sbf-accent);
}

.sbf-check input:checked + .sbf-check-box::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 5px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.sbf-check input:focus-visible + .sbf-check-box {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

.sbf-check-name {
  flex: 1 1 auto;
  min-width: 0;
}

.sbf-check input:checked ~ .sbf-check-name {
  font-weight: 600;
}

.sbf-brands .sbf-reset {
  display: inline-block;
  margin-top: 0.75rem;
}

/* ---- Search boxes ---- */

.sbf-search {
  width: 100%;
  height: 38px;
  margin-bottom: 0.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--sbf-border);
  border-radius: 4px;
  background: #fff;
  color: var(--sbf-text);
  font-size: 0.875rem;
}

.sbf-search:focus {
  border-color: var(--sbf-accent);
  outline: none;
}

/* ---- Category tree: a light text list, no backgrounds, no bold ----
   ":not(#sbf-x)" gives a rule the weight of an id. The id does not exist: it only makes these rules
   win over theme rules such as "#left-column a { text-transform: uppercase; font-weight: 700; }". */

.sbf-categories .sbf-search {
  height: 32px;
  margin-bottom: 0.5rem;
  padding: 0 0.125rem;
  border: 0;
  border-bottom: 1px solid var(--sbf-border);
  border-radius: 0;
  background: transparent;
  font-size: 0.8125rem;
}

.sbf-list:not(#sbf-x) {
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}

.sbf-list .sbf-list:not(#sbf-x) {
  margin: 0 0 0.125rem 0.875rem;
}

.sbf-item:not(#sbf-x) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.sbf-item:not(#sbf-x)::before,
.sbf-item:not(#sbf-x)::after {
  content: none;
}

.sbf-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 30px;
}

.sbf-link:not(#sbf-x) {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.25rem 0;
  color: var(--sbf-soft);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
}

.sbf-level-0 > .sbf-item > .sbf-row > .sbf-link:not(#sbf-x) {
  color: var(--sbf-text);
}

.sbf-link:not(#sbf-x):hover,
.sbf-link:not(#sbf-x):focus {
  color: var(--sbf-accent);
  text-decoration: none;
}

.sbf-current > .sbf-row > .sbf-link:not(#sbf-x) {
  color: var(--sbf-accent);
  font-weight: 600;
}

.sbf-categories .sbf-count {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--sbf-muted);
  font-size: 0.75rem;
  text-align: right;
}

.sbf-count {
  flex: 0 0 auto;
  min-width: 1.75rem;
  padding: 0.0625rem 0.5rem;
  border-radius: 999px;
  background: #f1f1f1;
  color: var(--sbf-muted);
  font-size: 0.75rem;
  text-align: center;
}

.sbf-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

/* Same width as the arrow button, so the product counts line up in one column. */
.sbf-toggle-space {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.sbf-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -4px 0 0 -3px;
  border-right: 1.5px solid var(--sbf-muted);
  border-bottom: 1.5px solid var(--sbf-muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.sbf-toggle[aria-expanded="true"]::before {
  margin-top: -1px;
  transform: rotate(-135deg);
}

.sbf-toggle:hover::before,
.sbf-toggle:focus::before {
  border-color: var(--sbf-accent);
}

.sbf-empty {
  margin: 0.5rem 0 0;
  color: var(--sbf-muted);
  font-size: 0.875rem;
}
