/* 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;
}

/* Toggle filters need tighter spacing */
.wd-pf-checkboxes.wd-col.voltride-filter-toggle {
    margin-bottom: 6px !important;
}

/* Filter button needs higher z-index */
.wd-pf-btn {
    position: relative !important;
    z-index: auto !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: #FF6082;
}

/* Add X icon after the selected value */
.voltride-filter--meta-range .voltride-filter__results .selected-value:after {
    content: "×";
    display: none;
    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 + BRAND FILTERS (Scoped to .wd-product-filters)
   ============================================ */


    .wd-product-filters .wd-pf-results li::after {
        content: none;
        display: none;
    }

    .wd-product-filters .wd-pf-price-range .wd-pf-title,
    .wd-product-filters .wd-pf-attributes .wd-pf-title {
        border: 0;
        background: transparent;
        padding: 0;
        height: auto;
        min-height: 24px;
    }

    .wd-product-filters .wd-pf-price-range .wd-pf-title:after,
    .wd-product-filters .wd-pf-attributes .wd-pf-title:after {
        display: none;
    }

    .wd-product-filters .wd-pf-price-range .wd-pf-title .title-text,
    .wd-product-filters .wd-pf-attributes .wd-pf-title .title-text {
        text-transform: none;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.2;
        color: var(--new-green, #0f3f36);
    }

    .wd-product-filters .wd-pf-price-range .wd-pf-title:focus,
    .wd-product-filters .wd-pf-price-range .wd-pf-title:focus-visible {
        outline: none;
    }

    .wd-product-filters .wd-pf-price-range .wd-pf-dropdown,
    .wd-product-filters .wd-pf-attributes .wd-pf-dropdown {
        position: static;
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-top: 12px;
        overflow: visible;
    }

    .wd-product-filters .wd-pf-price-range .price_slider_wrapper {
        padding: 0 20px;
    }

    .wd-product-filters .wd-pf-attributes .wd-pf-dropdown .wd-scroll {
        border-radius: 0;
        overflow: visible;
        max-height: none;
    }

    .wd-product-filters .wd-pf-attributes .wd-scroll-content {
        overflow: visible;
        max-height: none;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        padding: 0;
        margin: 0;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands li {
        list-style: none;
        margin: 0;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .pf-value {
        justify-content: center;
        padding: 0px;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands li>.pf-value {
        border-radius: 16px;
        transition: transform 0.18s ease, box-shadow 0.18s ease, outline-color 0.18s ease;
        outline: 1px solid transparent;
        outline-offset: -6px;
        background-color: transparent;
        will-change: transform;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands li>.pf-value:hover,
    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands li>.pf-value:focus-visible,
    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands li.wd-active>.pf-value {
        outline-color: #0f3f36;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands li>.pf-value:hover,
    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands li>.pf-value:focus-visible {
        transform: translateY(0px) scale(1.01);
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .wd-swatch,
    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .wd-swatch-bg {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-brands .wd-swatch.wd-bg {
        flex: 1 0 auto;
        max-width: 160px;
        width: 160px;
        height: 60px;
        border-radius: 0;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .wd-swatch-bg img {
        max-width: 160px;
        max-height: 100px;
        width: 100%;
        height: auto;
        object-fit: contain;
        opacity: 1 !important;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .wd-swatch-text,
    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .wd-filter-lable {
        display: none;
    }

    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .wd-swatch.wd-bg::before,
    .wd-product-filters .wd-pf-attributes .wd-swatches-filter.wd-swatches-brands .wd-swatch.wd-bg::after {
        opacity: 0 !important;
    }

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

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

    .wd-product-filters .wd-pf-price-range .ui-slider .ui-slider-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 48px;
        height: 20px;
        padding: 0 10px;
        border-radius: 24px;
        margin: 0;
        top: 50%;
        transform: translate(-50%, -50%);
        background: var(--voltride-filter-handle);
        border: 0;
        box-shadow: 0 2px 8px rgba(15, 63, 54, 0.1);
        cursor: grab;
    }

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

    .wd-product-filters .wd-pf-price-range .ui-slider .ui-slider-handle:active {
        cursor: grabbing;
    }

    .wd-product-filters .wd-pf-price-range .voltride-filter__handle-value {
        color: white;
        font-family: var(--font-primary, 'Biryani', sans-serif);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.6 !important;
        white-space: nowrap;
        pointer-events: none;
        user-select: none;
    }

    .wd-product-filters .wd-pf-price-range .price_slider_widget {
        display: block;
    }

    .wd-product-filters .wd-pf-price-range .price_slider_widget {
        margin-top: 12px;
    }

    .wd-product-filters .wd-pf-price-range .filter_price_slider_amount {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-top: 10px;
        padding: 0;
        border-top: 0;
    }

    .wd-product-filters .wd-pf-price-range .filter_price_slider_amount .price_label {
        display: none;
    }

    .wd-product-filters .wd-pf-price-range .voltride-filter__results {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        padding: 0;
        list-style: none;
        flex-shrink: 1;
        min-width: 0;
        max-width: 60%;
        overflow: hidden;
    }

    .wd-product-filters .wd-pf-price-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%;
    }

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

    .wd-product-filters .wd-pf-price-range .voltride-filter__results .selected-value:hover {
        background: #FF6082;
    }

    .wd-product-filters .wd-pf-attributes .voltride-filter__results {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        padding: 0;
        list-style: none;
        flex-shrink: 1;
        min-width: 0;
        max-width: 60%;
        overflow: hidden;
    }

    .wd-product-filters .wd-pf-attributes .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%;
    }

    .wd-product-filters .wd-pf-attributes .voltride-filter__results .selected-value:hover {
        background: #FF6082;
    }


/* ============================================
   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;
    }

    .wd-pf-price-range .price_slider_wrapper {
        padding: 0 15px;
    }

    .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;
    }
}
