.nm-product-filter {
    --nm-filter-border: #e5e7eb;
    --nm-filter-text: #111827;
    --nm-filter-muted: #6b7280;
    --nm-filter-soft: #f7f7f8;
    --nm-filter-green: #55a82f;
    --nm-filter-radius: 7px;
    display: grid;
    gap: 0;
    width: 100%;
    padding: 22px 16px 24px;
    border: 1px solid #edf0f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(17, 24, 39, .06);
    color: var(--nm-filter-text);
}

.nm-product-filter,
.nm-product-filter * {
    box-sizing: border-box;
}

.nm-product-filter__fields {
    display: grid;
    gap: 0;
}

.nm-product-filter--horizontal .nm-product-filter__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.nm-product-filter__group {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--nm-filter-border);
}

.nm-product-filter:not(.nm-product-filter--horizontal) .nm-product-filter__group:last-child {
    margin-bottom: 0;
}

.nm-product-filter__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0px 10px;
}

.nm-product-filter__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--nm-filter-green);
}

.nm-product-filter__header-icon svg {
    width: 22px;
    height: 22px;
}

.nm-product-filter__header strong {
    color: #18181b;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.nm-product-filter--horizontal .nm-product-filter__group {
    position: relative;
    padding: 0;
    border: none;
    background: #fff;
    margin: 0;
}

.nm-product-filter--horizontal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.nm-product-filter--horizontal .nm-product-filter__header {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--nm-filter-green);
    color: #fff;
}

.nm-product-filter--horizontal .nm-product-filter__header-icon,
.nm-product-filter--horizontal .nm-product-filter__header strong {
    color: inherit;
}

.nm-product-filter--horizontal .nm-product-filter__header strong {
    font-size: 14px;
    font-weight: 600;
}

.nm-product-filter--horizontal .nm-product-filter__fields {
    flex: 1;
}

.nm-product-filter--horizontal .nm-product-filter__group legend {
    min-height: 46px;
    margin: 0;
    padding: 0px 20px;
    gap: 15px;
    white-space: nowrap;
    border: 1px solid var(--nm-filter-border);
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
}

.nm-product-filter--horizontal .nm-product-filter__group legend i {
    width: 9px;
    height: 9px;
}

.nm-product-filter--horizontal .nm-product-filter__group.is-collapsed legend i {
    transform: rotate(45deg) translateY(-2px);
}

.nm-product-filter--horizontal .nm-product-filter__group:not(.is-collapsed) legend i {
    transform: rotate(225deg) translateY(-1px);
}

.nm-product-filter--horizontal .nm-product-filter__group:not(.is-collapsed) {
    border-color: var(--nm-filter-green);
    color: var(--nm-filter-green);
}

.nm-product-filter--horizontal .nm-product-filter__group:not(.is-collapsed) legend {
    color: var(--nm-filter-green);
}

.nm-product-filter--horizontal .nm-product-filter__group:not(.is-collapsed) legend i {
    border-color: var(--nm-filter-green);
}

.nm-product-filter--horizontal .nm-product-filter__horizontal-panel {
    position: absolute;
    z-index: 80;
    top: calc(100% + 10px);
    left: 0;
    min-width: 370px;
    max-width: min(92vw, 720px);
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(17, 24, 39, .16);
}

.nm-product-filter--horizontal .nm-product-filter__group.is-collapsed .nm-product-filter__horizontal-panel {
    display: none !important;
}

.nm-product-filter--horizontal .nm-product-filter__group--price .nm-product-filter__horizontal-panel {
    width: min(92vw, 520px);
}

.nm-product-filter--horizontal .nm-product-filter__group--taxonomy .nm-product-filter__horizontal-panel {
    width: min(92vw, 560px);
}

.nm-product-filter--horizontal .nm-product-filter__options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 360px;
    padding: 0;
    overflow: auto;
}

.nm-product-filter--horizontal .nm-product-filter__option {
    display: inline-flex;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #111827;
    font-size: 13px;
}

.nm-product-filter--horizontal .nm-product-filter__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nm-product-filter--horizontal .nm-product-filter__option:has(input:checked) {
    border-color: var(--nm-filter-green);
    background: color-mix(in srgb, var(--nm-filter-green) 10%, #fff);
    color: var(--nm-filter-green);
}

.nm-product-filter--horizontal .nm-product-filter__option em {
    color: inherit;
    opacity: .68;
}

.nm-product-filter--horizontal .nm-product-filter__price-inputs {
    margin-top: 18px;
}

.nm-product-filter--horizontal .nm-product-filter__actions {
    display: none;
}

.nm-product-filter__horizontal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.nm-product-filter__horizontal-close,
.nm-product-filter__horizontal-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.nm-product-filter__horizontal-close {
    min-width: 76px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
}

.nm-product-filter__horizontal-submit {
    flex: 1;
    border: 1px solid var(--nm-filter-green);
    background: var(--nm-filter-green);
    color: #fff;
}

.nm-product-filter__group legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    min-height: 52px;
    padding: 0 4px;
    color: #18181b;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}

.nm-product-filter:not(.nm-product-filter--horizontal) .nm-product-filter__group:not(.is-collapsed) {
    padding-bottom: 22px;
}

.nm-product-filter__group legend i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}

.nm-product-filter__group.is-collapsed legend {
    margin-bottom: 0;
}

.nm-product-filter:not(.nm-product-filter--horizontal) .nm-product-filter__group.is-collapsed legend {
    margin-bottom: 0;
}

.nm-product-filter__group.is-collapsed legend i {
    transform: rotate(-45deg) translateY(2px);
}

.nm-product-filter__group.is-collapsed > :not(legend) {
    display: none !important;
}

.nm-product-filter__options {
    display: grid;
    gap: 0;
    max-height: 250px;
    overflow: auto;
    padding: 0 10px 0 4px;
    scrollbar-color: #d9dde3 transparent;
    scrollbar-width: thin;
}

.nm-product-filter__options::-webkit-scrollbar {
    width: 5px;
}

.nm-product-filter__options::-webkit-scrollbar-track {
    background: transparent;
}

.nm-product-filter__options::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #d9dde3;
}

.nm-product-filter__option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 34px;
    color: #333;
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
}

.nm-product-filter__option input {
    appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid #e5e7eb;
    border-radius: 7px;
    background: #fff;
    box-shadow: inset 0 0 0 3px #fff;
    padding: 0;
}

.nm-product-filter__option input:checked {
    border-color: var(--nm-filter-green);
    background: var(--nm-filter-green);
}

.nm-product-filter__option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nm-product-filter__option em {
    color: #6b7280;
    font-size: 12px;
    font-style: normal;
}

.nm-product-filter__option--switch {
    grid-template-columns: auto 1fr;
}

.nm-product-filter select,
.nm-product-filter input[type="number"],
.nm-product-filter input[data-price-input],
.nm-product-filter input[type="search"] {
    width: 100%;
    height: 42px;
    border: 1px solid var(--nm-filter-border);
    border-radius: var(--nm-filter-radius);
    background: #fff;
    color: var(--nm-filter-text);
    font-size: 14px;
}

.nm-product-filter select {
    padding: 8px 10px;
}

.nm-product-filter select[multiple] {
    min-height: 120px;
}

.nm-product-filter input[type="number"],
.nm-product-filter input[data-price-input],
.nm-product-filter input[type="search"] {
    padding: 8px 11px;
}

.nm-product-filter__price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 4px;
}

.nm-product-filter__price-inputs label {
    display: grid;
    gap: 5px;
}

.nm-product-filter__price-inputs span {
    color: #18181b;
    font-size: 13px;
    font-weight: 600;
}

.nm-product-filter__price-inputs input {
    min-height: 32px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 600;
}

.nm-product-filter__price-inputs label:last-child {
    text-align: right;
}

.nm-product-filter__price-slider {
    position: relative;
    height: 30px;
    margin: 8px 4px 0;
}

.nm-product-filter__price-track,
.nm-product-filter__price-range {
    position: absolute;
    top: 9px;
    height: 4px;
    border-radius: 999px;
}

.nm-product-filter__price-track {
    left: 0;
    right: 0;
    background: #ebebeb;
    box-shadow: inset 0 1px 1px rgba(17, 24, 39, .08);
}

.nm-product-filter__price-range {
    left: 0;
    right: 0;
    background: #00000066;
}

.nm-product-filter__price-range-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
    appearance: none;
}

.nm-product-filter__price-range-input::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--nm-filter-green);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(17, 24, 39, .16);
}

.nm-product-filter__price-range-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 2px solid var(--nm-filter-green);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(17, 24, 39, .16);
}

.nm-product-filter__price-range-input::-webkit-slider-runnable-track {
    height: 30px;
    background: transparent;
}

.nm-product-filter__price-range-input::-moz-range-track {
    height: 30px;
    background: transparent;
}

.nm-product-filter__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nm-product-filter__chips a,
.nm-product-filter-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--nm-filter-border);
    border-radius: 999px;
    background: var(--nm-filter-soft);
    color: var(--nm-filter-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
}

.nm-product-filter__chips a:hover,
.nm-product-filter-active-tag:hover,
.nm-product-filter-active-reset:hover {
    color: var(--nm-filter-text);
    opacity: .82;
}

.nm-product-filter__chips a span,
.nm-product-filter-active-tag__label {
    color: var(--nm-filter-muted);
    font-weight: 500;
}

.nm-product-filter__chips a b,
.nm-product-filter-active-tag b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.nm-product-filter__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 0;
    margin-top: 20px;
}

.nm-product-filter__submit,
.nm-product-filter__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: var(--nm-filter-radius);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.nm-product-filter__submit {
    border: 1px solid var(--nm-filter-green);
    background: var(--nm-filter-green);
    color: #fff;
    cursor: pointer;
}

.nm-product-filter__reset {
    border: 1px solid var(--nm-filter-border);
    background: #fff;
    color: var(--nm-filter-text);
}

.nm-product-filter__submit:hover,
.nm-product-filter__reset:hover {
    opacity: .88;
}

.nm-product-filter-active-target {
    --nm-filter-border: #e5e7eb;
    --nm-filter-text: #111827;
    --nm-filter-muted: #6b7280;
    --nm-filter-soft: #f7f7f8;
    --nm-filter-green: #55a82f;
    --nm-filter-active-tag-bg: #e4f4d8;
    --nm-filter-active-tag-color: #4d842a;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 14px;
}

.nm-product-filter-active-target[hidden] {
    display: none !important;
}

.nm-product-filter-active-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nm-product-filter-active-tag {
    min-height: 30px;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    background: var(--nm-filter-active-tag-bg, #e4f4d8);
    color: var(--nm-filter-active-tag-color, #4d842a);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

.nm-product-filter-active-tag:hover {
    color: var(--nm-filter-active-tag-color, #4d842a);
    opacity: .9;
}

.nm-product-filter-active-tag .nm-product-filter-active-tag__label {
    color: inherit;
    font-weight: inherit;
}

.nm-product-filter-active-tag b {
    width: 16px;
    height: 16px;
    margin-left: 2px;
    background: transparent;
    color: var(--nm-filter-active-tag-color, #4d842a);
}

.nm-product-filter-active-tag b svg {
    display: block;
    width: 16px;
    height: 16px;
}

.nm-product-filter-active-reset {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fff;
    color: #111827;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.nm-product-filter-active-reset:hover {
    color: #111827;
    border-color: #d1d5db;
}

.nm-product-filter-toolbar {
    --nm-filter-border: #e5e7eb;
    --nm-filter-text: #111827;
    --nm-filter-muted: #6b7280;
    --nm-filter-green: #55a82f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 0 14px;
    color: var(--nm-filter-text);
}

.nm-product-filter-toolbar[hidden] {
    display: none !important;
}

.nm-product-filter-toolbar__count {
    color: var(--nm-filter-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
}

.nm-product-filter-toolbar__right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.nm-product-filter-view-switch {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    min-height: 38px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.nm-product-filter-view-switch__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #6b7280;
}

.nm-product-filter-view-switch__item + .nm-product-filter-view-switch__item {
    border-left: 1px solid #e5e7eb;
}

.nm-product-filter-view-switch__item.is-active {
    background: var(--nm-filter-green, #55a82f);
    color: #fff;
}

.nm-product-filter-toolbar__sort {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.nm-product-filter-toolbar__sort span {
    color: var(--nm-filter-muted);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

.nm-product-filter-toolbar__sort select {
    min-width: 156px;
    height: 42px;
    padding: 0px 36px 0px 14px;
    border: 1px solid var(--nm-filter-border);
    border-radius: 9px;
    background-color: #fff;
    color: var(--nm-filter-text);
    font-size: 14px;
    font-weight: 400;
}

.nm-product-filter-list-positioned {
    position: relative !important;
}

.nm-product-filter-list-is-loading {
    min-height: 160px;
}

.nm-product-filter-loading-overlay {
    position: absolute;
    z-index: 50;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 160px;
    padding: min(28vh, 220px) 16px 32px;
    border-radius: inherit;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(2px);
}

.nm-product-filter-loading-badge {
    position: sticky;
    top: calc(50vh - 22px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 999px;
    background: #fff;
    color: var(--nm-filter-text, #111827);
    box-shadow: 0 10px 30px rgba(17, 24, 39, .14);
    animation: nmProductFilterLoadingFloat 1.4s ease-in-out infinite;
}

.nm-product-filter-loading-badge i {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(17, 24, 39, .14);
    border-top-color: var(--nm-filter-green, #55a82f);
    border-radius: 999px;
    animation: nmProductFilterSpin .72s linear infinite;
}

.nm-product-filter-loading-badge b {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

@keyframes nmProductFilterSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes nmProductFilterLoadingFloat {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@media (max-width: 767px) {
    .nm-product-filter--horizontal .nm-product-filter__fields,
    .nm-product-filter__price-inputs {
        grid-template-columns: 1fr;
    }

    .nm-product-filter-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .nm-product-filter-toolbar__sort {
        justify-content: space-between;
        width: 100%;
    }

    .nm-product-filter-toolbar__sort select {
        min-width: 0;
        flex: 1;
    }
}
