.catalog-filters {
  padding: 16px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.filters-head h3 {
  margin: 0;
  color: var(--text-primary);
}

.filter-group {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.filter-group-toggle {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--font-size-md, 0.9375rem);
  font-weight: var(--font-weight-bold, 700);
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.filter-group-chevron {
  color: var(--text-secondary);
  font-size: var(--font-size-base, 0.875rem);
  transition: transform 0.2s ease;
}

.filter-group-toggle.collapsed .filter-group-chevron {
  transform: rotate(-90deg);
}

.filter-group-body {
  display: grid;
  gap: 12px;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 0.2s ease, opacity 0.2s ease;
  opacity: 1;
}

.filter-group-body.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
}

.filter-group-body > * {
  min-height: 0;
}

.filter-group-toggle:focus-visible,
.option-check input:focus-visible,
.range-inputs input:focus-visible,
.slider-inputs input:focus-visible,
.size-chip:focus-visible,
.rating-chip:focus-visible,
.color-swatch:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-color) 28%, white);
  outline-offset: 2px;
}

.filter-group h4,
.range-field span {
  margin: 0;
  font-size: var(--font-size-sm, 0.8125rem);
  font-weight: var(--font-weight-bold, 700);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.range-field {
  display: grid;
  gap: 8px;
}

.range-field input {
  width: 100%;
}

.options {
  display: grid;
  gap: 8px;
}

.option-check {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  min-height: 32px;
}

.option-check small {
  color: var(--text-secondary);
}

.option-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.availability-dot[data-availability='in-stock'] {
  background: #22c55e;
}

.availability-dot[data-availability='low-stock'] {
  background: #f59e0b;
}

.availability-dot[data-availability='out-of-stock'] {
  background: #ef4444;
}

.range-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.range-inputs input {
  min-height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  color: var(--text-primary);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.slider-inputs {
  display: grid;
  gap: 12px;
}

.slider-inputs input {
  width: 100%;
}

.slider-inputs span {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: var(--font-weight-semibold, 600);
}

.color-options,
.size-options,
.rating-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.color-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 3px var(--text-primary);
}

.color-swatch-check {
  color: #fff;
  font-size: var(--font-size-sm, 0.8125rem);
  font-weight: var(--font-weight-bold, 700);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.color-swatch:hover {
  transform: translateY(-1px);
}

.size-chip,
.rating-chip {
  min-height: 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.size-chip.active,
.rating-chip.active {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 8%, white);
}

.size-chip:hover,
.rating-chip:hover {
  transform: translateY(-1px);
  border-color: var(--primary-color);
}

.size-chip:disabled,
.rating-chip:disabled,
.color-swatch:disabled,
.range-inputs input:disabled,
.slider-inputs input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 1024px) {
  .catalog-filters {
    gap: 12px;
  }

  .option-check {
    grid-template-columns: auto auto 1fr;
  }
}

@media (max-width: 640px) {
  .range-inputs {
    grid-template-columns: 1fr;
  }

  .catalog-filters {
    padding-inline: 0;
  }
}
