:root {
    --wff-primary: #3b6ce7;
    --wff-primary-light: #eef2ff;
    --wff-danger: #d93025;
    --wff-border: #e5e7eb;
    --wff-border-light: #f0f1f3;
    --wff-text: #1f2937;
    --wff-muted: #6b7280;
    --wff-dim: #b0b7c3;
    --wff-scroll-thumb: #a0aec0;
    --wff-scroll-track: #f3f4f6;
    --wff-tag-bg: #eef4ff;
    --wff-tag-border: #c7d9f0;
    --wff-tag-text: #1a56db;
    --wff-pill-bg: #f3f4f6;
    --wff-pill-border: #d1d5db;
    --wff-pill-active-bg: #3b6ce7;
    --wff-pill-active-border: #3b6ce7;
    --wff-pill-active-text: #ffffff;
    --wff-row-hover: #f8f9fb;
    --wff-row-active: #eef2ff;
    --wff-radius: 6px;
}

/* ========================================
 *  TOOLBAR — count + sort (one row)
 * ======================================== */
.wff-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px 0;
    padding: 0;
}

.wff-toolbar-count {
    font-size: 13px;
    color: var(--wff-muted);
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.wff-toolbar-count.wff-count-updating {
    opacity: 0.3;
}

.wff-toolbar-count strong {
    color: var(--wff-text);
    font-weight: 600;
}

/* ========================================
 *  ACTIVE FILTER PILLS — separate row below toolbar
 * ======================================== */
.wff-toolbar-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.wff-toolbar-pills:empty {
    display: none;
}

.wff-toolbar-pills::-webkit-scrollbar {
    display: none;
}

/* Flatten the above-loop wrapper inside pills row */
.wff-toolbar-pills .wff-active-filters.wff-above-loop {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: visible !important;
}

.wff-toolbar-pills .wff-above-loop .wff-active-top {
    display: contents !important;
}

.wff-toolbar-pills .wff-above-loop .wff-active-title {
    display: none !important;
}

.wff-toolbar-pills .wff-above-loop .wff-active-list {
    display: contents !important;
}

.wff-toolbar-pills .wff-active-tag,
.wff-toolbar-pills .wff-clear-all-btn {
    flex-shrink: 0;
}

/* Sort select */
.wff-toolbar-sort {
    appearance: none;
    -webkit-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 10px 6px;
    border: 1px solid var(--wff-border);
    border-radius: 8px;
    padding: 7px 30px 7px 12px;
    font-size: 13px;
    color: var(--wff-text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
    max-width: 200px;
    flex-shrink: 0;
}

.wff-toolbar-sort:focus {
    border-color: var(--wff-primary);
}

/* Sort active indicator — subtle blue tint */
.wff-toolbar-sort.wff-sort-active {
    border-color: var(--wff-primary);
    background-color: #f0f4ff;
}

/* ========================================
 *  EMPTY STATE — better UX when 0 products
 * ======================================== */
.wff-no-products {
    text-align: center;
    padding: 60px 20px;
}

.wff-no-products .woocommerce-info {
    background: none;
    border: none;
    color: var(--wff-muted);
    font-size: 15px;
    padding: 0;
    margin: 0 0 20px 0;
}

.wff-no-products .woocommerce-info::before {
    display: none;
}

.wff-empty-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--wff-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.wff-empty-reset:hover {
    background: #2554b7;
    color: #fff;
}

/* ========================================
 *  FILTER CONTAINER — structure
 * ======================================== */
.wff-filter-container {
    position: relative;
    padding: 0;
    margin-bottom: 30px;
}

.wff-filter-form-wrapper {
    position: relative;
    overflow: hidden;
}

.wff-filter-form-wrapper::before,
.wff-filter-form-wrapper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 28px;
    z-index: 50;
    pointer-events: none;
}

.wff-filter-form-wrapper::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.wff-filter-form-wrapper::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.wff-filter-container form {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 12px 0;
    scroll-behavior: smooth;
    position: relative;
}

/* --- Custom Minimal Scrollbar --- */
.wff-filter-container form::-webkit-scrollbar {
    width: 5px;
}
.wff-filter-container form::-webkit-scrollbar-track {
    background: transparent;
}
.wff-filter-container form::-webkit-scrollbar-thumb {
    background: var(--wff-scroll-thumb);
    border-radius: 10px;
}

/* --- Shared Active Filters (sidebar inside popup) --- */
.wff-active-filters {
    padding: 0 0 12px 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--wff-border-light);
}

.wff-active-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wff-active-title {
    font-weight: 700;
    font-size: 12px;
    color: var(--wff-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wff-clear-all-btn {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--wff-danger);
    background: #fff5f5;
    border: 1px solid #fecaca;
    padding: 4px 12px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.wff-clear-all-btn:hover {
    background: var(--wff-danger);
    color: #ffffff;
}

.wff-active-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.wff-active-tag {
    background: var(--wff-tag-bg);
    border: 1px solid var(--wff-tag-border);
    border-radius: 50px;
    padding: 4px 10px 4px 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    color: var(--wff-tag-text);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.wff-active-tag:hover {
    background: #dbeafe;
    border-color: #93b8f0;
    color: var(--wff-tag-text);
}

.wff-remove-tag {
    margin-left: 6px;
    font-weight: bold;
    color: #7daae6;
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s;
}

.wff-active-tag:hover .wff-remove-tag {
    color: var(--wff-tag-text);
}

/* ========================================
 *  FILTER GROUPS — sections with title + items
 * ======================================== */
.wff-filter-group {
    margin-bottom: 0;
    padding: 14px 8px 14px 8px;
    border-bottom: 1px solid var(--wff-border-light);
}

.wff-filter-group:first-child {
    padding-top: 6px;
}

.wff-filter-group:last-child {
    border-bottom: none;
    padding-bottom: 6px;
}

.wff-filter-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 10px 2px;
    color: var(--wff-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
 *  FILTER ITEMS — checkbox rows
 * ======================================== */
.wff-filter-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wff-filter-item {
    margin-bottom: 1px;
}

.wff-filter-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--wff-text);
    padding: 5px 8px 5px 6px;
    border-radius: var(--wff-radius);
    transition: background-color 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* Hover state */
.wff-filter-item label:hover {
    background-color: var(--wff-row-hover);
}

/* Checked / active row highlight */
.wff-filter-item label:has(input:checked) {
    background-color: var(--wff-row-active);
}

.wff-filter-item label:has(input:checked) .wff-term-name {
    color: var(--wff-primary);
    font-weight: 500;
}

.wff-filter-item label:has(input:checked) .wff-term-count {
    color: var(--wff-primary);
    opacity: 0.5;
}

.wff-filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--wff-primary);
    border-radius: 3px;
}

.wff-term-name {
    flex-grow: 1;
    line-height: 1.3;
}

/* Count — secondary, dimmed */
.wff-term-count {
    margin-left: 8px;
    color: var(--wff-dim);
    font-size: 12px;
    font-weight: 400;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ========================================
 *  SHOW MORE / SHOW LESS
 * ======================================== */
/* display:none is set via inline style by PHP; JS animates with inline opacity/transform */

button.wff-show-more-link {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 6px !important;
    margin: 4px 0 0 0 !important;
    color: var(--wff-primary) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    line-height: 1.2 !important;
    font-family: inherit !important;
    letter-spacing: normal !important;
    transition: color 0.2s, background-color 0.15s !important;
    border-radius: 4px !important;
}

button.wff-show-more-link:hover,
button.wff-show-more-link:focus,
button.wff-show-more-link:active {
    color: #2554b7 !important;
    background-color: var(--wff-primary-light) !important;
    text-decoration: none !important;
    outline: none !important;
}

/* ========================================
 *  COLOR PILL TAGS (pa_color)
 * ======================================== */
.wff-color-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.wff-color-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 50px;
    border: 1px solid var(--wff-pill-border);
    background: var(--wff-pill-bg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.2s ease;
    user-select: none;
}

.wff-color-pill:hover {
    border-color: var(--wff-primary);
    color: var(--wff-primary);
    background: #f0f7ff;
}

.wff-color-pill.wff-pill-active {
    background: var(--wff-pill-active-bg);
    border-color: var(--wff-pill-active-border);
    color: var(--wff-pill-active-text);
}

.wff-color-pill.wff-pill-active:hover {
    background: #2554b7;
    border-color: #2554b7;
    color: var(--wff-pill-active-text);
}

.wff-pill-checkbox {
    display: none !important;
}

.wff-pill-label {
    pointer-events: none;
}

/* Color dot swatch inside pills */
.wff-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

/* Active pill: soften dot border against blue bg */
.wff-color-pill.wff-pill-active .wff-color-dot {
    border-color: rgba(255, 255, 255, 0.3);
}

.wff-color-group .wff-term-count {
    display: none;
}

/* Label-style attribute groups: hide color dot (no swatch needed) */
.wff-label-group .wff-color-dot {
    display: none;
}

/* ========================================
 *  PRICE RANGE SLIDER (div-based, Pointer Events API)
 * ======================================== */

.wff-price-slider {
    position: relative;
    padding: 32px 10px 8px;
    margin: 4px 0 10px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    overflow: hidden; /* prevent label overflow from causing page horizontal scroll */
}

/* Floating price labels — sit above the track */
.wff-slider-labels {
    position: absolute;
    top: 4px;
    left: 10px;  /* align with track inside padding */
    right: 10px;
    height: 24px;
    pointer-events: none;
    overflow: visible; /* allow labels to center properly; slider clips them */
}

.wff-label-min,
.wff-label-max {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    background: var(--wff-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 6px 4px;
    border-radius: 4px;
    white-space: nowrap;
}

.wff-label-min::after,
.wff-label-max::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: var(--wff-primary);
    border-bottom: 0;
}

/* Track bar */
.wff-slider-track {
    position: relative;
    height: 4px;
    background: var(--wff-border);
    border-radius: 2px;
}

/* Blue fill between the two thumbs */
.wff-slider-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--wff-primary);
    border-radius: 2px;
    pointer-events: none;
}

/* Draggable thumb circles */
.wff-slider-thumb {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--wff-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    cursor: grab;
    touch-action: none;
    transition: box-shadow 0.15s, transform 0.1s;
    z-index: 2;
}

.wff-slider-thumb:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 108, 231, 0.18), 0 1px 4px rgba(0, 0, 0, 0.15);
}

.wff-slider-thumb.wff-dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.22);
    box-shadow: 0 0 0 6px rgba(59, 108, 231, 0.14), 0 1px 4px rgba(0, 0, 0, 0.15);
    z-index: 3;
    transition: none;
}

/* ========================================
 *  LOADING — subtle product grid fade
 * ======================================== */
.wff-loading ul.products {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

ul.products {
    transition: opacity 0.15s ease;
}

/* ========================================
 *  MOBILE FILTER POPUP  (bottom-sheet)
 * ======================================== */

/* Hidden on desktop */
.wff-filter-toggle,
.wff-popup-backdrop,
.wff-popup-header,
.wff-popup-footer {
    display: none;
}

@media (max-width: 768px) {

    /* ---- Toolbar compact on mobile ---- */
    .wff-toolbar {
        gap: 8px;
        margin: 0 0 8px 0;
    }

    .wff-toolbar-count {
        font-size: 13px;
    }

    .wff-toolbar-pills {
        margin: 0 0 12px 0;
        gap: 6px;
    }

    .wff-toolbar-sort {
        font-size: 12px;
        padding: 5px 24px 5px 8px;
        max-width: 140px;
        border-radius: 6px;
    }

    /* ---- Floating Filter Button (FAB) ---- */
    .wff-filter-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        position: fixed;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%) translateY(0);
        z-index: 999;
        padding: 10px 22px;
        background: var(--wff-text);
        color: #fff;
        border: none;
        border-radius: 50px;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.2px;
        text-transform: none;
        white-space: nowrap;
        cursor: pointer;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
                    box-shadow 0.2s ease,
                    background 0.2s ease,
                    opacity 0.35s ease;
    }

    /* FAB entrance — slide up from below */
    .wff-filter-toggle.wff-fab-enter {
        transform: translateX(-50%) translateY(80px);
        opacity: 0;
    }

    .wff-filter-toggle:active {
        transform: translateX(-50%) scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .wff-filter-toggle svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    /* FAB active state — filters applied */
    .wff-filter-toggle.wff-fab-active {
        background: var(--wff-primary);
    }

    /* Badge on FAB */
    .wff-fab-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 50px;
        background: #fff;
        color: var(--wff-primary);
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        margin-left: 2px;
    }

    .wff-fab-label {
        pointer-events: none;
    }

    /* Hide FAB when popup is open */
    body.wff-popup-open .wff-filter-toggle {
        display: none;
    }

    /* ---- Backdrop ---- */
    .wff-popup-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        -webkit-tap-highlight-color: transparent;
    }

    body.wff-popup-open .wff-popup-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* ---- Popup Container (bottom-sheet) ---- */
    .wff-filter-container {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: none !important;
        height: 92vh !important;
        height: 92dvh !important;
        z-index: 9999 !important;
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        -webkit-overflow-scrolling: touch;
    }

    body.wff-popup-open .wff-filter-container {
        transform: translateY(0);
    }

    /* Drag handle */
    .wff-filter-container::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    /* ---- Popup Header ---- */
    .wff-popup-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 16px 10px;
        border-bottom: 1px solid var(--wff-border);
        flex-shrink: 0;
        position: relative;
        overflow: hidden;
    }

    /* Animated progress bar under header during AJAX load */
    .wff-popup-loading .wff-popup-header::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 40%;
        height: 2px;
        background: var(--wff-primary);
        border-radius: 1px;
        animation: wff-progress 1s ease-in-out infinite;
    }

    @keyframes wff-progress {
        0%   { left: -40%; }
        100% { left: 100%; }
    }

    .wff-popup-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--wff-text);
    }

    .wff-popup-close-btn {
        font-size: 24px;
        line-height: 1;
        color: #9ca3af;
        background: none;
        border: none;
        padding: 2px 4px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .wff-popup-close-btn:active {
        color: var(--wff-text);
    }

    /* ---- Active Filters Bar inside popup (horizontal scroll) ---- */
    .wff-filter-container .wff-active-filters {
        flex-shrink: 0;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px;
        padding: 8px 16px !important;
        margin: 0 !important;
        border-bottom: 1px solid var(--wff-border) !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .wff-filter-container .wff-active-filters::-webkit-scrollbar {
        display: none;
    }

    .wff-filter-container .wff-active-top {
        display: contents !important;
    }

    .wff-filter-container .wff-active-title {
        display: none !important;
    }

    .wff-filter-container .wff-active-list {
        display: contents !important;
    }

    .wff-filter-container .wff-active-tag {
        flex-shrink: 0;
    }

    .wff-filter-container .wff-clear-all-btn {
        flex-shrink: 0;
        order: -1;
    }

    /* ---- Scrollable Filter Content ---- */
    .wff-filter-form-wrapper {
        flex: 1;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        -webkit-overflow-scrolling: touch;
    }

    .wff-filter-container form {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .wff-filter-form-wrapper::before,
    .wff-filter-form-wrapper::after {
        display: none !important;
    }

    /* ---- Tighter spacing for filter groups inside popup ---- */
    .wff-filter-container .wff-filter-group {
        margin-bottom: 0;
        padding: 14px 16px 12px;
        border-bottom: 1px solid var(--wff-border-light);
    }

    .wff-filter-container .wff-filter-group:first-child {
        padding-top: 14px;
    }

    .wff-filter-container .wff-filter-group:last-child {
        border-bottom: none;
    }

    .wff-filter-container .wff-filter-title {
        font-size: 13px;
        margin: 0 0 10px 0;
        letter-spacing: 0.5px;
    }

    .wff-filter-container .wff-filter-item label {
        font-size: 14px;
        padding: 6px 8px 6px 6px;
    }

    .wff-filter-container .wff-filter-item:last-child {
        margin-bottom: 0;
    }

    .wff-filter-container button.wff-show-more-link {
        margin: 4px 0 0 0 !important;
    }

    .wff-filter-container .wff-color-pills {
        gap: 6px;
        margin: 0;
    }

    /* ---- Popup Footer ---- */
    .wff-popup-footer {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 16px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--wff-border);
        background: #fff;
        flex-shrink: 0;
    }

    .wff-popup-footer .wff-popup-show-btn {
        flex: 1;
        padding: 9px 0;
        border: none;
        border-radius: 6px;
        background: var(--wff-primary);
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        text-transform: none !important;
        letter-spacing: normal;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.2s;
    }

    .wff-popup-footer .wff-popup-show-btn:active {
        background: #2554b7;
    }

    .wff-popup-footer .wff-popup-cancel-btn {
        padding: 9px 20px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        background: #fff;
        color: var(--wff-muted);
        font-size: 14px;
        font-weight: 500;
        text-transform: none !important;
        letter-spacing: normal;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        white-space: nowrap;
    }

    .wff-popup-footer .wff-popup-cancel-btn:active {
        background: #f9fafb;
    }

    /* ---- Body scroll lock ---- */
    body.wff-popup-open {
        overflow: hidden !important;
    }

    /* ---- Collapse sidebar widgets EXCEPT our filter container ---- */
    body.wff-has-popup #secondary .ast-woo-sidebar-widget:not(:has(.wff-filter-container)) {
        display: none !important;
    }

    body.wff-has-popup #secondary .ast-woo-sidebar-widget:has(.wff-filter-container) {
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body.wff-has-popup #secondary .sidebar-main,
    body.wff-has-popup #secondary .ast-filter-wrap {
        min-height: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    body.wff-has-popup #secondary {
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ---- Empty state on mobile ---- */
    .wff-no-products {
        padding: 40px 16px;
    }
}
