
:root {
    --spf-accent:#ff6c00;
    --spf-accent-dark:  #e05e00;
    --spf-accent-light: #fff4ee;
    --spf-header-bg:    #333;
    --spf-border:       #e4e4e4;
    --spf-bg:           #ffffff;
    --spf-muted:        #999;
    --spf-radius:       8px;
    --spf-list-h:       200px;
}

.spf-wrap *,
.spf-wrap *::before,
.spf-wrap *::after {
    box-sizing: border-box;
}

.spf-wrap {
    background: var(--spf-bg);
    border: 1px solid var(--spf-border);
    border-radius: var(--spf-radius);
    direction: rtl;
    overflow: hidden;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.spf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: var(--spf-header-bg);
    color: #fff;
    border-radius:8px;
    margin-bottom:10px
}

.spf-header-title {
    font-size: 0.85rem;
    font-weight: 700;
}

.spf-clear-all {
    font-size: 0.72rem;
    color: #c9c9c9 !important;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.28);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
    transition: background .18s;
}
.spf-clear-all:hover { background: rgba(255,255,255,.18); color: #fff; }


.spf-group {
    border-bottom: 1px solid var(--spf-border);
}
.spf-group:last-of-type { border-bottom: none; }


.spf-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 700;
    color: inherit;
    transition: background .15s;
    /* Ø¨Ø¯ÙˆÙ† Ù‡ÛŒÚ† Ø§Ø³ØªØ§ÛŒÙ„ button */
    background: transparent;
    border: none;
    width: 100%;
    text-align: right;
}
.spf-group-title:hover { background: #fafafa; }


.spf-toggle {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    position: relative;
    margin-right: 4px;
}
.spf-toggle::before,
.spf-toggle::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--spf-muted);
    border-radius: 2px;
    transition: opacity .22s;
}
.spf-toggle::before { width: 10px; height: 2px; }
.spf-toggle::after  { width: 2px;  height: 10px; }


.spf-group:not(.is-collapsed) .spf-toggle::after { opacity: 0; }
.spf-group.is-collapsed       .spf-toggle::after { opacity: 1; }

/* badge */
.spf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--spf-accent);
    color: #fff;
    border-radius: 9px;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
    margin-right: 5px;
    vertical-align: middle;
}


.spf-group-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 0 0.9rem;
    pointer-events: none;
    transition: max-height .3s ease, opacity .28s ease, padding .3s ease;
}
.spf-group:not(.is-collapsed) .spf-group-body {
    max-height: 600px;
    opacity: 1;
    padding: 0 0.9rem 0.8rem;
    pointer-events: auto;
}


.spf-search-wrap {
    margin: 0.45rem 0 0.5rem;
    position: relative;
}
.spf-search-input {
    width: 100%;
    padding: 0.35rem 0.6rem 0.35rem 1.6rem;
    border: 1px solid var(--spf-border);
    border-radius: 5px !important;
    font-family: inherit;
    font-size: 0.8rem !important;
    color: inherit;
    background: #fafafa;
    outline: none;
    direction: rtl;
    transition: border-color .18s;
}
.spf-search-input:focus { border-color: var(--spf-accent); background: #fff; }

.spf-checkbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: var(--spf-list-h);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.spf-checkbox-list::-webkit-scrollbar { width: 3px; }
.spf-checkbox-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.spf-item { margin-bottom: 1px; }
.spf-item.is-hidden { display: none; }

.spf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    border-radius: 5px;
    transition: background .13s;
    font-size: 0.9rem;
}
.spf-checkbox-label:hover { background: var(--spf-accent-light); }

.spf-checkbox-label input[type="checkbox"] { display: none; }

.spf-check-box {
    width: 15px; height: 15px; min-width: 15px;
    border: 2px solid #ccc;
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
}
.spf-checkbox-label input:checked + .spf-check-box {
    background: var(--spf-accent);
    border-color: var(--spf-accent);
}
.spf-checkbox-label input:checked + .spf-check-box::after {
    content: '';
    position: absolute;
    top: 0px; right: 3px;
    width: 4px; height: 8px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg);
}

.spf-term-name { flex: 1; line-height: 1.4; }
.spf-term-count {
    font-size: 0.7rem;
    color: var(--spf-muted);
    background: #f2f2f2;
    padding: 1px 5px;
    border-radius: 8px;
}
.spf-no-result {
    font-size: 0.75rem;
    color: var(--spf-muted);
    text-align: center;
    margin: 0.4rem 0 0;
}

.spf-price-display {
    font-size: 0.9rem;
    margin: 0.45rem 0 0.8rem;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    flex-wrap: wrap;
}
#spf-price-min, #spf-price-max { font-weight: 700; color: var(--spf-accent); }
.spf-price-sep, .spf-price-cur { color: var(--spf-muted); font-size: 0.72rem; }

#spf-price-slider.ui-slider {
    margin: 0 6px 0.6rem;
    height: 4px;
    border: none;
    background: #e0e0e0;
    border-radius: 4px;
    box-shadow: none !important;
}
#spf-price-slider .ui-slider-range { background: var(--spf-accent); }
#spf-price-slider .ui-slider-handle {
    width: 16px; height: 16px;
    top: -6px;
    border-radius: 50%;
    border: 2px solid var(--spf-accent);
    background: #fff;
    box-shadow: none !important;
    cursor: grab; outline: none;
    transition: transform .13s;
}
#spf-price-slider .ui-slider-handle:hover { transform: scale(1.2); }


.spf-submit-btn {
    display: block;
    width: calc(100% - 1.8rem);
    margin: 0.8rem auto 0.9rem;
    padding: 0.55rem;
    background: var(--spf-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .1s;
}
.spf-submit-btn:hover  { background: var(--spf-accent-dark); }
.spf-submit-btn:active { transform: scale(.98); }

@media (max-width: 1024px) {

    .spf-wrap {
        border: none;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }
    .spf-header,
    #spf-filter-form {
        display: none;
    }


    .spf-mobile-trigger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.75rem 1rem;
        background: var(--spf-accent);
        color: #fff;
        border: none;
        border-radius: var(--spf-radius);
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
        direction: rtl;
        transition: background .18s;
    }
    .spf-mobile-trigger:hover { background: var(--spf-accent-dark); }
    .spf-mobile-trigger .spf-trigger-count {
        background: rgba(255,255,255,.25);
        border-radius: 10px;
        padding: 1px 7px;
        font-size: 0.75rem;
    }


    .spf-mobile-panel {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 99999;
        background: #fff;
        direction: rtl;
        flex-direction: column;
        overflow: hidden;
    }
    .spf-mobile-panel.is-open {
        display: flex;
    }


    .spf-panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem 1rem;
        background: var(--spf-header-bg);
        color: #fff;
        flex-shrink: 0;
    }
    .spf-panel-head-title {
        font-size: 0.88rem;
        font-weight: 700;
    }
    .spf-panel-close {
        background: transparent;
        border: 1px solid rgba(255,255,255,.35);
        color: #fff;
        border-radius: 6px;
        padding: 0.3rem 0.7rem;
        font-family: inherit;
        font-size: 0.78rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }
    .spf-panel-close:hover { background: rgba(255,255,255,.15); }

    .spf-panel-body {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 5rem; 
    }

    .spf-panel-body .spf-wrap-inner {
        border: none;
    }
    .spf-panel-body .spf-group {
        border-bottom: 1px solid var(--spf-border);
    }
    .spf-panel-body .spf-group-title {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
    .spf-panel-body .spf-group:not(.is-collapsed) .spf-group-body {
        padding: 0 1rem 0.9rem;
    }

   .spf-panel-footer {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        padding: 0.75rem 1rem;
        background: #fff;
        border-top: 1px solid var(--spf-border);
        display: flex;
        gap: 0.6rem;
    }
    .spf-panel-footer .spf-submit-btn {
        flex: 1;
        margin: 0;
        width: auto;
        padding: 0.65rem;
        font-size: 0.88rem;
    }
    .spf-panel-footer .spf-clear-btn {
        flex-shrink: 0;
        padding: 0.65rem 1rem;
        border: 1px solid var(--spf-border);
        border-radius: 6px;
        background: transparent;
        font-family: inherit;
        font-size: 0.82rem;
        cursor: pointer;
        color: inherit;
        text-decoration: none;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }
    .spf-panel-footer .spf-clear-btn:hover { background: #f5f5f5; }


    .spf-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 99998;
    }
    .spf-overlay.is-open { display: block; }
}


@media (min-width: 1025px) {
    .spf-mobile-trigger { display: none !important; }
    .spf-mobile-panel   { display: none !important; }
    .spf-overlay        { display: none !important; }
    .spf-header         { display: flex; }
    #spf-filter-form    { display: block; }
}

div#spf-filter-wrap {padding:10px}