/* Price Filter Component */
.filter-field-price {
    position: relative;
    z-index: 100000 !important;
    isolation: isolate;
}

.price-filter-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    min-width: 350px;
    width: max-content;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100001 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    isolation: isolate;
}

.filter-field-price.active .price-filter-dropdown {
    pointer-events: auto;
}

.filter-field-price.active .price-filter-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.price-filter-component {
    position: relative;
    width: 100%;
    min-width: 280px;
}

/* Price Filter Tabs */
.price-filter-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: rgba(53, 51, 49, 0.1);
    border-radius: 5px;
    padding: 2px;
}

.price-filter-tab {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #353331;
    font-family: "Commissioner", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.04em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.price-filter-tab.active {
    background: #353331;
    color: #ffffff;
    font-weight: 500;
}

.price-filter-tab:hover:not(.active) {
    opacity: 0.7;
}

/* Price Values Display */
.price-filter-values {
    margin-bottom: 20px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.price-filter-value {
    font-family: "Commissioner", sans-serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #353331;
}

.price-value-min,
.price-value-max {
    display: inline-block;
}

.price-value-separator {
    display: inline-block;
    margin: 0 5px;
    opacity: 0.7;
}

/* Slider Wrapper */
.price-filter-slider-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.price-filter-slider-container {
    position: relative;
    height: 4px;
    background: rgba(53, 51, 49, 0.2);
    border-radius: 2px;
}

.price-filter-slider {
    position: absolute;
    width: 100%;
    height: 4px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
    cursor: pointer;
    margin: 0;
    padding: 0;
    /* Важное: клики и перетаскивания обрабатываются только по кружкам (thumb),
       чтобы верхний слайдер не перекрывал нижний */
    pointer-events: none;
}

.price-filter-slider-min {
    z-index: 3;
}

.price-filter-slider-max {
    z-index: 4;
}

/* Увеличиваем область клика для слайдеров */
.price-filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #353331;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
    position: relative;
    z-index: 5;
    /* Клики и перетаскивания идут по самому кружку */
    pointer-events: auto;
    /* Поднимаем кружок над дорожкой примерно на полвысоты */
    margin-top: -18px;
}

.price-filter-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.3);
}

.price-filter-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #353331;
    border-radius: 50%;
    cursor: grab;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
    pointer-events: auto;
    /* Аналогично WebKit поднимаем кружок */
    margin-top: -10px;
}

.price-filter-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.3);
}


.price-filter-slider-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #353331;
    border-radius: 2px;
    z-index: 1;
    pointer-events: none;
}

/* Hidden inputs */
.price-filter-input-min,
.price-filter-input-max,
.price-filter-input-type {
    display: none;
}

/* Адаптив */
@media (max-width: 991px) {
    .price-filter-component {
        min-width: 100%;
        padding: 15px;
    }
    
    .price-filter-value {
        font-size: 20px;
    }
    
    .price-filter-tab {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 575px) {
    .price-filter-dropdown {
        left: 0;
        right: 0;
        min-width: 100%;
        width: 100%;
        padding: 16px 12px;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
    }

    .price-filter-component {
        padding: 12px 4px;
        min-width: 100%;
    }
    
    .price-filter-value {
        font-size: 16px;
    }
    
    .price-filter-tabs {
        margin-bottom: 12px;
    }

    .price-filter-slider-wrapper {
        margin-bottom: 6px;
    }

    /* На мобиле сдвигаем кружки по горизонтали:
       левый — левее дорожки, правый — правее на ширину кружка */
    .price-filter-slider-min::-webkit-slider-thumb {
        transform: translateX(-10px);
    }
    .price-filter-slider-min::-webkit-slider-thumb:active {
        transform: translateX(-10px) scale(1.3);
    }
    .price-filter-slider-max::-webkit-slider-thumb {
        transform: translateX(10px);
    }
    .price-filter-slider-max::-webkit-slider-thumb:active {
        transform: translateX(10px) scale(1.3);
    }

    .price-filter-slider-min::-moz-range-thumb {
        transform: translateX(-10px);
    }
    .price-filter-slider-min::-moz-range-thumb:active {
        transform: translateX(-10px) scale(1.3);
    }
    .price-filter-slider-max::-moz-range-thumb {
        transform: translateX(10px);
    }
    .price-filter-slider-max::-moz-range-thumb:active {
        transform: translateX(10px) scale(1.3);
    }
}

