/* صفحات البحث والأقسام — بتعتمد على متغيرات وكروت home.css */
.rh-listing { padding-top: 12px; min-height: 60vh; }
.rh-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rh-muted); margin-bottom: 10px; flex-wrap: wrap; }
.rh-crumbs a { color: var(--rh-muted); text-decoration: none; }
.rh-crumbs a:hover { color: var(--rh-yellow-dark); }
.rh-crumbs span:last-child { color: var(--rh-dark); font-weight: 600; }
.rh-listing__head { margin-bottom: 18px; }
.rh-listing__head .rh-section__title { font-size: 24px; display: inline-block; }

.rh-listing__layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }

/* ── الفلاتر ── */
.rh-listing__side { position: sticky; top: 140px; }
.rh-listing__side-body { background: #fff; border-radius: 14px; border: 1px solid var(--rh-border); overflow: hidden; }
.rh-listing__side-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--rh-border); font-size: 17px; color: var(--rh-dark); }
.rh-listing__side-close, .rh-listing__side-backdrop { display: none; }
.rh-fbox { border-bottom: 1px solid var(--rh-border); }
.rh-fbox:last-child { border-bottom: 0; }
.rh-fbox__title { margin: 0; padding: 14px 18px 8px; font-size: 14px; font-weight: 800; color: var(--rh-dark); }
.rh-fbox__body { padding: 0 18px 16px; }
.rh-fbox__body--scroll { max-height: 360px; overflow-y: auto; padding-inline: 10px; }
.rh-input { width: 100%; height: 40px; border: 1px solid var(--rh-border); border-radius: 8px; padding: 0 12px; font-size: 14px; background: #fff; outline: none; color: var(--rh-text); }
.rh-input:focus { border-color: var(--rh-yellow); }
.rh-price { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rh-price .rh-btn { grid-column: 1 / -1; height: 38px; }

/* شجرة الأقسام */
.rh-tree, .rh-tree__kids { list-style: none; margin: 0; padding: 0; }
.rh-tree__kids { display: none; padding-inline-start: 22px; }
.rh-tree__item.open > .rh-tree__kids { display: block; }
.rh-tree__row { display: flex; align-items: center; justify-content: space-between; border-radius: 8px; }
.rh-tree__row:hover { background: #fff7e3; }
.rh-tree__toggle { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--rh-muted); flex: 0 0 auto; }
.rh-tree__toggle::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -4px; transition: transform .2s; }
.rh-tree__item.open > .rh-tree__row .rh-tree__toggle::before { transform: rotate(-135deg); margin-top: 3px; }

.rh-check, .rh-radio { display: flex; align-items: center; gap: 10px; padding: 7px 8px; cursor: pointer; margin: 0; font-size: 14px; color: var(--rh-text); flex: 1; min-width: 0; }
.rh-check input, .rh-radio input { position: absolute; opacity: 0; pointer-events: none; }
.rh-check__box { width: 18px; height: 18px; border: 2px solid #cfd3d8; border-radius: 5px; flex: 0 0 auto; position: relative; transition: background .15s, border-color .15s; }
.rh-check input:checked + .rh-check__box { background: var(--rh-yellow); border-color: var(--rh-yellow); }
.rh-check input:checked + .rh-check__box::after { content: ""; position: absolute; left: 4px; top: 0; width: 6px; height: 10px; border: solid var(--rh-dark); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rh-check img { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.rh-check__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-check input:checked ~ .rh-check__text { font-weight: 700; color: var(--rh-dark); }
.rh-radios { display: flex; flex-direction: column; }
.rh-radio span { display: flex; align-items: center; gap: 10px; }
.rh-radio span::before { content: ""; width: 18px; height: 18px; border: 2px solid #cfd3d8; border-radius: 50%; box-sizing: border-box; transition: border .15s; }
.rh-radio input:checked + span::before { border: 6px solid var(--rh-yellow); }

/* ── شريط الأدوات ── */
.rh-toolbar { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--rh-border); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.rh-toolbar__filter { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--rh-yellow); color: var(--rh-dark); font-weight: 700; cursor: pointer; }
.rh-toolbar__search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; height: 40px; background: var(--rh-bg); border-radius: 10px; padding: 0 12px; color: var(--rh-muted); }
.rh-toolbar__search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; min-width: 0; color: var(--rh-text); }
.rh-toolbar__count { font-size: 13px; color: var(--rh-muted); white-space: nowrap; }
.rh-toolbar__sort { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--rh-muted); white-space: nowrap; }
.rh-toolbar__sort select { height: 40px; border: 1px solid var(--rh-border); border-radius: 10px; padding: 0 10px; font-size: 14px; color: var(--rh-dark); background: #fff; outline: none; cursor: pointer; }

.rh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rh-chips:empty { display: none; }
.rh-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--rh-yellow); background: #fff7e3; color: var(--rh-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.rh-chip span { font-size: 16px; line-height: 1; }
.rh-chip--clear { background: transparent; border-color: var(--rh-border); color: var(--rh-muted); }

/* ── الشبكة والتحميل ── */
.rh-listing .rh-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.rh-listing__empty, .rh-listing__end, .rh-listing__loader { display: none; text-align: center; color: var(--rh-muted); padding: 24px; margin: 0; }
.rh-listing.is-empty .rh-listing__empty { display: block; background: #fff; border-radius: 14px; padding: 60px 20px; font-size: 16px; }
.rh-listing.is-end .rh-listing__end { display: block; font-size: 13px; }
.rh-listing.is-loading .rh-listing__loader { display: block; }
.rh-listing__loader .rh-loading { display: block; margin: 0 auto; }
#rhLSentinel { height: 1px; }

/* ── تابلت/موبايل: الفلاتر تبقى درج من الجنب ── */
@media (max-width: 991px) {
    .rh-listing__layout { grid-template-columns: 1fr; }
    .rh-toolbar__filter { display: inline-flex; }
    .rh-listing__side { position: fixed; inset: 0; z-index: 99990; pointer-events: none; top: 0; }
    .rh-listing__side-backdrop { display: block; position: absolute; inset: 0; background: rgba(15,23,42,.5); opacity: 0; transition: opacity .3s; }
    .rh-listing__side-body { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 320px; max-width: 88vw; border-radius: 0; overflow-y: auto; transform: translateX(105%); transition: transform .35s cubic-bezier(.22,1,.36,1); }
    [dir="ltr"] .rh-listing__side-body { transform: translateX(-105%); }
    .rh-listing__side.open { pointer-events: auto; }
    .rh-listing__side.open .rh-listing__side-backdrop { opacity: 1; }
    .rh-listing__side.open .rh-listing__side-body { transform: none; }
    .rh-listing__side-close { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--rh-bg); font-size: 22px; cursor: pointer; }
    .rh-fbox__body--scroll { max-height: none; }
}
@media (max-width: 575px) {
    .rh-listing__head .rh-section__title { font-size: 19px; }
    .rh-toolbar { padding: 10px; gap: 8px; }
    .rh-toolbar__search { order: 5; flex-basis: 100%; }
    .rh-toolbar__count { display: none; }
    .rh-toolbar__sort span { display: none; }
    .rh-toolbar__sort { margin-inline-start: auto; }
    .rh-listing .rh-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* ── رينج السعر (سلايدرين فوق بعض) ── */
.rh-range { position: relative; height: 28px; margin: 6px 4px 4px; }
.rh-range__track { position: absolute; top: 50%; left: 0; right: 0; height: 4px; margin-top: -2px; background: var(--rh-border); border-radius: 2px; }
.rh-range__fill { position: absolute; top: 0; bottom: 0; background: var(--rh-yellow); border-radius: 2px; }
.rh-range input[type=range] { position: absolute; inset: 0; width: 100%; height: 28px; margin: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; }
.rh-range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 28px; }
.rh-range input[type=range]::-moz-range-track { background: transparent; }
.rh-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; background: #fff; border: 3px solid var(--rh-yellow); box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: grab; }
.rh-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--rh-yellow); box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: grab; }
.rh-range__vals { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--rh-dark); margin-top: 6px; }
