/* ===========================================================
   PP FILTERS V7 — Premium Filter System
   Mobile-first | Absolute dropdown positioning | Spring animations
   =========================================================== */

/* -----------------------------------------------------------
   1. DESIGN TOKENS
   ----------------------------------------------------------- */
:root {
    --pf-accent: #10b981;
    --pf-accent-dark: #059669;
    --pf-accent-glow: rgba(16, 185, 129, 0.20);
    --pf-accent-light: rgba(16, 185, 129, 0.09);
    --pf-danger: #ef4444;

    --pf-text: #0f172a;
    --pf-text-muted: #64748b;
    --pf-text-light: #94a3b8;
    --pf-border: rgba(15, 23, 42, 0.10);
    --pf-border-strong: rgba(15, 23, 42, 0.18);
    --pf-white: #ffffff;
    --pf-surface: #f8fafc;
    --pf-surface-hover: #f1f5f9;

    --pf-glass-bg: rgba(255, 255, 255, 0.88);
    --pf-glass-blur: blur(18px);
    --pf-glass-border: 1px solid rgba(255, 255, 255, 0.65);

    --pf-bar-height: 54px;
    --pf-bar-top: 0px;
    /* updated by JS from Flatsome header height */
    --pf-pill-h: 36px;
    --pf-r: 10px;
    --pf-r-sm: 7px;
    --pf-r-pill: 999px;

    --pf-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.07);
    --pf-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --pf-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.16);
    --pf-shadow-panel: -6px 0 30px rgba(0, 0, 0, 0.12);

    --pf-dur: 0.18s;
    --pf-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --pf-spring: cubic-bezier(0.34, 1.20, 0.64, 1);
    --pf-z-bar: 100;
    --pf-z-dd: 8000;
    --pf-z-panel: 9999;
    --pf-z-mobile: 9999;
}

/* -----------------------------------------------------------
   2. STICKY TOP BAR (Hybrid Wrapper)
   ----------------------------------------------------------- */
.pp-sticky-filters-container {
    position: sticky;
    top: var(--pf-bar-top, 0px);
    z-index: var(--pf-z-bar);
    width: 100%;
    background: var(--pf-glass-bg);
    backdrop-filter: var(--pf-glass-blur);
    -webkit-backdrop-filter: var(--pf-glass-blur);
    border-bottom: 1px solid var(--pf-border);
    transition: box-shadow var(--pf-dur) var(--pf-ease), background var(--pf-dur);
}

.pp-sticky-filters-container.is-scrolled {
    box-shadow: var(--pf-shadow-md);
    background: rgba(255, 255, 255, 0.95);
    /* slightly more solid when scrolling */
}

.pp-filter-bar {
    width: 100%;
    /* overflow must be visible so absolute/fixed children aren't clipped */
    overflow: visible;
}

.pp-filter-bar__inner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    height: var(--pf-bar-height);
    max-width: 1440px;
    margin: 0 auto;
    /* NOTE: overflow-x:auto would clip position:fixed dropdowns in some stacking contexts.
       We use a transparent shim technique: the scrollable area is handled via
       the inner's scroll, but dropdowns escape via position:fixed in JS. */
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
}

.pp-filter-bar__inner::-webkit-scrollbar {
    display: none;
}

.pp-filter-bar__spacer {
    flex: 1;
    min-width: 8px;
}

/* -----------------------------------------------------------
   3. DROPDOWN WRAPPER — THE KEY FIX
   (each trigger+dropdown lives in a relative container)
   ----------------------------------------------------------- */
.pp-dropdown-wrap {
    position: relative;
    flex-shrink: 0;
}

.pp-dropdown-wrap--cat {
    /* category wrapper — dropdown can be wider; min-width handled via JS calc */
    min-width: 0;
}

/* -----------------------------------------------------------
   4. PILLS (trigger buttons)
   ----------------------------------------------------------- */
.pp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--pf-pill-h);
    padding: 0 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pf-text);
    background: var(--pf-white);
    border: 1.5px solid var(--pf-border);
    border-radius: var(--pf-r-pill);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--pf-dur) var(--pf-ease);
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
}

.pp-pill:hover {
    background: var(--pf-surface);
    border-color: var(--pf-border-strong);
    box-shadow: var(--pf-shadow-sm);
}

.pp-pill.is-active {
    background: var(--pf-accent-light);
    border-color: var(--pf-accent);
    color: var(--pf-accent-dark);
    box-shadow: 0 0 0 3px var(--pf-accent-glow);
}

.pp-pill[aria-expanded="true"] {
    background: var(--pf-surface);
    border-color: var(--pf-accent);
    box-shadow: 0 0 0 3px var(--pf-accent-glow);
}

.pp-pill[aria-expanded="true"] .pp-pill__chevron {
    transform: rotate(180deg);
}

.pp-pill__icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.pp-pill__label {
    font-weight: 600;
}

.pp-pill__chevron {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform var(--pf-dur) var(--pf-ease), opacity var(--pf-dur);
    margin-left: 1px;
}

.pp-pill:hover .pp-pill__chevron,
.pp-pill.is-active .pp-pill__chevron {
    opacity: 1;
}

/* Active count badge on pill */
.pp-pill__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: var(--pf-accent);
    border-radius: 999px;
}

/* Filters all-button */
.pp-pill--filters {
    background: var(--pf-surface);
    border-style: dashed;
}

.pp-pill--filters.is-active {
    background: var(--pf-accent);
    border-color: var(--pf-accent);
    border-style: solid;
    color: #fff;
}

.pp-pill--filters.is-active .pp-pill__icon {
    opacity: 1;
}

/* -----------------------------------------------------------
   5. DROPDOWNS — ABSOLUTE POSITIONING (fixed in V7)
   ----------------------------------------------------------- */
/*
 * DROPDOWN — position: fixed (set by JS via getBoundingClientRect).
 * Using fixed avoids clipping from overflow-x:auto on ancestor bar.
 * JS (openDropdown) sets: position, top, left, width on each open.
 */
.pp-dropdown {
    display: none;
    position: fixed;
    /* KEY FIX: escapes overflow clipping */
    top: 0;
    /* overridden by JS */
    left: 0;
    /* overridden by JS */
    z-index: var(--pf-z-dd);
    min-width: 240px;
    max-width: 340px;
    max-height: 70vh;
    background: var(--pf-white);
    border: 1px solid var(--pf-border-strong);
    border-radius: var(--pf-r);
    box-shadow: var(--pf-shadow-md), 0 0 0 1px var(--pf-border);
    /* flex-column: inner scrolls, footer sticks */
    flex-direction: column;
    overflow: hidden;
    transform-origin: top center;
}

/* Visible state + entrance animation */
.pp-dropdown.is-open {
    display: flex;
    animation: pp-dd-in 0.15s var(--pf-spring) both;
}

@keyframes pp-dd-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Category dropdown is wider */
.pp-cat-dropdown {
    min-width: 280px;
    max-width: 340px;
}

/* Inner scroll container */
.pp-dropdown__inner {
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    /* fills available space, scrolls */
    min-height: 0;
    /* flex child shrink fix */
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--pf-border) transparent;
}

/* Sticky apply footer — always visible at bottom of dropdown */
.pp-dropdown__footer {
    padding: 8px;
    border-top: 1px solid var(--pf-border);
    background: var(--pf-white);
    flex-shrink: 0;
}

.pp-dropdown__inner::-webkit-scrollbar {
    width: 4px;
}

.pp-dropdown__inner::-webkit-scrollbar-thumb {
    background: var(--pf-border);
    border-radius: 2px;
}

/* Dropdown heading */
.pp-dropdown__title {
    padding: 8px 8px 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pf-text-muted);
    border-bottom: 1px solid var(--pf-border);
    margin-bottom: 4px;
}

/* -----------------------------------------------------------
   6. CATEGORY TREE (Premium UX)
   ----------------------------------------------------------- */
.pp-cat-tree {
    list-style: none;
    margin: 0;
    padding: 2px 0;
}

.pp-cat-tree__item {
    margin: 0;
    position: relative;
}

.pp-cat-tree__item-inner {
    display: flex;
    align-items: stretch;
    border-radius: var(--pf-r-sm);
    transition: background var(--pf-dur);
    min-height: 40px;
}

.pp-cat-tree__item-inner:hover {
    background: var(--pf-surface);
}

/* Base category link - text + count */
.pp-cat-tree__link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pf-text) !important;
    text-decoration: none !important;
    border-radius: var(--pf-r-sm);
    transition: color var(--pf-dur);
    min-width: 0;
}

.pp-cat-tree__link.is-active {
    background: var(--pf-accent-light);
    color: var(--pf-accent-dark) !important;
    font-weight: 700;
}

/* Truncation safety */
.pp-cat-tree__text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fitts' Law: Large discrete toggle button */
.pp-cat-tree__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--pf-text-muted);
    cursor: pointer;
    border-radius: var(--pf-r-sm);
    transition: background var(--pf-dur), color var(--pf-dur);
    margin: 2px;
}

.pp-cat-tree__toggle:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--pf-text);
}

.pp-cat-tree__toggle svg {
    transition: transform 0.25s var(--pf-spring);
    opacity: 0.6;
}

.pp-cat-tree__item.is-open .pp-cat-tree__toggle svg {
    transform: rotate(180deg);
    opacity: 1;
}

/* Smooth Accordion Animation */
.pp-cat-tree__children-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s var(--pf-spring);
}

.pp-cat-tree__item.is-open .pp-cat-tree__children-wrap {
    grid-template-rows: 1fr;
}

.pp-cat-tree__children {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
    overflow: hidden;
    /* Hide during 0fr */
    position: relative;
}

/* Visual Hierarchy: Vertical branch line */
.pp-cat-tree__children::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 8px;
    left: 21px;
    width: 1px;
    background: var(--pf-border);
}

.pp-cat-tree__children li {
    position: relative;
    padding-left: 12px;
    margin: 2px 0;
}

/* Horizontal branch leading to child item */
.pp-cat-tree__children li::before {
    content: '';
    position: absolute;
    top: 18px;
    /* half of child link height roughly */
    left: 5px;
    width: 8px;
    height: 1px;
    background: var(--pf-border);
}

.pp-cat-tree__child-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    font-size: 12.5px;
    color: var(--pf-text-muted) !important;
    text-decoration: none !important;
    border-radius: var(--pf-r-sm);
    transition: background var(--pf-dur), color var(--pf-dur);
    min-height: 38px;
    min-width: 0;
}

.pp-cat-tree__child-link:hover {
    background: var(--pf-surface);
    color: var(--pf-text) !important;
}

.pp-cat-tree__child-link.is-active {
    background: var(--pf-accent-light);
    color: var(--pf-accent-dark) !important;
    font-weight: 700;
}

/* -----------------------------------------------------------
   7. ATTR DROPDOWN OPTIONS (checkboxes in top bar dropdown)
   ----------------------------------------------------------- */
.pp-attr-pills {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0;
}

.pp-attr-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--pf-r-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--pf-text);
    transition: background var(--pf-dur), color var(--pf-dur);
    user-select: none;
    min-height: 38px;
    position: relative;
}

.pp-attr-option input {
    /* visually hidden but still accessible */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.pp-attr-option:hover {
    background: var(--pf-surface);
}

.pp-attr-option:active {
    background: var(--pf-surface-hover);
}

.pp-attr-option.is-active {
    background: var(--pf-accent-light);
    font-weight: 600;
    color: var(--pf-accent-dark);
}

/* Checkbox dot indicator */
.pp-attr-option__dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid var(--pf-border-strong);
    flex-shrink: 0;
    transition: background var(--pf-dur), border-color var(--pf-dur);
    position: relative;
}

.pp-attr-option__dot::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 2px;
    background: var(--pf-accent);
    opacity: 0;
    transition: opacity var(--pf-dur);
}

.pp-attr-option.is-active .pp-attr-option__dot {
    border-color: var(--pf-accent);
}

.pp-attr-option.is-active .pp-attr-option__dot::after {
    opacity: 1;
}

.pp-attr-option__name {
    flex: 1;
}

/* Term count badge */
.pp-term-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--pf-text-light);
    background: var(--pf-surface);
    border: 1px solid var(--pf-border);
    border-radius: 999px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Clear link inside dropdown */
.pp-clear-link {
    display: block;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pf-danger) !important;
    text-decoration: none !important;
    border-radius: var(--pf-r-sm);
    transition: background var(--pf-dur);
    text-align: center;
    margin: 4px 0;
}

.pp-clear-link:hover {
    background: rgba(239, 68, 68, 0.07);
}

/* -----------------------------------------------------------
   8. PRICE FORM (inside dropdown)
   ----------------------------------------------------------- */
.pp-price-range-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 4px 4px 2px;
}

.pp-price-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.pp-price-label__text {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pf-text-muted);
}

.pp-price-label input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pf-text);
    background: var(--pf-surface);
    border: 1.5px solid var(--pf-border);
    border-radius: var(--pf-r-sm);
    outline: none;
    transition: border-color var(--pf-dur), box-shadow var(--pf-dur);
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}

.pp-price-label input::-webkit-inner-spin-button,
.pp-price-label input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.pp-price-label input:focus {
    border-color: var(--pf-accent);
    box-shadow: 0 0 0 3px var(--pf-accent-glow);
    background: var(--pf-white);
}

.pp-range-sep {
    font-size: 14px;
    color: var(--pf-text-light);
    font-weight: 700;
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* Apply button */
.pp-apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    background: var(--pf-accent);
    color: #fff;
    border: none;
    border-radius: var(--pf-r-sm);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background var(--pf-dur), box-shadow var(--pf-dur), transform var(--pf-dur);
    margin-top: 0;
    /* reset — footer handles spacing */
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.pp-apply-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--pf-dur);
}

.pp-apply-btn:hover {
    background: var(--pf-accent-dark);
    box-shadow: 0 4px 14px var(--pf-accent-glow);
    transform: translateY(-1px);
}

.pp-apply-btn:hover::after {
    background: rgba(255, 255, 255, 0.07);
}

.pp-apply-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.pp-apply-btn--full {
    width: 100%;
}

/* -----------------------------------------------------------
   8b. DUAL RANGE SLIDER (top bar + panel)
   ----------------------------------------------------------- */
.pp-bar-slider-wrap {
    padding: 8px 4px 4px;
}

.pp-bar-slider-track {
    position: relative;
    height: 4px;
    background: var(--pf-border);
    border-radius: 999px;
    margin: 20px 0 28px;
}

.pp-slider-fill {
    position: absolute;
    height: 100%;
    background: var(--pf-accent);
    border-radius: 999px;
    pointer-events: none;
    left: var(--fill-left, 0%);
    right: var(--fill-right, 0%);
}

/* Both range inputs overlap each other on the track */
.pp-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    transform: translateY(-50%);
}

.pp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pf-white);
    border: 2.5px solid var(--pf-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
    cursor: pointer;
    pointer-events: all;
    z-index: 1;
    transition: box-shadow var(--pf-dur);
}

.pp-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pf-white);
    border: 2.5px solid var(--pf-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
    cursor: pointer;
    pointer-events: all;
}

.pp-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 6px var(--pf-accent-glow);
}

.pp-bar-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pf-text-muted);
}

/* -----------------------------------------------------------
   9. ACTIVE FILTER CHIPS (row below bar)
   ----------------------------------------------------------- */
.pp-active-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 20px 14px 20px;
    /* added some bottom padding for breathing room */
}

.pp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px 5px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--pf-accent-dark) !important;
    background: var(--pf-accent-light);
    border: 1px solid var(--pf-accent);
    border-radius: 999px;
    text-decoration: none !important;
    transition: all var(--pf-dur) var(--pf-ease);
    animation: pp-chip-in 0.22s var(--pf-spring) both;
    cursor: pointer;
}

@keyframes pp-chip-in {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pp-chip:hover {
    background: var(--pf-danger);
    border-color: var(--pf-danger);
    color: #fff !important;
}

.pp-chip__x {
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
    font-weight: 400;
}

.pp-chip:hover .pp-chip__x {
    opacity: 1;
}

.pp-chip--clear {
    background: transparent;
    border-color: var(--pf-border-strong);
    color: var(--pf-text-muted) !important;
}

.pp-chip--clear:hover {
    background: var(--pf-danger);
    border-color: var(--pf-danger);
    color: #fff !important;
}

/* -----------------------------------------------------------
   10. RIGHT SLIDE PANEL (desktop — all filters)
   ----------------------------------------------------------- */
.pp-right-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--pf-z-panel);
    display: flex;
    pointer-events: none;
}

.pp-right-panel__overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.3s var(--pf-ease);
    pointer-events: none;
}

.pp-right-panel__drawer {
    width: 360px;
    max-width: 90vw;
    background: var(--pf-white);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateX(100%);
    transition: transform 0.38s var(--pf-spring);
    box-shadow: var(--pf-shadow-panel);
}

.pp-right-panel.is-open {
    pointer-events: auto;
}

.pp-right-panel.is-open .pp-right-panel__overlay {
    opacity: 1;
    pointer-events: auto;
}

.pp-right-panel.is-open .pp-right-panel__drawer {
    transform: translateX(0);
}

.pp-right-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--pf-border);
    flex-shrink: 0;
    background: var(--pf-white);
}

.pp-right-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: var(--pf-text);
}

.pp-panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: var(--pf-accent);
    border-radius: 999px;
}

.pp-right-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    overscroll-behavior: contain;
}

.pp-right-panel__footer {
    display: flex;
    gap: 0;
    padding: 12px 16px;
    border-top: 1.5px solid var(--pf-border);
    background: var(--pf-white);
    flex-shrink: 0;
}

/* 50/50 split: each button fills half the footer */
.pp-right-panel__footer .pp-btn {
    flex: 1;
    border-radius: 0;
    height: 44px;
    font-size: 13px;
}

.pp-right-panel__footer .pp-btn:first-child {
    border-radius: var(--pf-r-sm) 0 0 var(--pf-r-sm);
    border-right: none;
}

.pp-right-panel__footer .pp-btn:last-child {
    border-radius: 0 var(--pf-r-sm) var(--pf-r-sm) 0;
}

/* Hide right panel on mobile */
@media (max-width: 767px) {
    .pp-right-panel {
        display: none !important;
    }
}

/* -----------------------------------------------------------
   11. ICON BUTTON
   ----------------------------------------------------------- */
.pp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--pf-border);
    color: var(--pf-text-muted);
    cursor: pointer;
    transition: all var(--pf-dur);
    font-size: 14px;
    flex-shrink: 0;
}

.pp-icon-btn:hover {
    background: var(--pf-surface);
    border-color: var(--pf-border-strong);
    color: var(--pf-text);
}

/* -----------------------------------------------------------
   12. ACTION BUTTONS (panel footer)
   ----------------------------------------------------------- */
.pp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 18px;
    border-radius: var(--pf-r-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--pf-dur) var(--pf-ease);
    text-decoration: none !important;
    white-space: nowrap;
}

.pp-btn--primary {
    background: var(--pf-accent);
    border-color: var(--pf-accent);
    color: #fff !important;
}

.pp-btn--primary:hover {
    background: var(--pf-accent-dark);
    box-shadow: 0 3px 12px var(--pf-accent-glow);
    transform: translateY(-1px);
}

.pp-btn--ghost {
    background: transparent;
    border-color: var(--pf-border-strong);
    color: var(--pf-text-muted) !important;
}

.pp-btn--ghost:hover {
    background: var(--pf-surface);
    color: var(--pf-text) !important;
}

.pp-btn--full {
    width: 100%;
    flex: 1;
}

.pp-btn--sm {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

/* -----------------------------------------------------------
   13. ACCORDION (panel filter groups)
   ----------------------------------------------------------- */
.pp-accordion {
    border: 1.5px solid var(--pf-border);
    border-radius: var(--pf-r);
    overflow: hidden;
    margin-bottom: 8px;
    background: var(--pf-white);
    transition: border-color var(--pf-dur);
}

.pp-accordion[open] {
    border-color: var(--pf-accent);
}

.pp-accordion__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--pf-text);
    cursor: pointer;
    user-select: none;
    list-style: none;
    min-height: 46px;
    transition: background var(--pf-dur);
}

.pp-accordion__header::-webkit-details-marker {
    display: none;
}

.pp-accordion__header:hover {
    background: var(--pf-surface);
}

.pp-accordion__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: var(--pf-accent);
    border-radius: 999px;
}

.pp-accordion__arrow {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pf-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: transform var(--pf-dur) var(--pf-ease), background var(--pf-dur);
    flex-shrink: 0;
}

.pp-accordion__arrow::after {
    content: '›';
    display: block;
}

.pp-accordion[open] .pp-accordion__arrow {
    transform: rotate(90deg);
    background: var(--pf-accent-light);
}

.pp-accordion__content {
    padding: 4px 12px 12px;
    border-top: 1px solid var(--pf-border);
    animation: pp-acc-open 0.2s var(--pf-ease) both;
}

@keyframes pp-acc-open {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* -----------------------------------------------------------
   14. PANEL EMPTY STATE
   ----------------------------------------------------------- */
.pp-panel-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--pf-text-muted);
    font-size: 13px;
}

/* -----------------------------------------------------------
   15. MOBILE TRIGGER (sticky bottom button)
   ----------------------------------------------------------- */
.pp-mobile-trigger {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--pf-z-mobile);
    height: 48px;
    padding: 0 24px;
    background: var(--pf-text);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    transition: transform var(--pf-dur) var(--pf-spring), box-shadow var(--pf-dur);
    white-space: nowrap;
}

.pp-mobile-trigger:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pp-mobile-trigger__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 800;
    color: var(--pf-text);
    background: #fff;
    border-radius: 999px;
}

@media (max-width: 767px) {
    .pp-mobile-trigger {
        display: flex;
    }
}

/* -----------------------------------------------------------
   16. MOBILE BOTTOM DRAWER
   ----------------------------------------------------------- */
.pp-mobile-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: calc(var(--pf-z-mobile) + 10);
    pointer-events: none;
}

.pp-mobile-drawer.is-open {
    pointer-events: auto;
}

.pp-mobile-drawer__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s var(--pf-ease);
}

.pp-mobile-drawer.is-open .pp-mobile-drawer__backdrop {
    opacity: 1;
}

.pp-mobile-drawer__panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pf-white);
    border-radius: 20px 20px 0 0;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s var(--pf-spring);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
}

.pp-mobile-drawer.is-open .pp-mobile-drawer__panel {
    transform: translateY(0);
}

.pp-mobile-drawer__handle {
    width: 36px;
    height: 4px;
    background: var(--pf-border-strong);
    border-radius: 2px;
    margin: 10px auto 6px;
    flex-shrink: 0;
}

.pp-mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 12px;
    border-bottom: 1px solid var(--pf-border);
    flex-shrink: 0;
}

.pp-mobile-drawer__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: var(--pf-text);
}

.pp-mobile-drawer__content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    overscroll-behavior: contain;
}

.pp-mobile-drawer__footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px 20px;
    border-top: 1px solid var(--pf-border);
    background: var(--pf-surface);
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .pp-mobile-drawer {
        display: block;
    }
}

/* -----------------------------------------------------------
   17. FILTER TYPE: PILLS (accordion multi-select)
   ----------------------------------------------------------- */
.pp-filter-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 8px;
}

.pp-term-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pf-text) !important;
    background: var(--pf-surface);
    border: 1.5px solid var(--pf-border);
    border-radius: 999px;
    text-decoration: none !important;
    cursor: pointer;
    transition: all var(--pf-dur) var(--pf-ease);
    user-select: none;
}

.pp-term-pill:hover {
    background: var(--pf-accent-light);
    border-color: var(--pf-accent);
    color: var(--pf-accent-dark) !important;
}

.pp-term-pill.is-active {
    background: var(--pf-accent) !important;
    border-color: var(--pf-accent) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px var(--pf-accent-glow);
}

.pp-term-pill__check {
    opacity: 0;
    font-size: 10px;
    font-weight: 900;
    transition: opacity var(--pf-dur);
}

.pp-term-pill.is-active .pp-term-pill__check {
    opacity: 1;
}

/* -----------------------------------------------------------
   18. FILTER TYPE: RANGE
   ----------------------------------------------------------- */
.pp-filter-range-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 4px;
}

.pp-range-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* -----------------------------------------------------------
   19. FILTER TYPE: RADIO
   ----------------------------------------------------------- */
.pp-radio-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 4px;
}

.pp-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--pf-r-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--pf-text);
    transition: background var(--pf-dur);
    min-height: 42px;
    user-select: none;
}

.pp-radio-option input {
    display: none;
}

.pp-radio-option:hover {
    background: var(--pf-surface);
}

.pp-radio-option.is-active {
    background: var(--pf-accent-light);
    font-weight: 700;
    color: var(--pf-accent-dark);
}

.pp-radio-option__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--pf-border-strong);
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--pf-dur);
}

.pp-radio-option__dot::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--pf-accent);
    opacity: 0;
    transition: opacity var(--pf-dur);
}

.pp-radio-option.is-active .pp-radio-option__dot {
    border-color: var(--pf-accent);
}

.pp-radio-option.is-active .pp-radio-option__dot::after {
    opacity: 1;
}

.pp-slider-fill {
    position: absolute;
    height: 100%;
    background: var(--pf-accent);
    border-radius: 999px;
    left: var(--fill-left, 0%);
    right: var(--fill-right, 0%);
}

.pp-slider-wrap {
    position: relative;
    height: 32px;
    margin: 12px 0 16px;
    padding: 0 4px;
}

.pp-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--pf-border);
    border-radius: 999px;
    transform: translateY(-50%);
}

.pp-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    border: none;
    outline: none;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    transform: translateY(-50%);
}

.pp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pf-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 14px var(--pf-accent-glow);
}

.pp-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pf-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    pointer-events: auto;
}

/* -----------------------------------------------------------
   21. FILTER TYPE: COLOR SWATCHES
   ----------------------------------------------------------- */
.pp-swatches-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 8px;
}

.pp-swatch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    cursor: pointer;
    border-radius: 50%;
    transition: transform var(--pf-dur) var(--pf-spring), box-shadow var(--pf-dur);
}

.pp-swatch:hover {
    transform: scale(1.12);
}

.pp-swatch__color {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pp-swatch.is-active .pp-swatch__color {
    box-shadow: 0 0 0 3px var(--pf-accent), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pp-swatch--text {
    border-radius: 999px;
}

.pp-swatch__label {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--pf-text);
    background: var(--pf-surface);
    border: 1.5px solid var(--pf-border);
    border-radius: 999px;
    transition: all var(--pf-dur);
}

.pp-swatch.is-active .pp-swatch__label {
    background: var(--pf-accent);
    border-color: var(--pf-accent);
    color: #fff;
}

/* -----------------------------------------------------------
   22. PRICE FORM (stacked — in accordion panel)
   ----------------------------------------------------------- */
.pp-price-form--stacked {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* -----------------------------------------------------------
   23. MOBILE TOP BAR (compressed)
   ----------------------------------------------------------- */
@media (max-width: 767px) {
    .pp-filter-bar__inner {
        padding: 0 12px;
        height: 48px;
        gap: 6px;
    }

    /* Only show cat trigger + filters button on mobile */
    .pp-dropdown-wrap:not(.pp-dropdown-wrap--cat) {
        display: none;
    }
}

/* -----------------------------------------------------------
   24. UTILITY
   ----------------------------------------------------------- */
.pp-hidden {
    display: none !important;
}

/* -----------------------------------------------------------
   25. PANEL ACTIVE FILTERS SUMMARY
   ----------------------------------------------------------- */
.pp-panel-active {
    margin: 0 0 10px;
    padding: 10px 12px;
    background: var(--pf-accent-light);
    border: 1px solid var(--pf-accent);
    border-radius: var(--pf-r);
}

.pp-panel-active__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pp-panel-active__label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--pf-accent-dark);
}

.pp-panel-active__clear {
    font-size: 11px;
    font-weight: 700;
    color: var(--pf-danger) !important;
    text-decoration: none !important;
}

.pp-panel-active__clear:hover {
    opacity: .75;
}

.pp-panel-active__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pp-panel-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pf-accent-dark) !important;
    background: var(--pf-white);
    border: 1px solid var(--pf-accent);
    border-radius: 999px;
    text-decoration: none !important;
    cursor: pointer;
    transition: all var(--pf-dur);
}

.pp-panel-chip span {
    opacity: .6;
    font-size: 12px;
}

.pp-panel-chip:hover {
    background: var(--pf-danger);
    border-color: var(--pf-danger);
    color: #fff !important;
}