/* Listing pages: category / sub / search */
.listing { display: grid; grid-template-columns: 250px 1fr; gap: 24px; padding-block: 28px 10px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); padding: 18px; }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.filters-head strong { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.filters-head .link-more { text-decoration: underline; font-size: 12.5px; }
.f-group { padding: 16px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.f-group:last-of-type { border: 0; }
.f-group h4 { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink); }
.f-count { color: var(--muted); font-size: 12px; }
.f-price { display: flex; align-items: center; gap: 8px; }
.f-price input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: #fdfbfa; }
.hide-lg { display: none; }

.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(130px, 1fr); gap: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 20px; }
.tiles::-webkit-scrollbar { display: none; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; font-size: 13px; transition: .2s; }
.tile:hover, .tile.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.tile-img {
    width: 100%;
    aspect-ratio: 6 / 9;
    border-radius: 8px;
    overflow: hidden;
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.results-bar strong { font-weight: 600; }
.results-tools { display: flex; gap: 10px; align-items: center; }
.sort { height: 40px; width: auto; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.products .p-card.out { display: none; }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.pager button { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 14px; }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }

.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px; }
.empty > .icon { width: 44px; height: 44px; color: var(--primary); }

@media (max-width: 992px) {
    .listing { grid-template-columns: 1fr; }
    .hide-lg { display: inline-flex; }
    .filters { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 90; width: min(320px, 86vw); border-radius: 0; overflow-y: auto; transform: translateX(-105%); transition: transform .3s; }
    [dir="rtl"] .filters { transform: translateX(105%); }
    .filters.open { transform: none; }
}
@media (max-width: 640px) {
    .results-bar { flex-wrap: wrap; }
    .sort { max-width: 170px; }
}

/* ---- v2: sections sidebar + price range ---- */
@media (min-width: 993px) { .listing { grid-template-columns: 270px 1fr; } }
.listing > .results { min-width: 0; }
.side-cats { display: flex; flex-direction: column; gap: 2px; }
.side-cats > li > a.side-cat { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.side-cats > li > a.side-cat::after { content: ""; width: 7px; height: 7px; border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); opacity: .5; transition: .2s; }
[dir="rtl"] .side-cats > li > a.side-cat::after { transform: rotate(135deg); }
.side-cats > li.open > a.side-cat::after { transform: rotate(45deg); }
.side-cats > li > ul { display: none; padding: 2px 0 8px; margin-inline-start: 10px; border-inline-start: 1px solid var(--border); }
.side-cats > li.open > ul { display: block; }
.side-cats a:hover { background: var(--cream); color: var(--wine); }
.side-cats a.on { background: var(--primary-soft); color: var(--wine); }
.side-sub { display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; color: var(--ink); }
.side-sub span { color: var(--muted); font-size: 12px; }

.range { position: relative; height: 26px; }
.range-track { position: absolute; inset-inline: 0; top: 11px; height: 4px; border-radius: 4px; background: var(--border); }
.range-fill { position: absolute; top: 0; bottom: 0; background: var(--primary); border-radius: 4px; }
.range input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 26px; }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--wine); box-shadow: var(--shadow-sm); cursor: grab; }
.range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--wine); cursor: grab; }
.range input[type=range]::-webkit-slider-runnable-track { background: none; }
.range input[type=range]::-moz-range-track { background: none; }
.f-price label { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.f-price small { color: var(--muted); font-size: 11.5px; }
.tile { color: var(--ink); }
@media (max-width: 992px) {
    .filters { z-index: 96; }
}

/* ---- grid / list toggle ---- */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.view-toggle button { width: 40px; height: 38px; display: grid; place-items: center; color: var(--muted); }
.view-toggle button + button { border-inline-start: 1px solid var(--border); }
.view-toggle button.on { background: var(--wine); color: #fff; }
.view-toggle .icon { width: 18px; height: 18px; }
.products.as-list { grid-template-columns: 1fr; gap: 16px; }
.products.as-list .p-card { flex-direction: row; align-items: stretch; }
.products.as-list .p-media { width: 240px; flex: none; aspect-ratio: 3 / 4; }
.products.as-list .p-body { justify-content: center; padding: 22px 26px; gap: 10px; }
.products.as-list .p-title { font-size: 19px; font-family: var(--font-head); white-space: normal; }
.products.as-list .p-short { -webkit-line-clamp: 3; min-height: 0; font-size: 14px; display: -webkit-box; }
.products.as-list .p-price { font-size: 19px; }
.products.as-list .p-add { width: auto; align-self: flex-start; padding-inline: 28px; }
@media (max-width: 640px) {
    .products.as-list .p-media { width: 130px; }
    .products.as-list .p-body { padding: 12px; gap: 6px; }
    .products.as-list .p-title { font-size: 15px; }
    .products.as-list .p-short { display: -webkit-box; -webkit-line-clamp: 2; font-size: 12.5px; }
    .products.as-list .p-add { width: 100%; padding-inline: 10px; }
}
