/* Filter system styles */
:root {
    --voltride-filter-track: rgba(15, 63, 54, 0.2);
    --voltride-filter-fill: #0f3f36;
    --voltride-filter-handle: #0f3f36;
    --voltride-filter-handle-text: #d8ffb4;
}

/* Force all filters to be full width - each on new row */
.wd-product-filters {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 15px !important;
}

.wd-product-filters .wd-col {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

/* Voltride Filter Containers - Prevent overlapping */
.voltride-filter--meta-range,
.voltride-filter-toggle,
.voltride-filter-ip-class,
.wd-pf-price-range,
.wd-pf-attributes {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 20px !important;
    padding-bottom: 5px !important;
    position: relative !important;
    z-index: auto !important;
    clear: both !important;
}

/* IP-Class filter needs more bottom space */
.voltride-filter-ip-class {
    margin-bottom: 25px !important;
    padding-bottom: 10px !important;
}

/* Filter button needs higher z-index */
.wd-pf-btn {
    position: relative !important;
    z-index: 10 !important;
    margin-top: 10px !important;
}

/* ============================================
   VOLTRIDE META RANGE FILTERS
   ============================================ */

/* Container */
.voltride-filter--meta-range {
    background: transparent;
    padding: 0;
    margin-bottom: 24px;
}

/* Force filter to always be open and interactive */
.voltride-filter--meta-range.wd-event-click .voltride-filter__dropdown {
    pointer-events: auto !important;
}

.voltride-filter--meta-range .voltride-filter__slider,
.voltride-filter--meta-range .voltride-filter__handle {
    pointer-events: auto !important;
}

/* Dropdown */
.voltride-filter--meta-range .voltride-filter__dropdown {
    position: static;
    display: block;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin-top: 12px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

/* Title */
.voltride-filter--meta-range .wd-pf-title.voltride-filter__title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    height: auto;
    border: none;
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
    min-height: 24px;
}

/* Hide the dropdown arrow icon */
.voltride-filter--meta-range .wd-pf-title:after {
    display: none !important;
}

.voltride-filter--meta-range .voltride-filter__title-text {
    text-transform: none !important;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1.2;
    color: var(--new-green, #0f3f36);
    flex-shrink: 0;
    min-width: fit-content;
}

/* Slider wrapper */
.voltride-filter--meta-range .voltride-filter__slider-wrapper {
    padding: 0 20px;
    margin-top: 16px;
    margin-bottom: 0;
}

.voltride-filter--meta-range .voltride-filter__slider-wrapper .price_slider_widget {
    margin-bottom: 0 !important;
}

/* Selected values (results) */
.voltride-filter--meta-range .voltride-filter__results {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-shrink: 1;
    min-width: 0;
    max-width: 60%;
    overflow: hidden;
}

.voltride-filter--meta-range .voltride-filter__results .selected-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--voltride-filter-fill);
    color: white;
    font-size: 10px;
    font-weight: 400;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.voltride-filter--meta-range .voltride-filter__results .selected-value:hover {
    background: color-mix(in srgb, var(--voltride-filter-fill) 85%, black 15%);
}

/* Add X icon after the selected value */
.voltride-filter--meta-range .voltride-filter__results .selected-value:after {
    content: "×";
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    margin-left: 0;
    opacity: 0.8;
    flex-shrink: 0;
}

.voltride-filter--meta-range .voltride-filter__results .selected-value:hover:after {
    opacity: 1;
}

/* Hide label (we show values in handles) */
.voltride-filter--meta-range .voltride-filter__label {
    display: none !important;
}

/* Slider track */
.voltride-filter--meta-range .voltride-filter__slider {
    height: 3px !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: var(--voltride-filter-track) !important;
    position: relative !important;
    z-index: 1 !important;
    cursor: pointer !important;
}

.voltride-filter--meta-range .voltride-filter__slider:before {
    display: none !important;
}

/* Slider range (filled portion) */
.voltride-filter--meta-range .voltride-filter__range {
    background: var(--voltride-filter-fill) !important;
    background-image: none !important;
    border-radius: 4px !important;
    height: 3px !important;
    margin-top: 0 !important;
}

/* Slider handles (pills) */
.voltride-filter--meta-range .voltride-filter__handle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    height: 20px !important;
    width: auto !important;
    min-width: 40px !important;
    padding: 4px 10px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 24px !important;
    background: var(--voltride-filter-handle) !important;
    z-index: 10 !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: -webkit-grab !important;
    cursor: grab !important;
}

.voltride-filter--meta-range .voltride-filter__handle:hover,
.voltride-filter--meta-range .voltride-filter__handle:focus {
    box-shadow: 0 3px 12px rgba(15, 63, 54, 0.25) !important;
    outline: none !important;
    cursor: -webkit-grab !important;
    cursor: grab !important;
}

.voltride-filter--meta-range .voltride-filter__handle:active {
    box-shadow: 0 4px 16px rgba(15, 63, 54, 0.35) !important;
    cursor: -webkit-grabbing !important;
    cursor: grabbing !important;
}

.voltride-filter--meta-range .voltride-filter__handle:after {
    display: none !important;
    content: none !important;
}

/* Handle value text */
.voltride-filter--meta-range .voltride-filter__handle-value {
    display: inline-block !important;
    color: white !important;
    font-family: Biryani, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* ============================================
   PRICE RANGE FILTER (WooCommerce default)
   ============================================ */

.wd-pf-price-range .ui-slider {
    height: 6px;
    border-radius: 4px;
    background: var(--voltride-filter-track);
}

.wd-pf-price-range .ui-slider .ui-slider-range {
    background: var(--voltride-filter-fill);
    border-radius: 4px;
}

.wd-pf-price-range .ui-slider .ui-slider-handle {
    width: 20px;
    height: 20px;
    border-radius: 50% !important;
    margin-top: -7px;
    background: var(--voltride-filter-handle);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 63, 54, 0.15);
    cursor: pointer;
}

.wd-pf-price-range .ui-slider .ui-slider-handle:hover,
.wd-pf-price-range .ui-slider .ui-slider-handle:focus {
    box-shadow: 0 3px 12px rgba(15, 63, 54, 0.25);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .voltride-filter--meta-range .wd-pf-title.voltride-filter__title {
        gap: 6px;
    }

    .voltride-filter--meta-range .voltride-filter__title-text {
        font-size: 13px !important;
    }

    .voltride-filter--meta-range .voltride-filter__results {
        max-width: 55%;
    }

    .voltride-filter--meta-range .voltride-filter__results .selected-value {
        font-size: 9px;
        padding: 2px 6px;
        gap: 3px;
    }

    .voltride-filter--meta-range .voltride-filter__results .selected-value:after {
        font-size: 12px;
    }

    .voltride-filter--meta-range .voltride-filter__slider-wrapper {
        padding: 0 15px;
        margin-top: 12px;
    }

    .voltride-filter--meta-range .voltride-filter__handle {
        height: 22px !important;
        min-width: 40px;
        padding: 3px 8px !important;
    }

    .voltride-filter--meta-range .voltride-filter__handle-value {
        font-size: 11px !important;
    }
}
