.filter-aside {
  position: sticky;
  top: 90px;
  align-self: flex-start;
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 1rem;
  order: 1;
  flex: 0 0 320px;
  width: 320px;
}

/* ---- Header ---- */
.filter-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.filter-header-bar h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-header-bar h3 i {
  font-size: 1.15rem;
  color: var(--primary);
}

.filter-clear-all {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.filter-clear-all:hover {
  color: var(--danger);
  background: color-mix(in oklch, var(--danger) 10%, transparent);
}

/* ---- Active Filter Tags ---- */
.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-muted);
}

.active-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: color-mix(in oklch, var(--primary) 15%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in oklch, var(--primary) 25%, transparent);
  transition: all 0.2s;
}

.active-tag:hover {
  background: color-mix(in oklch, var(--primary) 25%, transparent);
  border-color: var(--primary);
}

.active-tag i {
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.active-tag i:hover {
  opacity: 1;
}

.no-tags {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ---- Filter Sections (Cards) ---- */
.filter-section-card {
  margin-bottom: 0.75rem;
  border-radius: 10px;
  background: color-mix(in oklch, var(--bg) 50%, transparent);
  padding: 0 0.75rem;
  transition: background 0.2s;
}

.filter-section-card:last-of-type {
  margin-bottom: 0;
}

.filter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0.7rem 0;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
}

.filter-section-header:hover {
  color: var(--primary);
}

.filter-section-header .label-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-section-header .label-group i {
  font-size: 1rem;
  color: var(--text-muted);
}

.filter-section-header .arrow {
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.filter-section-header.open .arrow {
  transform: rotate(180deg);
}

/* ---- Accordion ---- */
.section-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.section-body.open {
  grid-template-rows: 1fr;
}

.section-body > .section-body-inner {
  overflow: hidden;
}

.section-body-inner {
  padding-bottom: 0;
  min-height: 0;
  transition: padding 0.3s ease;
}

.section-body.open .section-body-inner {
  padding-bottom: 0.75rem;
}

/* ---- Size: Chip Buttons ---- */
.size-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.size-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
  border-radius: 8px;
  background: color-mix(in oklch, var(--bg) 60%, transparent);
  border: 1.5px solid var(--border-muted);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  position: relative;
}

.size-chip:hover {
  border-color: var(--primary);
  color: var(--text);
  background: color-mix(in oklch, var(--primary) 8%, transparent);
}

.size-chip.checked {
  border-color: var(--primary);
  background: color-mix(in oklch, var(--primary) 18%, transparent);
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 30%, transparent);
}

.size-chip input {
  display: none;
}

/* ---- Color: Circle Grid ---- */
.filter-aside .color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 0.5rem;
}

.filter-aside .color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-muted);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  flex-shrink: 0;
}

.filter-aside .color-circle:hover {
  transform: scale(1.12);
  border-color: var(--text-muted);
}

.filter-aside .color-circle.checked {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary) 40%, transparent), 0 2px 8px rgba(0,0,0,0.2);
  transform: scale(1.1);
}

.filter-aside .color-circle.checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.filter-aside .color-circle input {
  display: none;
}

/* ---- Material: List with Checkboxes ---- */
.material-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.material-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.material-row:hover {
  background: color-mix(in oklch, var(--border-muted) 15%, transparent);
}

.material-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 2px solid var(--border-muted);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
}

.material-row input[type="checkbox"]:hover {
  border-color: var(--primary);
}

.material-row input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.material-row input[type="checkbox"]:checked::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/70% no-repeat;
}

.material-row .material-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  transition: color 0.15s;
}

.material-row:hover .material-label {
  color: var(--text);
}

.material-row:has(input:checked) .material-label {
  color: var(--text);
}

.material-row .count {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ---- Bottom Actions ---- */
.filter-aside .filter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-muted);
}

.filter-aside .filter-actions .sidebar-apply-filters {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  background: var(--primary);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  letter-spacing: 0.02em;
}

.filter-aside .filter-actions .sidebar-apply-filters:hover {
  filter: brightness(1.2);
  box-shadow: 0 6px 20px color-mix(in oklch, var(--primary) 35%, transparent);
  transform: translateY(-1px);
}

.filter-aside .filter-actions .sidebar-apply-filters:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.filter-aside .filter-actions .reset-filters {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-muted);
}

.filter-aside .filter-actions .reset-filters:hover {
  border-color: color-mix(in oklch, var(--danger) 60%, transparent);
  color: var(--danger);
  background: color-mix(in oklch, var(--danger) 6%, transparent);
}

.filter-aside .filter-actions .reset-filters:active {
  background: color-mix(in oklch, var(--danger) 12%, transparent);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .filter-aside {
    display: none;
  }
}

@media (min-width: 1101px) {
  .filter-aside {
    order: 1;
  }
}
