/* === FILTER SIDEBAR — filter.css === */

/* ── Collapsible sections ── */
details.group {
  border-bottom: 1px solid var(--line-2);
  padding: 4px 12px;
}
details.group:last-of-type {
  border-bottom: 0;
}
details.group > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  user-select: none;
}
details.group > summary::-webkit-details-marker {
  display: none;
}
details.group > summary .chev {
  color: var(--muted);
  transition: transform .15s;
  flex-shrink: 0;
}
details.group[open] > summary .chev {
  transform: rotate(180deg);
}
.group-body {
  padding: 2px 4px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Toggle switches ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.toggle-wrap {
  position: relative;
  width: 34px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: #d4dbeb;
  transition: background .15s;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: left .15s;
}
.toggle-input:checked + .toggle-track {
  background: var(--brand);
}
.toggle-input:checked + .toggle-track::after {
  left: 16px;
}

/* ── Price range slider ── */
.range-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}
.range {
  appearance: none;
  width: 100%;
  height: 4px;
  background: #d4dbeb;
  border-radius: 4px;
  outline: 0;
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--brand);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--brand);
}
.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--brand);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--brand);
}
.minmax {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.field {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.field:focus {
  outline: 0;
  border-color: var(--brand);
}

/* ── Small uppercase label ── */
.label-mini {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

/* ── Select wrappers ── */
.select-wrapper {
  position: relative;
}
.select-wrapper::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  pointer-events: none;
}
.filter-select,
.industry-select,
.subcategory-select,
.location-select,
.category-select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 32px 0 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  appearance: none;
  cursor: pointer;
}
.filter-select:focus,
.industry-select:focus,
.subcategory-select:focus,
.location-select:focus {
  outline: 0;
  border-color: var(--brand);
}

/* ── Category search input ── */
.cat-search-wrap {
  position: relative;
}
.cat-search-input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 32px 0 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
}
.cat-search-input:focus {
  outline: 0;
  border-color: var(--brand);
}
.cat-search-wrap svg {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ── Category hierarchy tree ── */
.category-hierarchy {
  max-height: 200px;
  overflow-y: auto;
}
.category-hierarchy::-webkit-scrollbar {
  width: 6px;
}
.category-hierarchy::-webkit-scrollbar-thumb {
  background: #d6dceb;
  border-radius: 3px;
}
.category-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}
.category-item {
  /* list item — children styled below */
}
.category-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}
.category-toggle:hover {
  background: var(--brand-softer);
}
.category-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid #c8d0e3;
  border-radius: 4px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #fff;
}
.category-checkbox.checked {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.category-checkbox.checked::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.category-name {
  flex: 1;
  font-size: 13px;
  color: var(--ink-2);
}
.category-expand {
  color: var(--muted);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.category-expand:hover {
  background: var(--line-2);
}
.category-expand i {
  font-size: 11px;
  transition: transform .15s;
}
.category-expand.expanded i {
  transform: rotate(90deg);
}
.category-children {
  list-style: none;
  margin: 0;
  padding: 0 0 0 22px;
  display: none;
}
.category-children.expanded {
  display: block;
}
.no-categories-found {
  padding: 12px 6px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Selected categories ── */
#selectedCategories {
  margin-top: 8px;
}
.selected-categories-list,
.selected-category-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.selected-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.selected-category-tag .remove-tag {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.selected-category-tag .remove-tag:hover {
  background: rgba(37, 99, 235, 0.15);
}
.clear-selection-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.clear-selection-btn:hover {
  color: var(--brand);
}

/* ── Feature checkboxes ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.feat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}
.cat-item:hover {
  background: var(--brand-softer);
}
.cb {
  width: 16px;
  height: 16px;
  border: 1.5px solid #c8d0e3;
  border-radius: 4px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #fff;
  transition: background .1s, border-color .1s;
}
.cat-item input.sr-only:checked + .cb {
  background: var(--brand);
  border-color: var(--brand);
}
.cat-item input.sr-only:checked + .cb::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.cat-item .name {
  flex: 1;
}

/* ── Industry tags ── */
.industry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.industry-tag {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.industry-tag:hover,
.industry-tag.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
