.filter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
}

.filter-back-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .25rem 0 .5rem;
}

.filter-back-link {
  font-family: var(--font-misc);
  font-size: clamp(14px, 2.2vw, 22px);
  color: var(--color-grey);
  text-decoration: none;
}
.filter-back-link:hover { color: var(--color-black); }

.filter-tabs-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.filter-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  min-width: 0;
}

.filter-search-toggle {
  border: none;
  background: transparent;
  padding: .25rem;
  cursor: pointer;
}

.filter-inline-search {
  width: 0;
  max-width: 500px;
  transition: width .2s ease, opacity .2s ease;
  opacity: 0;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 0;
  background: transparent;
  padding: .5rem 0;
}

.filter-inline-search:focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: rgba(0, 0, 0, 0.55);
}

.filter-inline-search[data-open="true"] {
  width: min(60vw, 500px);
  opacity: 1;
}
.filter-separator {
  display: none;
}

.filter-selected-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2.2vw, 1.65rem);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

/* All Picks Filter Styles */

.all-picks-filter {
  background: transparent;
  border: none;
  padding: 1rem 0;
  margin-bottom: 1rem;
}

/* Search Bar */
.filter-search {
  margin-bottom: 1.5rem;
}

.all-picks-search-input .search-input-wrapper {
  max-width: 100%;
}

/* Tab Navigation */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: .25rem .5rem;
  border: none;
  background: transparent;
  font-family: var(--font-misc);
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-grey);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: 0;
  opacity: .7;
}

.filter-tab.active {
  opacity: 1;
  font-weight: 700;
  color: var(--color-black);
}

/* Dropdown Filters */
.filter-dropdown {
  position: relative;
}

.filter-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: .25rem .5rem;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-misc);
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-grey);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: 0;
  min-width: auto;
  opacity: .7;
}

.filter-dropdown-trigger:hover { color: var(--color-black); opacity: .75; }

.filter-dropdown-trigger.active { opacity: 1; font-weight: 700; color: var(--color-black); }

.filter-dropdown-text {
  flex: 1;
  text-align: left;
}

.filter-dropdown-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.filter-dropdown-trigger[aria-expanded="true"] .filter-dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Content */
.filter-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border: none;
  border-radius: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  z-index: 1000;
  width: min(92vw, 500px);
  transform: translateY(-4px) scale(.98);
  max-height: calc(100vh - 220px);
  overflow: hidden;
  margin-top: 0.25rem;
  transition: transform .18s ease, opacity .18s ease;
  transform-origin: 12px top;
  opacity: 0;
}

.filter-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: none;
  background: #f8f9fb;
}

.filter-dropdown-header h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-black);
  margin: 0;
}

.filter-dropdown-close {
  padding: 0.25rem;
  border: none;
  background: transparent;
  color: var(--color-grey);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.filter-dropdown-close:hover {
  background: var(--color-white);
}

/* Dropdown Grid */
.filter-dropdown-search {
  padding: .5rem 1rem .25rem;
}

.filter-dropdown-search-input {
  width: 100%;
  padding: .5rem 0;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
}

.filter-dropdown-search-input:focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: rgba(0, 0, 0, 0.55);
}

.filter-dropdown-grid {
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  padding: 0.5rem 1rem 1rem;
}

.filter-dropdown-option {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.2s ease;
  margin-bottom: 0.25rem;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-black);
  letter-spacing: .04em;
}

.filter-dropdown-option:hover {
  background: rgba(0,0,0,.04);
}

.filter-dropdown-option.active { background: rgba(0,0,0,.06); color: var(--color-black); font-weight: 700; }

/* Open animation state handled by [aria-expanded] on trigger */
.filter-dropdown-trigger[aria-expanded="true"] + .filter-dropdown-content,
.filter-dropdown-content[data-open="true"] {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--color-light-grey);
  margin-top: 1rem;
}

.filter-clear {
  padding: .25rem .5rem;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-misc);
  font-size: var(--font-size-sm);
  color: var(--color-grey);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-clear:hover {
  background: transparent;
  color: var(--color-black);
}

/* Responsive */
@media (max-width: 768px) {
  .all-picks-filter {
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
  }

  /* Stack: scrollable filters, then full-width search */
  .filter-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .filter-tabs-left {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }

  .filter-tabs-left::-webkit-scrollbar {
    display: none;
  }

  .filter-tab,
  .filter-dropdown,
  .filter-dropdown-trigger {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .filter-tab,
  .filter-dropdown-trigger {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
  }

  .filter-right {
    width: 100%;
    justify-content: stretch;
  }

  /* Always show search on mobile — no cramped expand toggle */
  .filter-search-toggle {
    display: none;
  }

  .filter-inline-search {
    width: 100%;
    max-width: none;
    opacity: 1;
    flex: 1;
  }

  .filter-inline-search[data-open="false"] {
    width: 100%;
    opacity: 1;
  }

  /* Dim page when a facet dropdown is open */
  .all-picks-filter:has(.filter-dropdown-trigger[aria-expanded="true"])::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 1000;
  }

  /* Bottom-sheet facet picker */
  .filter-dropdown-content {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: min(75vh, 560px);
    margin: 0;
    transform: translateY(105%);
    transform-origin: center bottom;
    opacity: 1;
    z-index: 1001;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
  }

  .filter-dropdown-trigger[aria-expanded="true"] + .filter-dropdown-content:not([hidden]) {
    transform: translateY(0);
  }

  .filter-dropdown-grid {
    max-height: calc(min(75vh, 560px) - 120px);
  }

  .filter-selected-heading {
    font-size: clamp(1rem, 4.5vw, 1.35rem);
    margin-bottom: 0.75rem;
  }

  .filter-back-link {
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 480px) {
  .filter-option-content {
    gap: 0.5rem;
  }

  .filter-option-image {
    width: 32px;
    height: 32px;
  }

  .filter-dropdown-option {
    padding: 0.85rem 0.5rem;
    font-size: var(--font-size-base);
  }
}

/* Brand grid hidden state */
.brand-grid .brand-card.is-hidden {
  display: none !important;
}

/* Preserve original casing for articles filter */
.page--articles .filter-dropdown-option {
  text-transform: none;
}

/* Preserve original casing for articles filter selected heading */
.page--articles .filter-selected-heading,
.page--articles .all-picks-filter .filter-selected-heading,
.page--articles .all-picks-filter #selectedHeading,
.page--articles #selectedHeading {
  text-transform: none !important;
  font-family: var(--font-heading) !important;
}

/* Override any global text-transform rules that might affect the selected heading */
.page--articles .filter-selected-heading *,
.page--articles .all-picks-filter .filter-selected-heading *,
.page--articles .all-picks-filter #selectedHeading *,
.page--articles #selectedHeading * {
  text-transform: none !important;
}

/* Loader (shared) */
.loader {
  width: 60px;
  aspect-ratio: 4;
  background: radial-gradient(circle closest-side,#000 90%,#0000) 0/calc(100%/3) 100% space;
  clip-path: inset(0 100% 0 0);
  animation: l1 1s steps(4) infinite;
  margin: 24px auto;
}
@keyframes l1 { to { clip-path: inset(0 -34% 0 0) } }

/* Grid overlay loader */
.grid-container { position: relative; }
.grid-loading-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  z-index: 5;
}
.grid-loading-overlay.is-visible { display: flex; }
.grid-container.is-loading > *:not(.grid-loading-overlay) {
  filter: blur(1px);
  pointer-events: none;
}
