.topd-product-filter {
    width: 100%;
    margin-bottom: 24px;
    font-family: var(--e-global-typography-text-font-family, sans-serif);
}

.topd-product-filter *,
.topd-product-filter *::before,
.topd-product-filter *::after {
    box-sizing: border-box;
}

.topd-product-filter button,
.topd-product-filter input {
    font-family: inherit;
}

.topd-product-filter-enabled .woocommerce-ordering {
    display: none !important;
}

.topd-product-filter__mobile-bar,
.topd-product-filter__backdrop,
.topd-product-filter__panel-header,
.topd-product-filter__panel-footer {
    display: none;
}

.topd-product-filter__panel {
    width: 100%;
}

.topd-product-filter__items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.topd-product-filter__item {
    position: relative;
}

.topd-product-filter__trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #ffffff;
    background: #26262e;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.topd-product-filter__trigger::-webkit-details-marker {
    display: none;
}

.topd-product-filter__trigger:hover,
.topd-product-filter__item[open] .topd-product-filter__trigger,
.topd-product-filter__item.is-active .topd-product-filter__trigger {
    border-color: rgba(255, 255, 255, 0.28);
    background: #30303a;
}

.topd-product-filter__selected-count,
.topd-product-filter__mobile-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffffff;
    color: #202027;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.topd-product-filter__chevron,
.topd-product-filter__mobile-chevron {
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.topd-product-filter__item[open]
.topd-product-filter__chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.topd-product-filter__dropdown {
    position: absolute;
    z-index: 50;
    top: calc(100% + 10px);
    left: 0;
    width: 340px;
    max-width: calc(100vw - 32px);
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: #202027;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.topd-product-filter__dropdown--sorting,
.topd-product-filter__dropdown--stock {
    width: 280px;
}

.topd-product-filter__dropdown--price {
    width: 380px;
}

.topd-product-filter__options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.topd-product-filter__option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 8px;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
}

.topd-product-filter__option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.topd-product-filter__option input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--e-global-color-accent);
}

.topd-product-filter__option-label {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.35;
}

.topd-product-filter__option-count {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
}

.topd-product-filter__price-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.topd-product-filter__price-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    font-weight: 600;
}

.topd-product-filter__price-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.65);
}

.topd-product-filter__price-input-wrap:focus-within {
    border-color: rgba(255, 255, 255, 0.32);
}

.topd-product-filter__price-input-wrap input {
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.topd-product-filter__price-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.topd-product-filter__price-slider {
    --topd-price-start: 0%;
    --topd-price-end: 100%;
    position: relative;
    height: 34px;
    margin: 16px 4px 4px;
}

.topd-product-filter__price-track {
    position: absolute;
    top: 15px;
    right: 0;
    left: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.16) 0,
        rgba(255, 255, 255, 0.16) var(--topd-price-start),
        #ffffff var(--topd-price-start),
        #ffffff var(--topd-price-end),
        rgba(255, 255, 255, 0.16) var(--topd-price-end),
        rgba(255, 255, 255, 0.16) 100%
    );
}

.topd-product-filter__price-slider input[type="range"] {
    position: absolute;
    top: 5px;
    left: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    padding: 0;
    pointer-events: none;
    appearance: none;
    background: transparent;
}

.topd-product-filter__price-slider input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 3px solid #202027;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
    cursor: pointer;
    pointer-events: auto;
    appearance: none;
}

.topd-product-filter__price-slider input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 3px solid #202027;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
    cursor: pointer;
    pointer-events: auto;
}

.topd-product-filter__price-slider input[type="range"]::-moz-range-track {
    background: transparent;
}

.topd-product-filter__dropdown-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.topd-product-filter__reset-one,
.topd-product-filter__reset-all {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.topd-product-filter__reset-one:hover,
.topd-product-filter__reset-all:hover {
    color: #ffffff;
}

.topd-product-filter__apply {
    min-height: 38px;
    padding: 8px 15px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #202027;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.topd-product-filter__apply:hover {
    background: var( --e-global-color-d6c7830 );
}

.topd-product-filter__reset-all {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 12px;
    color: #000;
}

.topd-product-filter__reset-all:hover{
    background: var( --e-global-color-d6c7830 );
}

@media (max-width: 1024px) {
    body.topd-product-filter-lock {
        overflow: hidden;
        touch-action: none;
    }

    .topd-product-filter {
        margin-bottom: 20px;
    }

    .topd-product-filter__mobile-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
        gap: 10px;
        width: 100%;
    }

    .topd-product-filter__mobile-button {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        min-width: 0;
        min-height: 48px;
        padding: 10px 14px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 10px;
        background: #26262e;
        color: #ffffff;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.2;
        cursor: pointer;
    }

    .topd-product-filter__mobile-button:hover,
    .topd-product-filter__mobile-button[aria-expanded="true"] {
        border-color: rgba(255, 255, 255, 0.3);
        background: #30303a;
    }

    .topd-product-filter__mobile-button--sorting {
        justify-content: flex-start;
    }

    .topd-product-filter__mobile-icon {
        flex: 0 0 auto;
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .topd-product-filter__mobile-button-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topd-product-filter__mobile-count {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .topd-product-filter__mobile-chevron {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .topd-product-filter__backdrop {
        display: block;
        position: fixed;
        z-index: 999990;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.62);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        cursor: default;
        transition:
            opacity 0.25s ease,
            visibility 0s linear 0.25s;
    }

    .topd-product-filter__panel {
        position: fixed;
        z-index: 999991;
        top: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        width: min(440px, 100vw);
        height: 100vh;
        height: 100dvh;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        background: #202027;
        box-shadow: -24px 0 60px rgba(0, 0, 0, 0.38);
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition:
            transform 0.28s ease,
            visibility 0s linear 0.28s;
    }

    .topd-product-filter.is-mobile-open
    .topd-product-filter__backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .topd-product-filter.is-mobile-open
    .topd-product-filter__panel {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .topd-product-filter__panel-header {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        min-height: 66px;
        padding:
            max(14px, env(safe-area-inset-top))
            18px
            14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: #202027;
    }

    .topd-product-filter__panel-title {
        margin: 0;
        color: #ffffff;
        font-family: inherit;
        font-size: 21px;
        font-weight: 700;
        line-height: 1.2;
    }

    .topd-product-filter__panel-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        color: #ffffff;
        cursor: pointer;
    }

    .topd-product-filter__panel-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .topd-product-filter__panel-close svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .topd-product-filter__items {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        align-items: stretch;
        min-height: 0;
        padding: 4px 18px 24px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .topd-product-filter__item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    }

    .topd-product-filter__trigger {
        justify-content: flex-start;
        width: 100%;
        min-height: 58px;
        padding: 15px 2px;
        border: 0;
        border-radius: 0;
        background: transparent;
        font-size: 16px;
        white-space: normal;
    }

    .topd-product-filter__trigger:hover,
    .topd-product-filter__item[open] .topd-product-filter__trigger,
    .topd-product-filter__item.is-active .topd-product-filter__trigger {
        border-color: transparent;
        background: transparent;
    }

    .topd-product-filter__trigger > :first-child {
        min-width: 0;
        margin-right: auto;
    }

    .topd-product-filter__chevron {
        flex: 0 0 auto;
        margin-right: 5px;
        margin-left: 7px;
    }

    .topd-product-filter__dropdown,
    .topd-product-filter__dropdown--sorting,
    .topd-product-filter__dropdown--stock,
    .topd-product-filter__dropdown--price {
        position: static;
        width: 100%;
        max-width: none;
        padding: 0 0 16px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .topd-product-filter__options {
        gap: 3px;
        max-height: none;
        overflow: visible;
    }

    .topd-product-filter__option {
        min-height: 46px;
        padding: 9px 4px;
        border-radius: 8px;
    }

    .topd-product-filter__option-label {
        font-size: 15px;
    }

    .topd-product-filter__option-count {
        font-size: 13px;
    }

    .topd-product-filter__price-fields {
        padding-top: 2px;
    }

    .topd-product-filter__price-slider {
        margin-top: 18px;
    }

    .topd-product-filter__dropdown-footer,
    .topd-product-filter__reset-all {
        display: none;
    }

    .topd-product-filter__panel-footer {
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        flex: 0 0 auto;
        gap: 10px;
        padding:
            14px
            18px
            max(14px, env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: #202027;
        box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.16);
    }

    .topd-product-filter__panel-reset,
    .topd-product-filter__panel-apply {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 11px 14px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
    }

    .topd-product-filter__panel-reset {
        border: 1px solid rgba(255, 255, 255, 0.16);
        background: transparent;
        color: #ffffff;
    }

    .topd-product-filter__panel-reset:hover {
        border-color: rgba(255, 255, 255, 0.32);
        color: #ffffff;
    }

    .topd-product-filter__panel-reset.is-disabled {
        opacity: 0.38;
        pointer-events: none;
    }

    .topd-product-filter__panel-apply {
        border: 0;
        background: #ffffff;
        color: #202027;
        cursor: pointer;
    }

    .topd-product-filter__panel-apply:hover {
        opacity: 0.9;
    }

    .topd-product-filter[data-topd-mobile-mode="filters"]
    .topd-product-filter__item--sorting {
        display: none;
    }

    .topd-product-filter[data-topd-mobile-mode="sorting"]
    .topd-product-filter__item:not(.topd-product-filter__item--sorting) {
        display: none;
    }

    .topd-product-filter[data-topd-mobile-mode="sorting"]
    .topd-product-filter__item--sorting {
        border-bottom: 0;
    }

    .topd-product-filter[data-topd-mobile-mode="sorting"]
    .topd-product-filter__item--sorting
    > .topd-product-filter__trigger {
        display: none;
    }

    .topd-product-filter[data-topd-mobile-mode="sorting"]
    .topd-product-filter__item--sorting
    > .topd-product-filter__dropdown {
        display: block;
        padding-top: 10px;
    }

    .topd-product-filter[data-topd-mobile-mode="sorting"]
    .topd-product-filter__panel-footer {
        grid-template-columns: 1fr;
    }

    .topd-product-filter[data-topd-mobile-mode="sorting"]
    .topd-product-filter__panel-reset {
        display: none;
    }
}

@media (max-width: 520px) {
    .topd-product-filter__mobile-bar {
        gap: 8px;
    }

    .topd-product-filter__mobile-button {
        min-height: 46px;
        padding: 9px 11px;
        font-size: 14px;
    }

    .topd-product-filter__mobile-icon {
        width: 20px;
        height: 20px;
    }

    .topd-product-filter__panel {
        width: 100vw;
        border-left: 0;
    }

    .topd-product-filter__panel-header,
    .topd-product-filter__items,
    .topd-product-filter__panel-footer {
        padding-right: 14px;
        padding-left: 14px;
    }

    .topd-product-filter__price-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
