/* ═══════════════════════════════════════════════════════════════════════
   oms-rd-listfilters.css — round 8 (r8-visorders). Paired with
   /js/oms-rd-listfilters.js, which builds the markup these rules draw:
   the list filter bar (one row, scrolls inside itself), the pinned
   Filters + Sort controls, the customiser + "More filters" popovers and
   the active-filter chips. Same look as the Products list's bar
   (oms-rd-products.css §1), keyed on the .rlf-bar class the module adds,
   so it serves any list that attaches it (Orders, Visuals).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Bar ─────────────────────────────────────────────────────────────── */
.rd .ord-toolbar.rlf-bar{flex-wrap:nowrap;gap:8px}
.rd .ord-toolbar.rlf-bar > *{flex:none}
.rd .ord-toolbar.rlf-bar > .toolbar-spacer{display:none}
.rd .ord-toolbar.rlf-bar > .rlf-scroll{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px;overflow-x:auto;overflow-y:hidden;padding:3px;margin:-3px;scrollbar-width:none;overscroll-behavior-x:contain}
.rd .rlf-scroll::-webkit-scrollbar{display:none}
.rd .rlf-scroll > *{flex:none}
.rd .rlf-scroll.fade-r{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 36px),transparent)}
.rd .rlf-scroll.fade-l{-webkit-mask-image:linear-gradient(90deg,transparent,#000 36px);mask-image:linear-gradient(90deg,transparent,#000 36px)}
.rd .rlf-scroll.fade-l.fade-r{-webkit-mask-image:linear-gradient(90deg,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(90deg,transparent,#000 36px,#000 calc(100% - 36px),transparent)}
.rd .rlf-scroll .search-input{flex:1 0 180px;min-width:180px;max-width:340px}
.rd .rlf-slots{display:flex;align-items:center;gap:8px;flex:none}
.rd .rlf-f{flex:none;min-width:0;position:relative}
.rd .rlf-f[data-w="s"]{width:124px}
.rd .rlf-f[data-w="m"]{width:150px}
.rd .rlf-f[data-w="l"]{width:200px}
.rd .rlf-f[hidden]{display:none}
.rd .rlf-f .filter-select{width:100%;min-width:0;text-overflow:ellipsis}
.rd .rlf-f.is-tog .toggle-switch{white-space:nowrap;margin:0}
/* An active filter is tinted, the way Products marks its own. */
.rd .rlf-f.rlf-on .filter-select,.rd .rlf-sort.rlf-on{border-color:#AEB6F5;background-color:var(--accent-soft);color:#2A37B8;font-weight:700}
.rd .rlf-f.is-tog.rlf-on .toggle-switch{color:#2A37B8;font-weight:700}
.rd .ord-toolbar.rlf-bar > .rlf-pin{display:flex;align-items:center;gap:8px;flex:none;margin-left:auto}
.rd .rlf-sort{width:auto;min-width:0;max-width:210px}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.rd .rlf-btn{height:36px;padding:0 12px;gap:7px;font-size:13px;font-weight:700;color:var(--ink-2)}
.rd .rlf-btn svg{width:16px;height:16px;flex:none}
.rd .rlf-btn[aria-expanded="true"]{border-color:var(--accent);color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.rd .rlf-btn .rlf-n{min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--accent);color:#fff;font-size:11px;font-weight:800;display:inline-grid;place-items:center;font-variant-numeric:tabular-nums}
.rd .rlf-btn .rlf-n[hidden]{display:none}
.rd .rlf-btn.rlf-more[hidden]{display:none}
.rd .rlf-btn .rlf-chev{width:14px;height:14px;margin-left:-2px;color:var(--muted)}

/* ── Popovers ────────────────────────────────────────────────────────── */
.rd .rlf-pop{position:absolute;z-index:60;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 48px rgba(20,24,60,.18),0 2px 6px rgba(20,24,60,.06);display:flex;flex-direction:column;max-height:min(560px,calc(var(--rd-vh, 100vh) - 180px));overflow:hidden}
.rd .rlf-pop[hidden]{display:none}
.rd .rlf-pop-h{padding:14px 16px 10px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line)}
.rd .rlf-pop-h h3{margin:0;font-size:14.5px;font-weight:800;line-height:1.3}
.rd .rlf-pop-h p{margin:3px 0 0;font-size:12px;color:var(--muted);font-weight:500;line-height:1.4}
.rd .rlf-pop-b{padding:8px;overflow-y:auto;min-height:0}
.rd .rlf-pop-f{padding:10px 12px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--sunk)}
.rd .rlf-pop-acts{display:flex;gap:6px}
.rd .rlf-x{width:30px;height:30px;border-radius:8px;border:0;background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;flex:none}
.rd .rlf-x:hover{background:var(--sunk);color:var(--ink)}
.rd .rlf-x svg{width:16px;height:16px}

/* Customiser */
.rd .rlf-cust-pop{width:410px}
.rd .rlf-meter{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;color:var(--ink-2);white-space:nowrap}
.rd .rlf-meter i{display:inline-flex;gap:3px}
.rd .rlf-meter i b{width:14px;height:6px;border-radius:3px;background:var(--line-2)}
.rd .rlf-meter i b.on{background:var(--accent)}
.rd .rlf-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.rd .rlf-item{display:grid;grid-template-columns:24px 20px minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 8px;border-radius:10px;border:1px solid transparent;background:var(--surface);transition:background .12s,border-color .12s}
.rd .rlf-item:hover{background:var(--sunk)}
.rd .rlf-item.is-off .rlf-name{color:var(--muted)}
.rd .rlf-item.is-na{opacity:.55}
.rd .rlf-item.is-drag{opacity:.35}
.rd .rlf-item.is-over-before{box-shadow:inset 0 2px 0 var(--accent)}
.rd .rlf-item.is-over-after{box-shadow:inset 0 -2px 0 var(--accent)}
.rd .rlf-grip{width:24px;height:28px;border:0;background:transparent;border-radius:6px;color:#9CA1BD;cursor:grab;display:grid;place-items:center;padding:0}
.rd .rlf-grip:hover,.rd .rlf-grip:focus-visible{color:var(--ink);background:#EDEFF6;outline:none}
.rd .rlf-grip:active{cursor:grabbing}
.rd .rlf-grip svg{width:14px;height:14px}
/* Themed checkbox — no native box. */
.rd input.rlf-cb{-webkit-appearance:none;appearance:none;width:18px;height:18px;margin:0;border:1.5px solid var(--line-2,#C9CEDD);border-radius:5px;background:#fff center/12px 12px no-repeat;cursor:pointer;transition:background-color .12s,border-color .12s;flex:none}
.rd input.rlf-cb:hover{border-color:var(--accent)}
.rd input.rlf-cb:checked{background-color:var(--accent);border-color:var(--accent);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")}
.rd input.rlf-cb:focus-visible{outline:none;box-shadow:0 0 0 3px var(--accent-soft)}
.rd input.rlf-cb:disabled{cursor:not-allowed;opacity:.45}
.rd .rlf-name{font-size:13.5px;font-weight:700;color:var(--ink);cursor:pointer;min-width:0;display:flex;flex-direction:column;gap:1px}
.rd .rlf-name small{font-size:11.5px;font-weight:600;color:var(--muted)}
.rd .rlf-name small.on{color:var(--accent)}
.rd .rlf-wseg{display:inline-flex;padding:2px;border-radius:8px;background:#E8EAF2;gap:2px}
.rd .rlf-wseg.is-na{padding:0 9px;height:28px;align-items:center;font-size:11px;font-weight:700;color:var(--muted);background:transparent;border:1px dashed var(--line-2,#C9CEDD)}
.rd .rlf-wseg button{height:24px;min-width:28px;padding:0 6px;border:0;border-radius:6px;background:transparent;font-family:inherit;font-size:11.5px;font-weight:800;color:var(--muted);cursor:pointer}
.rd .rlf-wseg button[aria-pressed="true"]{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(20,24,60,.14)}
.rd .rlf-wseg button:disabled{cursor:not-allowed;opacity:.5}
.rd .rlf-wseg button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.rd .rlf-hint{margin:6px 8px 4px;font-size:12px;color:var(--warn);font-weight:600}
.rd .rlf-hint[hidden]{display:none}
.rd .rlf-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* More filters */
.rd .rlf-more-pop{width:300px}
.rd .rlf-more-list{display:flex;flex-direction:column;gap:12px;padding:6px 8px 8px}
.rd .rlf-more-row{display:flex;flex-direction:column;gap:5px}
.rd .rlf-more-row > label{font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:700}
.rd .rlf-more-row .rlf-f{width:100%}
.rd .rlf-empty{padding:18px 10px;text-align:center;font-size:12.5px;color:var(--muted);font-weight:600}

/* ── Chips ───────────────────────────────────────────────────────────── */
.rd .rlf-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:9px 16px;border-bottom:1px solid var(--line);background:#FAFBFE;font-size:12.5px}
.rd .rlf-chips[hidden]{display:none}
.rd .rlf-chips .rlf-chips-l{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:700;margin-right:2px}
.rd .rlf-chip{display:inline-flex;align-items:center;gap:4px;height:26px;padding:0 4px 0 10px;border-radius:7px;background:var(--accent-soft);color:#2A37B8;font-size:12px;font-weight:700;max-width:280px}
.rd .rlf-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rd .rlf-chip em{font-style:normal;font-weight:600;color:#5A66D6}
.rd .rlf-chip button{width:20px;height:20px;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;display:grid;place-items:center;padding:0;flex:none}
.rd .rlf-chip button:hover,.rd .rlf-chip button:focus-visible{background:rgba(61,78,232,.14);outline:none}
.rd .rlf-chip button svg{width:12px;height:12px}
.rd .rlf-clear{border:0;background:transparent;font-family:inherit;font-size:12.5px;font-weight:700;color:var(--accent);cursor:pointer;padding:4px 6px;border-radius:6px}
.rd .rlf-clear:hover{background:var(--accent-soft)}
.rd .rlf-res{margin-left:auto;color:var(--muted);font-weight:600;white-space:nowrap}

/* ── Phone ───────────────────────────────────────────────────────────── */
/* Same breakpoints as the Products bar this was taken from. */
@media (max-width:900px){
  .rd .ord-toolbar.rlf-bar{padding:10px 12px}
  .rd .rlf-chips{padding:8px 12px}
}
@media (max-width:600px){
  /* The scrolling filters get the whole first row; Filters + Sort sit on a
     second row of their own. */
  .rd .ord-toolbar.rlf-bar{flex-wrap:wrap;row-gap:10px}
  .rd .ord-toolbar.rlf-bar > .rlf-scroll{flex:1 1 100%}
  .rd .ord-toolbar.rlf-bar > .rlf-pin{flex:1 1 100%;margin-left:0}
  .rd .rlf-pin .rlf-sort{flex:1 1 auto;width:auto;max-width:none}
  .rd .rlf-scroll .search-input{flex-basis:200px;min-width:200px}
  .rd .rlf-btn{padding:0 10px}
  .rd .rlf-cust-pop,.rd .rlf-more-pop{width:auto}
  .rd .rlf-res{margin-left:0;width:100%}
}

/* ── Sortable column headers (sort.cols) ─────────────────────────────── */
.rd th.rlf-th{cursor:pointer;user-select:none}
.rd th.rlf-th:hover{color:var(--ink)}
.rd th .rlf-ind{font-size:9px;margin-left:4px;color:var(--accent);vertical-align:1px}
