.nxff-panel,
.nxff-active-filters {
    --nxff-bg: #ffffff;
    --nxff-ink: #171717;
    --nxff-muted: #6b7280;
    --nxff-line: #e5e7eb;
    --nxff-soft: #f7f7f7;
    --nxff-accent: #111827;
    --nxff-radius: 4px;
    color: var(--nxff-ink);
    font: inherit;
    box-sizing: border-box;
}

.nxff-panel *,
.nxff-active-filters * {
    box-sizing: border-box;
}

.nxff-panel {
    position: relative;
    width: 100%;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.nxff-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 14px;
}


.nxff-panel-head:empty,
.nxff-search-status:empty,
.nxff-load-more-status:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

.nxff-form > :last-child {
    margin-bottom: 0;
}

.nxff-panel-head h2 {
    margin: 0;
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.nxff-mobile-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    border: 0;
    background: var(--nxff-accent);
    color: #fff;
    border-radius: 4px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.nxff-filter-icon {
    width: 16px;
    height: 12px;
    position: relative;
    display: inline-block;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.nxff-filter-icon::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    top: 3px;
    border-top: 2px solid currentColor;
}

.nxff-mobile-body {
    padding: 0;
}

.nxff-section {
    border-top: 1px solid var(--nxff-line);
}

.nxff-section-title,
.nxff-section-toggle {
    width: 100%;
    margin: 0;
    padding: 16px 0 12px;
    color: var(--nxff-ink);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-align: left;
}

.nxff-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.nxff-chevron {
    width: 9px;
    height: 9px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 180ms ease;
}

.nxff-section:not(.is-open) .nxff-chevron {
    transform: rotate(-45deg);
}

.nxff-section-body {
    padding-bottom: 16px;
}

.nxff-section:not(.is-open) .nxff-section-body {
    display: none;
}

.nxff-price-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 10px;
}

.nxff-price-row label {
    min-width: 0;
}

.nxff-price-row label > span {
    display: block;
    margin-bottom: 6px;
    color: var(--nxff-muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nxff-price-row input,
.nxff-term-search {
    width: 100%;
    min-height: 44px;
    margin: 0;
    border: 1px solid var(--nxff-line);
    border-radius: 4px;
    background: #fff;
    color: var(--nxff-ink);
    padding: 10px 12px;
    font: inherit;
    box-shadow: none;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.nxff-price-row input:focus,
.nxff-term-search:focus {
    border-color: #9ca3af;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.nxff-price-dash {
    padding-bottom: 12px;
    color: var(--nxff-muted);
}

.nxff-price-caption {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    color: var(--nxff-muted);
    font-size: 0.75rem;
}

.nxff-price-caption .woocommerce-Price-amount {
    color: inherit;
    font-size: inherit;
    font-weight: 600;
}

.nxff-term-search-wrap {
    position: relative;
    display: block;
    margin-bottom: 4px;
}

.nxff-term-search {
    padding-right: 40px;
}

.nxff-search-spinner {
    position: absolute;
    top: 50%;
    right: 13px;
    width: 15px;
    height: 15px;
    margin-top: -8px;
    border: 2px solid #d7d9dd;
    border-top-color: var(--nxff-accent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.nxff-section.is-term-searching .nxff-search-spinner {
    opacity: 1;
    animation: nxff-spin 650ms linear infinite;
}

.nxff-search-status {
    margin: 0 0 6px;
    color: var(--nxff-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.nxff-search-status:empty {
    display: none;
}

.nxff-section.is-term-searching .nxff-options {
    opacity: 0.58;
    pointer-events: none;
}

.nxff-section-hint {
    margin: -2px 0 8px;
    color: var(--nxff-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.nxff-options {
    display: grid;
    gap: 4px;
    max-height: 300px;
    overflow: auto;
    padding-right: 3px;
    scrollbar-width: thin;
}

.nxff-option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    margin: 0;
    padding: 6px 4px 6px calc(4px + var(--nxff-indent, 0px));
    border-radius: 3px;
    cursor: pointer;
    transition: background 140ms ease;
}

.nxff-option:hover {
    background: var(--nxff-soft);
}

.nxff-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nxff-check {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border: 1.5px solid #c4c7cc;
    border-radius: 3px;
    background: #fff;
    transition: all 140ms ease;
}

.nxff-check::after {
    content: "";
    width: 5px;
    height: 9px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(42deg) translate(-1px, -1px) scale(0);
    transition: transform 120ms ease;
}

.nxff-option input:checked + .nxff-check {
    border-color: var(--nxff-accent);
    background: var(--nxff-accent);
}

.nxff-option input:checked + .nxff-check::after {
    transform: rotate(42deg) translate(-1px, -1px) scale(1);
}

.nxff-option input:focus-visible + .nxff-check {
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.15);
}

.nxff-radio {
    border-radius: 50%;
}

.nxff-radio::after {
    width: 7px;
    height: 7px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    transform: scale(0);
}

.nxff-option input:checked + .nxff-radio::after {
    transform: scale(1);
}

.nxff-option-all {
    margin-bottom: 3px;
    border-bottom: 1px solid var(--nxff-line);
    border-radius: 0;
}

.nxff-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.91rem;
    line-height: 1.25;
}

.nxff-option-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.nxff-option-path {
    min-width: 0;
    overflow: hidden;
    color: var(--nxff-muted);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nxff-count {
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 3px;
    background: var(--nxff-soft);
    color: var(--nxff-muted);
    font-size: 0.72rem;
    text-align: center;
}

.nxff-no-options {
    margin: 10px 0 0;
    color: var(--nxff-muted);
    font-size: 0.85rem;
}

.nxff-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--nxff-line);
}

.nxff-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    flex: 1;
    border: 1px solid var(--nxff-accent);
    border-radius: 4px;
    background: var(--nxff-accent);
    color: #fff;
    padding: 11px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 140ms ease, opacity 140ms ease;
}

.nxff-submit:hover {
    opacity: 0.9;
}

.nxff-reset-link {
    color: var(--nxff-muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.nxff-reset-link:hover {
    color: var(--nxff-ink);
}

.nxff-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nxff-spin 650ms linear infinite;
}

.nxff-panel.is-loading .nxff-spinner {
    display: inline-block;
}

.nxff-panel.is-loading .nxff-submit,
.nxff-panel.is-loading .nxff-form {
    pointer-events: none;
}

.nxff-panel.is-loading .nxff-submit {
    opacity: 0.8;
}

.nxff-active-filters {
    margin: 0 0 16px;
}

.nxff-active-title {
    display: block;
    margin-bottom: 9px;
    font-size: 0.84rem;
}

.nxff-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.nxff-badge,
.nxff-clear-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.nxff-badge {
    border: 1px solid #dfe1e5;
    background: #fff;
    color: var(--nxff-ink);
}

.nxff-badge:hover {
    border-color: #b9bdc4;
    color: var(--nxff-ink);
}

.nxff-badge-x {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 2px;
    background: transparent;
    color: var(--nxff-muted);
    font-size: 14px;
    line-height: 1;
}

.nxff-clear-badge {
    color: var(--nxff-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nxff-layout-horizontal .nxff-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-items: start;
    gap: 0 22px;
}

.nxff-layout-horizontal .nxff-section {
    min-width: 0;
}

.nxff-layout-horizontal .nxff-actions {
    align-self: end;
    min-height: 82px;
}

.nxff-page-loading .woocommerce ul.products,
.nxff-page-loading .wc-block-product-template {
    opacity: 0.55;
    transition: opacity 160ms ease;
}

@keyframes nxff-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .nxff-panel {
        border-radius: 0;
    }

    .nxff-panel-head {
        padding: 0 0 12px;
    }

    .nxff-panel-head h2 {
        display: none;
    }

    .nxff-mobile-toggle {
        display: inline-flex;
        width: 100%;
        justify-content: space-between;
    }

    .nxff-mobile-body {
        display: none;
        padding: 0;
    }

    .nxff-panel.is-mobile-open .nxff-mobile-body {
        display: block;
    }

    .nxff-panel.is-mobile-always-open .nxff-mobile-body {
        display: block;
    }

    .nxff-panel.is-mobile-always-open .nxff-mobile-toggle {
        display: none;
    }

    .nxff-layout-horizontal .nxff-form {
        display: block;
    }

    .nxff-layout-horizontal .nxff-actions {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nxff-panel *,
    .nxff-page-loading * {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* AJAX pagination inside long facet lists. */
.nxff-load-more-status {
    min-height: 0;
    margin: 6px 0 0;
    color: var(--nxff-muted);
    font-size: 0.74rem;
    line-height: 1.35;
    text-align: center;
}

.nxff-load-more-status:empty {
    display: none;
}

.nxff-section.is-term-loading-more .nxff-load-more-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.nxff-section.is-term-loading-more .nxff-load-more-status::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #d7d9dd;
    border-top-color: var(--nxff-accent);
    border-radius: 50%;
    animation: nxff-spin 650ms linear infinite;
}


/* Category navigation mode: same neutral row styling without a fake checkbox column. */
.nxff-category-link {
    grid-template-columns: minmax(0, 1fr) auto;
    color: inherit;
    text-decoration: none;
}

.nxff-category-link:hover,
.nxff-category-link:focus {
    color: inherit;
    text-decoration: none;
}

/* 1.10: sticky action bar without the mobile white tail. */
.nxff-panel {
    overflow: clip;
}

.nxff-actions {
    position: sticky;
    z-index: 20;
    bottom: 0;
    margin: 0;
    padding: 14px 0;
    background: var(--nxff-bg);
    box-shadow: 0 -10px 18px rgba(255, 255, 255, .92);
}

@media (max-width: 767px) {
    .nxff-panel,
    .nxff-mobile-body,
    .nxff-form {
        min-height: 0;
    }

    .nxff-panel {
        overflow: clip;
    }

    .nxff-mobile-body,
    .nxff-form {
        overflow: visible;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .nxff-actions {
        bottom: 0;
        min-height: 0 !important;
        margin-bottom: 0 !important;
        padding: 12px 0 max(12px, env(safe-area-inset-bottom));
        background: var(--nxff-bg);
        box-shadow: 0 -12px 18px rgba(255, 255, 255, .95);
    }

    .nxff-form > .nxff-actions:last-child {
        margin-bottom: 0 !important;
    }
}
