/* Aakram Filter - front styles. Colours come from CSS variables set in the module settings. */
:root {
  --aaf-accent: #0089a9;
  --aaf-fab-bg: #0089a9;
  --aaf-fab-color: #fff;
  --aaf-radius: 8px;
  --aaf-drawer-width: 380px;
  --aaf-text: #1f2328;
  --aaf-muted: #6b7280;
  --aaf-line: #e6e8eb;
  --aaf-soft: #f4f6f8;
  --aaf-bg: #fff;
}

/* ---------------- block */
.aaf-block { position: relative; margin: 0 0 1.5rem; color: var(--aaf-text); }
.aaf-block.aaf-empty { display: none; }
.aaf-block .aaf-drawer-head, .aaf-block .aaf-drawer-foot { display: none; }
.aaf-block .aaf-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; z-index: 2; }
.aaf-block .aaf-progress span { position: absolute; top: 0; bottom: 0; width: 40%; background: var(--aaf-accent); animation: aaf-progress 1s ease-in-out infinite; }
.aaf-block.aaf-loading .aaf-progress { opacity: 1; }
@keyframes aaf-progress { from { left: -40%; } to { left: 100%; } }
.aaf-block.aaf-loading .aaf-filters { opacity: .6; pointer-events: none; }
.aaf-list-loading { opacity: .45; transition: opacity .15s; pointer-events: none; }

#search_filters.aaf-filters { background: var(--aaf-bg); padding: 0; margin: 0 0 1rem; box-shadow: none; transition: opacity .15s; }
.aaf-block:not(.aaf-in-drawer) #search_filters.aaf-filters { padding: 1.1rem 1.25rem .35rem; border-radius: var(--aaf-radius); }
.aaf-block:not(.aaf-in-drawer) #search_filters.aaf-filters:empty { display: none; }
.aaf-block:not(.aaf-in-drawer) .aaf-filters.aaf-bar-on > .aaf-chips { display: none; }
.aaf-block:not(.aaf-in-drawer) .aaf-facet:last-of-type { border-bottom: 0; }
.aaf-filters .aaf-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .25rem 0 .75rem; border-bottom: 1px solid var(--aaf-line); }
.aaf-filters .aaf-title { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.aaf-clear-all, .aaf-save { background: none; border: 0; padding: 0; font-size: .85rem; color: var(--aaf-accent); text-decoration: underline; cursor: pointer; }
.aaf-save { margin-left: auto; }

/* ---------------- chips */
.aaf-chips { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.aaf-chips li { margin: 0; }
.aaf-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .55rem; border-radius: 999px; background: var(--aaf-soft); border: 1px solid var(--aaf-line); color: var(--aaf-text); font-size: .8rem; line-height: 1.2; text-decoration: none; }
.aaf-chip:hover, .aaf-chip:focus { border-color: var(--aaf-accent); color: var(--aaf-text); text-decoration: none; }
.aaf-chip-group { color: var(--aaf-muted); }
.aaf-chip-x { font-size: 1rem; line-height: 1; margin-left: .15rem; color: var(--aaf-muted); }
.aaf-active-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.aaf-active-bar.hide { display: none; }
.aaf-active-bar .aaf-chips { margin: 0; align-items: center; }
.aaf-active-title { font-weight: 600; font-size: .9rem; }

/* ---------------- facet */
.aaf-facet { border-bottom: 1px solid var(--aaf-line); }
.aaf-facet-title { display: flex; align-items: center; width: 100%; gap: .5rem; padding: .85rem 0; margin: 0; background: none; border: 0; text-align: left; font: inherit; font-weight: 600; font-size: .95rem; color: var(--aaf-text); cursor: pointer; }
.aaf-facet-title:focus-visible { outline: 2px solid var(--aaf-accent); outline-offset: 2px; }
.aaf-facet-name { flex: 1 1 auto; }
.aaf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aaf-accent); flex: 0 0 auto; }
.aaf-caret { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; flex: 0 0 auto; opacity: .7; }
.aaf-collapsed .aaf-caret { transform: rotate(-45deg); }
.aaf-facet-body { padding: 0 0 .9rem; }
.aaf-collapsed .aaf-facet-body { display: none; }

.aaf-list { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; overscroll-behavior: contain; }
.aaf-item { margin: 0; padding: 0; }
.aaf-item.aaf-hidden { display: none; }
.aaf-expanded .aaf-item.aaf-hidden, .aaf-searching .aaf-item.aaf-hidden { display: block; }
.aaf-item.aaf-search-miss { display: none !important; }
.aaf-depth-1 { padding-left: 1.2rem; }
.aaf-depth-2 { padding-left: 2.4rem; }
.aaf-depth-3, .aaf-depth-4, .aaf-depth-5 { padding-left: 3.6rem; }
.aaf-option { display: flex; align-items: center; gap: .55rem; padding: .32rem .25rem; border-radius: 6px; color: var(--aaf-text); text-decoration: none; font-size: .9rem; line-height: 1.3; }
.aaf-option:hover, .aaf-option:focus { background: var(--aaf-soft); color: var(--aaf-text); text-decoration: none; }
.aaf-option:focus-visible { outline: 2px solid var(--aaf-accent); outline-offset: 1px; }
.aaf-disabled .aaf-option { opacity: .45; cursor: default; }
.aaf-disabled .aaf-option:hover { background: none; }
.aaf-box { flex: 0 0 18px; width: 18px; height: 18px; border: 1.5px solid #9aa1a9; background: #fff; position: relative; transition: all .15s; }
.aaf-box-check { border-radius: 4px; }
.aaf-box-radio { border-radius: 50%; }
.aaf-option.is-active .aaf-box { background: var(--aaf-accent); border-color: var(--aaf-accent); }
.aaf-option.is-active .aaf-box-check::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.aaf-option.is-active .aaf-box-radio::after { content: ""; position: absolute; left: 4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.aaf-color { flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.aaf-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.aaf-option.is-active .aaf-label { font-weight: 600; }
.aaf-count { flex: 0 0 auto; min-width: 1.8rem; padding: 0 .35rem; border-radius: 999px; background: var(--aaf-soft); color: var(--aaf-muted); font-size: .75rem; text-align: center; }
.aaf-more { margin: .45rem 0 0; padding: 0; background: none; border: 0; color: var(--aaf-accent); font-size: .85rem; font-weight: 600; cursor: pointer; }
.aaf-more .aaf-more-off, .aaf-expanded .aaf-more .aaf-more-on { display: none; }
.aaf-expanded .aaf-more .aaf-more-off { display: inline; }
.aaf-searching .aaf-more { display: none; }

.aaf-search-wrap { margin: 0 0 .5rem; }
.aaf-search { width: 100%; padding: .45rem .7rem; border: 1px solid var(--aaf-line); border-radius: var(--aaf-radius); font-size: .88rem; background: #fff; }
.aaf-search:focus { outline: none; border-color: var(--aaf-accent); box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.aaf-no-match { margin: .4rem 0 0; color: var(--aaf-muted); font-size: .85rem; }

.aaf-select { width: 100%; padding: .5rem .6rem; border: 1px solid var(--aaf-line); border-radius: var(--aaf-radius); background: #fff; font-size: .9rem; }

/* ---------------- swatches */
.aaf-swatches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.aaf-swatches .aaf-item { margin: 0; }
.aaf-swatch { display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 3.5rem; text-decoration: none; color: var(--aaf-text); font-size: .72rem; }
.aaf-swatch:hover, .aaf-swatch:focus { text-decoration: none; color: var(--aaf-text); }
.aaf-swatch-color { width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); background-size: cover; background-position: center; box-shadow: 0 0 0 2px #fff; transition: box-shadow .15s; display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--aaf-muted); }
.aaf-swatch-text { background: var(--aaf-soft); }
.aaf-swatch.is-active .aaf-swatch-color { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--aaf-accent); }
.aaf-swatch:focus-visible .aaf-swatch-color { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #555; }
.aaf-swatch-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.aaf-swatch.is-active .aaf-swatch-label { font-weight: 600; }
.aaf-disabled .aaf-swatch { opacity: .4; }

/* ---------------- slider */
.aaf-slider { padding: .25rem .2rem 0; }
.aaf-hist { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin: 0 9px 2px; }
.aaf-hist i { flex: 1 1 0; background: var(--aaf-accent); opacity: .22; border-radius: 2px 2px 0 0; min-height: 0; }
.aaf-range { position: relative; height: 26px; margin: 0 0 .5rem; }
.aaf-range-track { position: absolute; left: 9px; right: 9px; top: 11px; height: 4px; border-radius: 2px; background: var(--aaf-line); }
.aaf-range-fill { position: absolute; top: 0; bottom: 0; background: var(--aaf-accent); border-radius: 2px; }
.aaf-range input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 26px; margin: 0; padding: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; }
.aaf-range input[type=range].aaf-top { z-index: 3; }
.aaf-range input[type=range]:focus { outline: none; }
.aaf-range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 26px; }
.aaf-range input[type=range]::-moz-range-track { background: transparent; height: 26px; }
.aaf-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: #fff; border: 2px solid var(--aaf-accent); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; }
.aaf-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--aaf-accent); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; }
.aaf-range input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(0,0,0,.12); }
.aaf-range-inputs { display: flex; align-items: flex-end; gap: .4rem; }
.aaf-num { flex: 1 1 0; margin: 0; font-size: .72rem; color: var(--aaf-muted); font-weight: 400; text-align: left; }
.aaf-num span { display: block; margin: 0 0 .15rem; }
.aaf-num input { width: 100%; padding: .35rem .5rem; border: 1px solid var(--aaf-line); border-radius: var(--aaf-radius); font-size: .88rem; color: var(--aaf-text); -moz-appearance: textfield; }
.aaf-num input:focus { outline: none; border-color: var(--aaf-accent); }
.aaf-num-sep { padding-bottom: .45rem; color: var(--aaf-muted); }
.aaf-range-labels { display: flex; justify-content: space-between; margin: .35rem 0 0; font-size: .8rem; color: var(--aaf-muted); }

/* ---------------- buttons */
.aaf-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .5rem 1rem; border-radius: var(--aaf-radius); border: 1px solid transparent; font-weight: 600; font-size: .92rem; cursor: pointer; line-height: 1.2; }
.aaf-btn-primary { background: var(--aaf-accent); color: #fff; }
.aaf-btn-primary:hover { filter: brightness(.95); color: #fff; }
.aaf-btn-ghost { background: #fff; color: var(--aaf-text); border-color: var(--aaf-line); }
.aaf-btn[disabled] { opacity: .45; cursor: default; }
.aaf-loadmore { display: flex; margin: 1.25rem auto; min-width: 220px; }
.aaf-loadmore.is-loading { opacity: .6; }
.aaf-hide-pagination .pagination, .aaf-hide-pagination nav.pagination { display: none !important; }

/* apply button in column mode */
.aaf-block.aaf-apply-pending:not(.aaf-in-drawer) .aaf-drawer-foot { display: flex; position: sticky; bottom: 0; gap: .5rem; padding: .6rem 0; background: var(--aaf-bg); }
.aaf-block.aaf-apply-pending:not(.aaf-in-drawer) .aaf-drawer-foot .aaf-btn { flex: 1 1 0; }
.aaf-block.aaf-apply-pending:not(.aaf-in-drawer) .aaf-drawer-foot .aaf-btn-ghost { display: none; }
.aaf-block.aaf-apply-pending:not(.aaf-in-drawer) .aaf-drawer-foot { padding: .6rem 1.25rem; box-shadow: 0 -6px 12px -8px rgba(0,0,0,.18); border-radius: 0 0 var(--aaf-radius) var(--aaf-radius); }

/* ---------------- drawer */
.aaf-drawer { position: fixed; top: 0; bottom: 0; z-index: 1060; width: min(var(--aaf-drawer-width), 92vw); background: var(--aaf-bg); box-shadow: 0 0 30px rgba(0,0,0,.18); display: flex; flex-direction: column; transition: transform .28s ease; visibility: hidden; }
.aaf-drawer-left { left: 0; transform: translateX(-105%); }
.aaf-drawer-right { right: 0; transform: translateX(105%); }
.aaf-drawer-open .aaf-drawer { transform: none; visibility: visible; }
.aaf-backdrop { position: fixed; inset: 0; z-index: 1055; background: rgba(15,20,25,.45); opacity: 0; visibility: hidden; transition: opacity .25s; }
.aaf-drawer-open .aaf-backdrop { opacity: 1; visibility: visible; }
html.aaf-drawer-open, html.aaf-drawer-open body { overflow: hidden; }
html.aaf-drawer-open body { padding-right: var(--aaf-sbw, 0); }
.aaf-drawer .aaf-block { display: flex; flex-direction: column; height: 100%; margin: 0; }
.aaf-drawer .aaf-block.aaf-empty { display: flex; }
.aaf-drawer .aaf-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--aaf-line); padding-top: calc(.9rem + env(safe-area-inset-top, 0px)); }
.aaf-drawer-title { font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .02em; }
.aaf-drawer-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--aaf-soft); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--aaf-text); }
.aaf-drawer .aaf-block-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: .25rem 1rem 1rem; -webkit-overflow-scrolling: touch; }
.aaf-drawer .aaf-filters .aaf-head .aaf-title { display: none; }
.aaf-drawer .aaf-filters .aaf-head { border-bottom: 0; padding-bottom: 0; }
.aaf-drawer .aaf-drawer-foot { display: flex; gap: .6rem; padding: .75rem 1rem; padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--aaf-line); background: var(--aaf-bg); }
.aaf-drawer .aaf-drawer-foot .aaf-btn-ghost { flex: 0 0 auto; }
.aaf-drawer .aaf-drawer-foot .aaf-btn-primary { flex: 1 1 auto; }
.aaf-drawer .aaf-list { max-height: none; }
.aaf-drawer .aaf-option { padding-top: .5rem; padding-bottom: .5rem; }

/* ---------------- floating button */
.aaf-fab { position: fixed; z-index: 1040; top: 58%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: 0 1rem 0 .85rem; border: 0; border-radius: 999px; background: var(--aaf-fab-bg); color: var(--aaf-fab-color); font-weight: 700; font-size: .9rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; touch-action: none; user-select: none; }
.aaf-fab-right { right: 12px; }
.aaf-fab-left { left: 12px; }
.aaf-fab:focus { outline: none; }
.aaf-fab:focus-visible { outline: 3px solid rgba(0,0,0,.35); outline-offset: 2px; }
.aaf-fab-hidden, .aaf-drawer-open .aaf-fab { display: none; }
.aaf-fab-badge { display: none; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: var(--aaf-fab-bg); font-size: .75rem; line-height: 20px; text-align: center; }
.aaf-fab-badge.is-on { display: inline-block; }
html.aaf-busy .aaf-fab { opacity: .85; }
@media (max-width: 420px) { .aaf-fab-text { display: none; } .aaf-fab { padding: 0 .8rem; } }

/* "Filters" button above the list (drawer on large screens without floating button) */
.aaf-inline-bar { margin: 0 0 1rem; }
.aaf-inline-bar[hidden] { display: none; }
.aaf-inline-toggle { min-height: 40px; }
.aaf-inline-toggle .aaf-fab-badge { background: var(--aaf-accent); color: #fff; }

/* the theme's own filter wrapper is not used */
html.aaf-ready #search_filters_wrapper, body:has(#aaf-block) #search_filters_wrapper { display: none !important; }

.aaf-debug { margin: .5rem 0 0; font-size: .75rem; color: var(--aaf-muted); }
.aaf-block .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  .aaf-drawer, .aaf-backdrop, .aaf-caret, .aaf-box { transition: none; }
  .aaf-block .aaf-progress span { animation: none; left: 0; width: 100%; }
}
