/*
 * ETC Site Care - Modern Price Filter
 * Brand color: #A8201E
 *
 * Desktop: compact pill inputs
 * Tablet: two columns
 * Phone: stacked, touch-friendly inputs
 *
 * Styles apply only while the improved filter is active.
 */

.widget_price_filter.etcsc-price-filter-active {
    --etcsc-red: #a8201e;
    --etcsc-border: #dedee2;
    --etcsc-track: #dedee2;
}

/* --------------------------------------------------
   1. SLIDER
-------------------------------------------------- */

.widget_price_filter.etcsc-price-filter-active .price_slider_wrapper {
    margin-top: 16px;
}

.widget_price_filter.etcsc-price-filter-active .price_slider {
    height: 4px !important;
    margin: 18px 10px 24px !important;
    border: 0 !important;
    border-radius: 40px !important;
    background: var(--etcsc-track) !important;
    box-shadow: none !important;
}

.widget_price_filter.etcsc-price-filter-active .price_slider .ui-slider-range {
    height: 4px !important;
    border: 0 !important;
    border-radius: 40px !important;
    background: var(--etcsc-red) !important;
    box-shadow: none !important;
}

/* Small circular handles instead of large red blocks */

.widget_price_filter.etcsc-price-filter-active .price_slider .ui-slider-handle {
    top: 50% !important;

    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;

    margin-top: -10px !important;

    border: 1px solid #e6e6e8 !important;
    border-radius: 50% !important;

    background-color: #fff !important;
    background-image: radial-gradient(circle at center,
            #a8201e 0,
            #a8201e 4px,
            transparent 4.5px) !important;

    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12) !important;

    cursor: grab;
    outline: none;
}

/* Remove any square decorations added by the theme */

.widget_price_filter.etcsc-price-filter-active .price_slider .ui-slider-handle::before,

.widget_price_filter.etcsc-price-filter-active .price_slider .ui-slider-handle::after {
    content: none !important;
}

.widget_price_filter.etcsc-price-filter-active .price_slider .ui-slider-handle:active {
    cursor: grabbing;
}

.widget_price_filter.etcsc-price-filter-active .price_slider .ui-slider-handle:focus-visible {
    outline: 2px solid var(--etcsc-red) !important;
    outline-offset: 3px;
}

/* --------------------------------------------------
   2. PRICE INPUTS
-------------------------------------------------- */

.widget_price_filter.etcsc-price-filter-active .price_slider_amount {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.widget_price_filter.etcsc-price-filter-active .etcsc-price-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;

    width: 100%;
    margin: 0 0 14px;
}

.widget_price_filter.etcsc-price-filter-active .etcsc-price-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.widget_price_filter.etcsc-price-filter-active .etcsc-price-field label {
    display: block;
    margin: 0;

    color: #555;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

/* Slim pill-shaped desktop inputs */

.widget_price_filter.etcsc-price-filter-active .etcsc-price-field input {
    display: block !important;

    width: 100% !important;
    min-width: 0 !important;

    height: 25px !important;
    min-height: 25px !important;

    margin: 0 !important;
    padding: 0 12px !important;

    box-sizing: border-box !important;

    border: 1px solid var(--etcsc-border) !important;
    border-radius: 40px !important;

    background: #fff !important;
    box-shadow: none !important;

    color: #252525 !important;
    font-size: 13px !important;
    font-weight: 400;
    line-height: 23px !important;
    text-align: left;

    font-variant-numeric: tabular-nums;
    appearance: textfield;
    -moz-appearance: textfield;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

/* Hide number-input spinner arrows */

.widget_price_filter.etcsc-price-filter-active .etcsc-price-field input::-webkit-inner-spin-button,

.widget_price_filter.etcsc-price-filter-active .etcsc-price-field input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.widget_price_filter.etcsc-price-filter-active .etcsc-price-field input:focus {
    border-color: var(--etcsc-red) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(168, 32, 30, 0.12) !important;
}

/* --------------------------------------------------
   3. PRICE SUMMARY
-------------------------------------------------- */

.widget_price_filter.etcsc-price-filter-active .price_slider_amount .price_label {
    display: block !important;

    width: 100%;
    margin: 0 !important;

    color: #777;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

/* Only the selected price values become red */

.widget_price_filter.etcsc-price-filter-active .price_slider_amount .price_label .from,

.widget_price_filter.etcsc-price-filter-active .price_slider_amount .price_label .to {
    color: var(--etcsc-red) !important;
    font-weight: 600 !important;
}

/* Hide original button only when the new filter is ready */

.widget_price_filter.etcsc-price-filter-active.etcsc-price-filter-ready .price_slider_amount button[type="submit"] {
    display: none !important;
}

.widget_price_filter.etcsc-price-filter-active .price_slider_amount .clear {
    display: none !important;
}

/* --------------------------------------------------
   4. TABLET
   Two price inputs remain side by side.
-------------------------------------------------- */

@media (min-width: 481px) and (max-width: 1024px) {

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-field label {
        font-size: 11px;
    }

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-field input {
        height: 36px !important;
        min-height: 36px !important;
        line-height: 34px !important;
        font-size: 14px !important;
    }
}

/* --------------------------------------------------
   5. PHONE
   Inputs stack vertically and become touch-friendly.
-------------------------------------------------- */

@media (max-width: 480px) {

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 14px;
    }

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-field {
        gap: 5px;
    }

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-field label {
        font-size: 12px;
    }

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-field input {
        height: 44px !important;
        min-height: 44px !important;

        padding: 0 14px !important;

        font-size: 16px !important;
        line-height: 42px !important;
    }

    .widget_price_filter.etcsc-price-filter-active .price_slider {
        margin-top: 23px !important;
        margin-bottom: 28px !important;
    }

    .widget_price_filter.etcsc-price-filter-active .price_slider .ui-slider-handle {
        width: 24px !important;
        height: 24px !important;

        min-width: 24px !important;
        min-height: 24px !important;

        margin-top: -12px !important;
    }
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {

    .widget_price_filter.etcsc-price-filter-active .etcsc-price-field input {
        transition: none;
    }
}