/* ═══════════════════════════════════════════════════════════
   Roso Product Filter — filter.css  (v5 dynamic facets)
   עיצוב סיידבר מינימליסטי חם בהשראת חנות רהיטים
═══════════════════════════════════════════════════════════ */
.rosof-wrap,
.rosof-wrap * { box-sizing: border-box; }

.rosof-wrap{
    direction: rtl;
    font-family: inherit;
    /* ── palette tokens (ניתנים לדריסה מה-Style) ── */
    --rosof-pill-bg:          #f0efec;
    --rosof-pill-color:       #2a2a28;
    --rosof-pill-border:      transparent;
    --rosof-pill-hover-bg:    #e7e5e0;
    --rosof-active-bg:        #1b1b19;
    --rosof-active-color:     #ffffff;
    --rosof-title:            #8f8b83;
    --rosof-heading:          #1b1b19;
    --rosof-divider:          #ececea;
    --rosof-slider:           #1b1b19;
    --rosof-track:            #e3e1dc;
    --rosof-card-bg:          #f4f3f1;
    --rosof-muted:            #98948c;
}

/* ─────────── Layout ─────────── */
.rosof-pos-top  .rosof-sidebar{ margin-bottom: 26px; }
.rosof-pos-top  .rosof-facets-top,
.rosof-pos-top  .rosof-facets-bottom,
.rosof-pos-top  .rosof-price-sec{ display:inline-block; vertical-align:top; }

.rosof-pos-side{
    display: flex;
    gap: 40px;
    align-items: flex-start;
}
.rosof-pos-side .rosof-sidebar{
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
}
.rosof-pos-side .rosof-results{ flex: 1; min-width: 0; }

/* ─────────── Sidebar shell ─────────── */
.rosof-sidebar-head{
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--rosof-muted);
    font-weight: 500;
    margin: 0 0 18px;
}

/* ─────────── Section ─────────── */
.rosof-sec{
    border-top: 1px solid var(--rosof-divider);
    padding: 16px 0 18px;
}
.rosof-sec:first-of-type{ border-top: 0; padding-top: 2px; }

.rosof-sec-head{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--rosof-title);
    font-family: inherit;
}
.rosof-sec-title{
    font-size: 13.5px;
    font-weight: 500;
    color: var(--rosof-title);
    letter-spacing: .01em;
}
.rosof-caret{
    flex-shrink: 0;
    color: var(--rosof-muted);
    transition: transform .25s ease;
    opacity: .8;
}
.rosof-sec.is-collapsed .rosof-caret{ transform: rotate(-180deg); }

/* collapse animation (grid-rows trick) */
.rosof-sec-body{
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .28s ease, opacity .2s ease;
    opacity: 1;
}
.rosof-sec.is-collapsed .rosof-sec-body{
    grid-template-rows: 0fr;
    opacity: 0;
}
.rosof-sec-inner{
    overflow: hidden;
    min-height: 0;
    padding-top: 13px;
}

/* ─────────── Pills ─────────── */
.rosof-pills{
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.rosof-pill{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1px solid var(--rosof-pill-border);
    border-radius: 999px;
    background: var(--rosof-pill-bg);
    color: var(--rosof-pill-color);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.15;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
    -webkit-appearance: none;
    appearance: none;
}
.rosof-pill:hover{ background: var(--rosof-pill-hover-bg); }
.rosof-pill:active{ transform: scale(.97); }
.rosof-pill.is-active{
    background: var(--rosof-active-bg);
    color: var(--rosof-active-color);
    border-color: var(--rosof-active-bg);
}

/* color swatch pills (Finish) */
.rosof-pill-color{ padding-inline-start: 7px; }
.rosof-swatch{
    width: 17px;
    height: 17px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.rosof-pill-color.is-active .rosof-swatch{ border-color: rgba(255,255,255,.45); }

/* ─────────── Hardening (beat theme button/link resets) + RTL right-align ─────────── */
.rosof-wrap .rosof-pills{
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important; /* flex-start = right edge in RTL */
    gap: 7px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.rosof-wrap .rosof-pill{
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    margin: 0 !important;
    padding: 6px 13px !important;
    border: 1px solid var(--rosof-pill-border) !important;
    border-radius: 999px !important;
    background: var(--rosof-pill-bg) !important;
    color: var(--rosof-pill-color) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}
.rosof-wrap .rosof-pill:hover{ background: var(--rosof-pill-hover-bg) !important; }
.rosof-wrap .rosof-pill.is-active,
.rosof-wrap .rosof-pill.is-active:hover{
    background: var(--rosof-active-bg) !important;
    color: var(--rosof-active-color) !important;
    border-color: var(--rosof-active-bg) !important;
}
.rosof-wrap .rosof-pill-color{ padding-inline-start: 7px !important; }

/* right-align all textual blocks in the sidebar */
.rosof-wrap .rosof-sidebar-head,
.rosof-wrap .rosof-sec-title,
.rosof-wrap .rosof-price-value,
.rosof-wrap .rosof-quick-label{ text-align: right !important; }
.rosof-wrap .rosof-sec-head{ text-align: right !important; }
.rosof-wrap .rosof-quick{ justify-content: flex-start !important; }

/* ─────────── Price ─────────── */
.rosof-price-sec{ border-top: 1px solid var(--rosof-divider); padding: 16px 0 18px; }
.rosof-price-value{
    font-size: 13px;
    font-weight: 600;
    color: var(--rosof-heading);
    margin-bottom: 14px;
    letter-spacing: .01em;
}
.rosof-range{
    position: relative;
    height: 26px;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}
.rosof-range-track{
    position: absolute;
    inset-inline: 2px;
    height: 4px;
    background: var(--rosof-track);
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
}
.rosof-range-fill{
    position: absolute;
    height: 100%;
    background: var(--rosof-slider);
    border-radius: 4px;
    left: 0;
    width: 100%;
}
.rosof-range input[type=range]{
    position: absolute;
    inset-inline: 0;
    width: 100%;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
}
.rosof-range input[type=range]::-webkit-slider-thumb{
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--rosof-slider);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
    cursor: pointer;
    pointer-events: all;
    transition: transform .14s ease;
}
.rosof-range input[type=range]::-webkit-slider-thumb:hover{ transform: scale(1.18); }
.rosof-range input[type=range]::-moz-range-thumb{
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--rosof-slider);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
    cursor: pointer;
    pointer-events: all;
}

.rosof-quick-label{
    font-size: 11.5px;
    color: var(--rosof-title);
    margin: 16px 0 9px;
    letter-spacing: .01em;
}
.rosof-quick{
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* ─────────── Clear ─────────── */
.rosof-clear{
    margin-top: 22px;
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--rosof-divider);
    border-radius: 999px;
    background: #fff;
    color: var(--rosof-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.rosof-clear:hover{ border-color: #cbb9a8; color: #6b5a48; background: #faf8f5; }
.rosof-clear[hidden]{ display:none; }

/* ─────────── Results header ─────────── */
.rosof-results-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.rosof-count{
    font-size: 12.5px;
    color: var(--rosof-muted);
    letter-spacing: .01em;
}
.rosof-count.is-loading{ opacity: .5; }
.rosof-sort-wrap{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--rosof-muted);
}
.rosof-sort{
    padding: 7px 30px 7px 12px;
    border: 1px solid var(--rosof-divider);
    border-radius: 999px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--rosof-heading);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%231b1b19' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat left 12px center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.rosof-sort:focus{ outline: none; border-color: var(--rosof-heading); }

/* ─────────── Grid ─────────── */
.rosof-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    transition: opacity .18s ease;
}
.rosof-grid.is-loading{ opacity: .45; }

/* ─────────── Card ─────────── */
.rosof-card{
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.rosof-img-wrap{
    position: relative;
    background: var(--rosof-card-bg);
    border-radius: 6px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rosof-img-wrap img{
    max-width: 86%;
    max-height: 86%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform .35s ease;
}
.rosof-card:hover .rosof-img-wrap img{ transform: scale(1.045); }

.rosof-badge{
    position: absolute;
    top: 11px;
    inset-inline-start: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
    background: #1b1b19;
    color: #fff;
}
.rosof-badge-sale{ background: #8a6a4f; }
.rosof-badge-new { background: #6f7d63; }
.rosof-badge-hot { background: #1b1b19; }

.rosof-info{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
}
.rosof-name{
    font-size: 13px;
    font-weight: 500;
    color: var(--rosof-heading);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rosof-price{
    font-size: 13.5px;
    font-weight: 600;
    color: var(--rosof-heading);
    white-space: nowrap;
    flex-shrink: 0;
}
.rosof-price .woocommerce-Price-amount{ font-size: inherit; }
.rosof-price ins{ text-decoration: none; }
.rosof-price del{ color: var(--rosof-muted); font-weight: 400; margin-inline-start: 6px; font-size: 12px; }

/* empty / status */
.rosof-empty{
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--rosof-muted);
    font-size: 14px;
}

/* ─────────── Mobile filter toggle ─────────── */
.rosof-mobile-bar{ display: none; }

/* ─────────── Responsive ─────────── */
@media (max-width: 1024px){
    .rosof-pos-side{ display: block; }
    .rosof-pos-side .rosof-sidebar{
        width: 100%;
        position: static;
        margin-bottom: 8px;
    }

    /* turn sidebar into a collapsible drawer on mobile */
    .rosof-mobile-bar{
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 16px;
    }
    .rosof-mobile-toggle{
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 9px 16px;
        border: 1px solid var(--rosof-divider);
        border-radius: 999px;
        background: #fff;
        font-family: inherit;
        font-size: 13px;
        font-weight: 500;
        color: var(--rosof-heading);
        cursor: pointer;
    }
    .rosof-sidebar{
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }
    .rosof-sidebar.is-open{ max-height: 1600px; }
    .rosof-sidebar-head{ display: none; }
}
@media (max-width: 768px){
    .rosof-grid{ grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 460px){
    .rosof-grid{ gap: 10px; }
    .rosof-name{ font-size: 12px; }
}
