<!-- source-hash: 1d107abaa66df6045feade13e2cfcdf0 -->
Provides a unified, URL-driven AND-based filtering system for Next.js pages, exposing a React hook and pre-built filter configurations for managing multi-dimensional filter state via search parameters.

## Key Components

### Interfaces
- **`FilterState`** — Represents the current filter state: `search`, `categories`, `subcategories`, `tags`, `filters`, `pricing`, and `page`
- **`FilterConfig`** — Configures a filter instance with a `basePath` and a feature flag map (`supportedFilters`) to enable/disable filter dimensions

### Hook
- **`useUnifiedFiltering(config)`** — Core hook that reads/writes filter state from URL search params using AND logic. Returns:
  - `getCurrentFilterState()` — Parses current URL params into a `FilterState` object
  - `updateFilters(newFilters, preserveScroll?)` — Rebuilds the URL with merged filter state
  - `addFilter(type, value, preserveScroll?)` — Appends a value to a filter dimension
  - `removeFilter(type, value?, preserveScroll?)` — Removes a specific or all values from a filter dimension
  - `toggleFilter(type, value, preserveScroll?)` — Adds or removes a value depending on current state
  - `clearAllFilters()` — Navigates to the base path, removing all params
  - `getFilterChips(categories?, tags?)` — Generates display chip descriptors from active filters
  - `handleFilterChipRemove(chipId)` — Removes a filter based on a chip's `id` string
  - `isPending` — React transition pending state for UI feedback

### Pre-built Configs
- **`vendorFilterConfig`** — Config for `/vendors` with categories, subcategories, filters, pricing, and search enabled
- **`blogFilterConfig`** — Config for `/blog` with categories, tags, and search enabled

## Usage Example

```typescript
import { useUnifiedFiltering, vendorFilterConfig } from './unified-filter-logic'

function VendorFilters() {
  const {
    getCurrentFilterState,
    toggleFilter,
    clearAllFilters,
    getFilterChips,
    handleFilterChipRemove,
    isPending
  } = useUnifiedFiltering(vendorFilterConfig)

  const state = getCurrentFilterState()

  return (
    <div>
      <button onClick={() => toggleFilter('categories', 'security')}>
        Toggle Security
      </button>
      <button onClick={() => toggleFilter('pricing', 'free')}>
        Toggle Free
      </button>
      <button onClick={clearAllFilters}>Clear All</button>

      {getFilterChips().map(chip => (
        <span key={chip.id} onClick={() => handleFilterChipRemove(chip.id)}>
          {chip.label} ✕
        </span>
      ))}

      {isPending && <span>Loading...</span>}
    </div>
  )
}
```