/* ============================================================
   Listing — Dyski with filters (WIN v2)
   ============================================================ */

.list-grid { display: grid; grid-template-columns: 268px 1fr; gap: clamp(22px, 3vw, 40px); align-items: start; position: relative; }
/* Sticky sidebar that scrolls within the viewport when the filter list is
   taller than the screen (types + brands + price + 4 flight sliders). */
.filters { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; padding-right: 2px; }
.filters::-webkit-scrollbar { width: 8px; }
.filters::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
.filters::-webkit-scrollbar-track { background: transparent; }

/* AJAX refresh: dim the grid briefly while the new results load. */
.list-grid.is-loading { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* toolbar above grid */
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.list-count { font-size: 14.5px; color: var(--text-2); }
.list-count b { color: #fff; }
.list-bar-right { display: flex; align-items: center; gap: 10px; }
.sortsel { position: relative; }
.sortsel select { appearance: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; color: var(--text); padding: 11px 40px 11px 18px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; outline: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238A8A98' stroke-width='2'%3E%3Cpath d='M5 7l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.sortsel select:focus { border-color: var(--violet); }
.filter-toggle { display: none; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; }
.filter-toggle .fcount { background: var(--grad); color: #fff; font-size: 11px; font-weight: 800; min-width: 19px; height: 19px; border-radius: 999px; display: grid; place-items: center; padding: 0 5px; }

/* filter panel */
.fpanel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.fpanel-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.fpanel-top h2 { font-family: 'Saira Condensed', sans-serif; text-transform: uppercase; letter-spacing: .03em; font-size: 18px; margin: 0; }
.fclear { font-size: 12.5px; font-weight: 600; color: var(--violet); }
.fclear:hover { color: var(--magenta); }
.fgroup { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.fgroup:last-child { border-bottom: none; }
.fgroup > h3 { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0 0 14px; }
.fopt { display: flex; align-items: center; gap: 11px; padding: 7px 0; cursor: pointer; font-size: 14.5px; color: var(--text-2); transition: color .15s; }
.fopt:hover { color: #fff; }
.fopt input { position: absolute; opacity: 0; pointer-events: none; }
.fopt .cbox { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); flex-shrink: 0; display: grid; place-items: center; color: #fff; transition: .15s; }
.fopt input:checked + .cbox { background: var(--grad); border-color: transparent; }
.fopt input:checked + .cbox svg { opacity: 1; }
.fopt .cbox svg { opacity: 0; }
.fopt input:checked ~ .ftxt { color: #fff; }
.fopt .fnum { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* price range */
.range-vals { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--text); font-weight: 600; margin-bottom: 12px; }
.range-vals span { padding: 5px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.range-wrap { position: relative; height: 30px; }
.range-track { position: absolute; top: 13px; left: 0; right: 0; height: 5px; border-radius: 999px; background: var(--surface-3); }
.range-fill { position: absolute; top: 13px; height: 5px; border-radius: 999px; background: var(--grad); }
.range-wrap input[type=range] { position: absolute; top: 0; left: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 30px; }
.range-wrap input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--violet); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.5); margin-top: 0; }
.range-wrap input[type=range]::-moz-range-thumb { pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--violet); cursor: pointer; }
.range-wrap input[type=range]::-webkit-slider-runnable-track { height: 30px; background: none; }
.range-wrap input[type=range]::-moz-range-track { height: 30px; background: none; }

/* chips (active filters) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px 7px 13px; border-radius: 999px; background: rgba(168,85,247,.12); border: 1px solid rgba(168,85,247,.35); font-size: 13px; font-weight: 600; color: var(--text); }
.chip button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); color: var(--text-2); font-size: 11px; }
.chip button:hover { background: var(--magenta); color: #fff; }

/* product grid (reuses .card) */
.list-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.list-empty { padding: 70px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.list-empty h3 { font-family: 'Saira Condensed', sans-serif; font-size: 26px; margin: 0 0 8px; }

/* mobile filter drawer scrim */
.fdrawer-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.fdrawer-scrim.open { opacity: 1; pointer-events: auto; }
.fdrawer-close { display: none; }

@media (max-width: 1100px) {
  .list-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .list-grid { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .filters {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(88vw, 360px); z-index: 81;
    transform: translateX(-102%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto; background: var(--bg-2); padding: 0;
  }
  .filters.open { transform: none; }
  .fpanel { border: none; border-radius: 0; min-height: 100%; }
  .fdrawer-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text-2); background: var(--surface); }
}
@media (max-width: 560px) {
  .list-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
}
