/* ========================================================
   THE PLUMB STATION CUSTOM SIDEBAR PRICE FILTER (FIGMA EXACT)
   ======================================================== */

/* Main Container Wrapper */
.ps-custom-price-filter-wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* 1. INPUT FORM ROW - Perfect Inline Alignment */
.ps-price-form-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 22px !important;
    width: 100% !important;
}

/* Text elements inside form row */
.ps-price-form-row .ps-currency {
    font-size: 15px;
    font-weight: 500;
    color: #5a626a;
}

.ps-price-form-row .ps-to {
    font-size: 14px;
    color: #7a828a;
}

/* Min & Max Input Fields styling */
.ps-price-form-row input[type="number"] {
    width: 55px !important;
    height: 36px !important;
    padding: 0 4px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    color: #4a5568 !important;
    text-align: center !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
}

/* Strip native scroll arrows on number inputs */
.ps-price-form-row input::-webkit-outer-spin-button,
.ps-price-form-row input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* "Go" Action Button Styling */
.ps-price-form-row .ps-go-button {
    background-color: #6d7d8d !important; /* Perfect slate-blue color from your design */
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    height: 36px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.2s ease;
}

.ps-price-form-row .ps-go-button:hover {
    background-color: #556473 !important;
}


/* 2. BRACKETS CHECKBOX LIST - Strip theme bullets completely */
.ps-price-brackets-grid {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ps-price-brackets-grid li.ps-bracket-item {
    list-style: none !important;
    list-style-type: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 0 12px 0 !important; /* Spacing between rows */
}

/* Remove default theme pseudo-elements if they add bullet graphics */
.ps-price-brackets-grid li.ps-bracket-item::before,
.ps-price-brackets-grid li.ps-bracket-item::after {
    display: none !important;
    content: "" !important;
}

/* Clickable Alignment Row */
.ps-bracket-clickable {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    user-select: none !important;
}

/* Checkbox Style */
.ps-bracket-clickable input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 15px !important;
    height: 15px !important;
    border: 1px solid #cbd5e0 !important;
    border-radius: 3px !important;
    background-color: #ffffff !important;
    margin: 0 !important;
    cursor: pointer !important;
    display: inline-grid !important;
    place-content: center !important;
}

/* Selected Checkbox Style */
.ps-bracket-clickable input[type="checkbox"]:checked {
    border-color: #6d7d8d !important;
    background-color: #6d7d8d !important;
}

.ps-bracket-clickable input[type="checkbox"]:checked::before {
    content: "" !important;
    width: 7px;
    height: 7px;
    background-color: #ffffff !important;
    border-radius: 1px;
}

/* Text Label styling matching Figma colors */
.ps-label-text {
    font-size: 14px !important;
    color: #5a626a !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}

/* Darker color highlight when active */
.ps-bracket-clickable input[type="checkbox"]:checked + .ps-label-text {
    color: #1a202c !important;
    font-weight: 500 !important;
}


/* ========================================================
   TABLET & MOBILE: Filter Toggle Button + Slide-in Panel
   ======================================================== */

/* Root wrapper — desktop: inline sidebar block */
.ps-price-filter-root {
    width: 100%;
    box-sizing: border-box;
}

/* Filter toggle — hidden on desktop, pill style on tablet/mobile */
.ps-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    min-width: 160px;
    padding: 14px 32px;
    margin-bottom: 16px;
    background-color: #ffffff;
    color: #1d2939;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.ps-filter-toggle:hover {
    background-color: #f9fafb;
    box-shadow: none;
}

.ps-filter-toggle:active {
    background-color: #f2f4f7;
    box-shadow: none;
}

.ps-filter-toggle__label {
    line-height: 1.2;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.ps-filter-toggle__icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    color: inherit;
}

/* Overlay — hidden by default */
.ps-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ps-filter-overlay--visible {
    display: block;
    opacity: 1;
}

/* Panel header with close button — hidden on desktop */
.ps-filter-panel-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eaecf0;
}

.ps-filter-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2939;
}

.ps-filter-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    cursor: pointer;
    color: #667085;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ps-filter-panel-close:hover {
    background-color: #f2f4f7;
    color: #344054;
}

body.ps-filter-panel-open {
    overflow: hidden;
}

/* ========================================================
   Responsive — Tablet & Mobile (≤1024px)
   ======================================================== */

@media screen and (max-width: 1024px) {

    /* Show the Filter toggle button — no shadow, larger visible label/icon */
    .ps-price-filter-root > .ps-filter-toggle {
        display: inline-flex !important;
        box-shadow: none !important;
        color: #1d2939 !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        padding: 14px 32px !important;
        gap: 12px !important;
    }

    .ps-price-filter-root > .ps-filter-toggle:hover,
    .ps-price-filter-root > .ps-filter-toggle:active,
    .ps-price-filter-root > .ps-filter-toggle:focus {
        box-shadow: none !important;
        color: #1d2939 !important;
    }

    .ps-price-filter-root > .ps-filter-toggle .ps-filter-toggle__label {
        font-size: 18px !important;
        font-weight: 600 !important;
        color: #1d2939 !important;
        line-height: 1.2 !important;
    }

    .ps-price-filter-root > .ps-filter-toggle .ps-filter-toggle__icon {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        color: #1d2939 !important;
    }

    /* Show the panel header (title + close) */
    .ps-filter-panel-header {
        display: flex !important;
    }

    /* Hide inline filter until drawer opens */
    .ps-price-filter-root > .ps-custom-price-filter-wrapper {
        position: fixed !important;
        top: 0 !important;
        right: -320px !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100% !important;
        background-color: #ffffff !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .ps-filter-panel-body {
        padding: 16px 20px 24px;
        flex: 1;
    }

    /* Slide in when open */
    .ps-price-filter-root > .ps-custom-price-filter-wrapper.ps-filter-open {
        right: 0 !important;
    }

    /*
     * Elementor editor canvas is narrower than the viewport, so max-width: 1024px
     * fires on the desktop device tab. Keep sidebar layout unless tablet/mobile preview.
     */
    .ps-price-filter-root.ps-elementor-canvas > .ps-filter-toggle,
    .ps-price-filter-root.ps-elementor-canvas > .ps-filter-overlay {
        display: none !important;
    }

    .ps-price-filter-root.ps-elementor-canvas .ps-filter-panel-header {
        display: none !important;
    }

    .ps-price-filter-root.ps-elementor-canvas > .ps-custom-price-filter-wrapper {
        position: static !important;
        top: auto !important;
        right: auto !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        box-shadow: none !important;
        overflow: visible !important;
        display: block !important;
        flex-direction: unset !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .ps-price-filter-root.ps-elementor-canvas .ps-filter-panel-body {
        padding: 0;
    }

    body.elementor-device-tablet .ps-price-filter-root.ps-elementor-canvas > .ps-filter-toggle,
    body.elementor-device-mobile .ps-price-filter-root.ps-elementor-canvas > .ps-filter-toggle {
        display: inline-flex !important;
    }

    body.elementor-device-tablet .ps-price-filter-root.ps-elementor-canvas .ps-filter-panel-header,
    body.elementor-device-mobile .ps-price-filter-root.ps-elementor-canvas .ps-filter-panel-header {
        display: flex !important;
    }

    body.elementor-device-tablet .ps-price-filter-root.ps-elementor-canvas > .ps-custom-price-filter-wrapper,
    body.elementor-device-mobile .ps-price-filter-root.ps-elementor-canvas > .ps-custom-price-filter-wrapper {
        position: fixed !important;
        top: 0 !important;
        right: -320px !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100% !important;
        background-color: #ffffff !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.elementor-device-mobile .ps-price-filter-root.ps-elementor-canvas > .ps-custom-price-filter-wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        right: -100% !important;
    }

    body.elementor-device-tablet .ps-price-filter-root.ps-elementor-canvas > .ps-custom-price-filter-wrapper.ps-filter-open,
    body.elementor-device-mobile .ps-price-filter-root.ps-elementor-canvas > .ps-custom-price-filter-wrapper.ps-filter-open {
        right: 0 !important;
    }
}

/* Desktop: keep sidebar filter always visible, no drawer */
@media screen and (min-width: 1025px) {

    .ps-price-filter-root > .ps-filter-toggle,
    .ps-price-filter-root > .ps-filter-overlay {
        display: none !important;
    }

    .ps-price-filter-root .ps-filter-panel-header {
        display: none !important;
    }

    .ps-price-filter-root > .ps-custom-price-filter-wrapper {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-width: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        background-color: #ffffff !important;
        padding: 20px !important;
        border-radius: 4px;
        box-sizing: border-box;
    }

    .ps-filter-panel-body {
        padding: 0;
    }
}

/* ========================================================
   Responsive — Mobile (≤768px)
   ======================================================== */

@media screen and (max-width: 768px) {

    .ps-price-filter-root > .ps-filter-toggle {
        width: 100%;
        justify-content: center;
        padding: 16px 24px !important;
        font-size: 18px !important;
    }

    .ps-price-filter-root > .ps-filter-toggle .ps-filter-toggle__label {
        font-size: 28px !important;
    }

    .ps-price-filter-root > .ps-filter-toggle .ps-filter-toggle__icon {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }

    /* Full-width drawer on mobile */
    .ps-price-filter-root > .ps-custom-price-filter-wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        right: -100% !important;
    }

    .ps-price-filter-root > .ps-custom-price-filter-wrapper.ps-filter-open {
        right: 0 !important;
    }

    .ps-filter-panel-header {
        padding: 16px;
    }
}

/* ========================================================
   Responsive — Small Mobile (≤480px)
   ======================================================== */

@media screen and (max-width: 480px) {

    .ps-price-filter-root > .ps-filter-toggle {
        font-size: 16px !important;
        padding: 14px 20px !important;
    }

    .ps-price-filter-root > .ps-filter-toggle .ps-filter-toggle__label {
        font-size: 17px !important;
    }

    .ps-price-filter-root > .ps-filter-toggle .ps-filter-toggle__icon {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
    }

    .ps-filter-panel-title {
        font-size: 16px;
    }
}

/* Elementor canvas: hide mobile chrome at any width unless tablet/mobile device tab */
.ps-price-filter-root.ps-elementor-canvas > .ps-filter-toggle,
.ps-price-filter-root.ps-elementor-canvas > .ps-filter-overlay {
    display: none !important;
}

.ps-price-filter-root.ps-elementor-canvas .ps-filter-panel-header {
    display: none !important;
}

.ps-price-filter-root.ps-elementor-canvas > .ps-custom-price-filter-wrapper {
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    box-shadow: none !important;
    overflow: visible !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.elementor-device-tablet .ps-price-filter-root.ps-elementor-canvas > .ps-filter-toggle,
body.elementor-device-mobile .ps-price-filter-root.ps-elementor-canvas > .ps-filter-toggle {
    display: inline-flex !important;
}

/* ========================================================
   Filter Overlay Animation
   ======================================================== */

.ps-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9998;
    transition: background-color 0.3s ease;
    pointer-events: none;
}

.ps-custom-price-filter-wrapper.ps-filter-open ~ .ps-filter-overlay {
    display: block;
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

/* Mobile filter panel open state */
@media screen and (max-width: 1024px) {
    .ps-price-filter-root > .ps-filter-toggle {
        display: inline-flex;
    }

    .ps-price-filter-root > .ps-filter-overlay {
        display: block;
    }

    .ps-price-filter-root > .ps-custom-price-filter-wrapper {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        max-width: 85vw;
        height: 100%;
        background-color: #ffffff;
        z-index: 9999;
        overflow-y: auto;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
    }

    .ps-price-filter-root > .ps-custom-price-filter-wrapper.ps-filter-open {
        right: 0;
    }
}

@media screen and (max-width: 480px) {
    .ps-price-filter-root > .ps-custom-price-filter-wrapper {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }

    .ps-price-filter-root > .ps-custom-price-filter-wrapper.ps-filter-open {
        right: 0;
    }
}