/**
 * Category page v3 — filter panel (desktop column, artboard Categorie-desktop/-racesturen)
 * and the same form inside the mobile drawer (artboard Filterlade-mobiel).
 *
 * One form, two places: ≥ 1024 px it sits in the sticky column, below that categorie-v3.js
 * moves it into <dialog class="lade lade--onder cat3-lade">. Tokens only (theme-vars.css);
 * --cat3-knop / --cat3-knop-tekst come from _categorie-v3.css.
 */

.cat3-paneel__kop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
}

.cat3-paneel__chips { display: none !important; }

.cat3-paneel__kop h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); }

/* ── Groups ────────────────────────────────────────────────────────────────── */

.cat3-fg,
.cat3-meer { border-top: 1px solid var(--border); }

.cat3-meer { border-bottom: 1px solid var(--border); }
.cat3-meer .cat3-fg:first-child { border-top: 0; }

.cat3-fg__kop {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 0;
    list-style: none;
    cursor: pointer;
}

.cat3-fg__kop::-webkit-details-marker { display: none; }
.cat3-fg__kop h3 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cat3-fg__hint { display: none; flex-shrink: 0; font-size: 13px; font-weight: 400; color: var(--text-zwak); }
.cat3-fg__pijl { flex-shrink: 0; width: 16px; height: 16px; color: var(--text-zwak); transition: transform 0.15s ease; }
details[open] > .cat3-fg__kop .cat3-fg__pijl { transform: rotate(180deg); }
.cat3-fg__body { padding: 0 0 14px; }

.cat3-meer__namen {
    display: block;
    flex: 0 1 auto;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat3-meer[open] > .cat3-fg__kop .cat3-meer__namen { display: none; }
.cat3-meer__body { padding-left: 12px; border-left: 2px solid var(--bg-tertiary); margin-bottom: 8px; }

/* ── Options ───────────────────────────────────────────────────────────────── */

.cat3-opties { margin: 0; padding: 0; list-style: none; }

.cat3-ck {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.cat3-ck input { flex-shrink: 0; width: 18px; height: 18px; margin: 0; accent-color: var(--cat3-knop); cursor: pointer; }
.cat3-ck__label { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.cat3-ck:hover .cat3-ck__label { color: var(--text-primary); }
.cat3-ck input:checked + .cat3-ck__label { font-weight: 600; color: var(--text-primary); }

.cat3-ck small,
.cat3-sw small {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-zwak);
}

.cat3-ck [hidden],
.cat3-opties li[hidden] { display: none; }

.cat3-alle > summary {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 2px 0;
    list-style: none;
    font-size: 13px;
    color: var(--brand);
    cursor: pointer;
}

.cat3-alle > summary::-webkit-details-marker { display: none; }
.cat3-alle > summary:hover { text-decoration: underline; }
.cat3-alle__open, .cat3-alle[open] .cat3-alle__dicht { display: none; }
.cat3-alle[open] .cat3-alle__open { display: inline; }

.cat3-zoek {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    margin-bottom: 6px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-zwak);
}

.cat3-zoek:focus-within { border-color: var(--accent); }
.cat3-zoek svg { flex-shrink: 0; width: 14px; height: 14px; }

.cat3-zoek input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    color: var(--text-primary);
}

/* ── Range ─────────────────────────────────────────────────────────────────── */

.cat3-bereik { display: flex; align-items: center; gap: 8px; }
.cat3-bereik__tot { flex-shrink: 0; color: var(--text-zwak); }

.cat3-veld {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 4px;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    font-size: 14px;
    color: var(--text-zwak);
}

.cat3-veld:focus-within { border-color: var(--accent); }

.cat3-veld input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    color: var(--text-primary);
    -moz-appearance: textfield;
    appearance: textfield;
}

.cat3-veld input::-webkit-outer-spin-button,
.cat3-veld input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.cat3-veld input::placeholder { color: var(--text-zwak); opacity: 1; }
.cat3-veld__voor, .cat3-veld__na { flex-shrink: 0; }

/* ── Presets ───────────────────────────────────────────────────────────────── */

.cat3-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }

.cat3-preset {
    height: 36px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text-primary);
    cursor: pointer;
}

.cat3-preset:hover { border-color: var(--text-zwak); }
.cat3-preset[aria-pressed="true"] { border-color: var(--cat3-knop); background: var(--cat3-knop); font-weight: 600; color: var(--cat3-knop-tekst); }

/* ── Switch (stock, yes/no) ────────────────────────────────────────────────── */

.cat3-sw {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.cat3-fg--janee .cat3-sw { margin-top: 0; }
.cat3-sw__label { flex: 1 1 auto; min-width: 0; }
.cat3-sw small { margin-left: 0; }

.cat3-sw input[role="switch"] {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 22px;
    margin: 0;
    border: 1px solid var(--text-zwak);
    border-radius: 11px;
    background: var(--bg-tertiary);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease;
}

.cat3-sw input[role="switch"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-zwak);
    transition: transform 0.15s ease;
}

.cat3-sw input[role="switch"]:checked { border-color: var(--cat3-knop); background: var(--cat3-knop); }
.cat3-sw input[role="switch"]:checked::before { background: var(--cat3-knop-tekst); transform: translateX(16px); }

.cat3-dekking {
    margin: 12px 0 0;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.cat3-toepassen { width: 100%; margin-top: 12px; background: var(--bg-secondary); }
.cat3-js .cat3-toepassen { display: none; }

/* ── The drawer (< 1024 px) ────────────────────────────────────────────────── */

.cat3-lade { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-display); }
.cat3-lade .lade__titel { font-size: 20px; }
.cat3-lade .lade__kop { padding: 8px 8px 8px 16px; }
.cat3-lade .cat3-paneel__kop { display: none; }

.cat3-lade .cat3-paneel__chips {
    display: flex !important;
    flex-wrap: nowrap;
    margin: 0;
    padding: 12px 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.cat3-lade .cat3-paneel__chips .cat3-chip { flex-shrink: 0; min-height: 36px; border-radius: 18px; white-space: nowrap; }
.cat3-lade .cat3-groepen { padding: 0 16px 16px; }
.cat3-lade .cat3-fg:first-child { border-top: 0; }
.cat3-lade .cat3-fg__kop { min-height: 52px; }
.cat3-lade .cat3-fg__kop h3 { font-size: 16px; }
.cat3-lade .cat3-fg__hint { display: block; }
.cat3-lade .cat3-meer__namen { display: none; }
.cat3-lade .cat3-meer__body { padding-left: 0; border-left: 0; }
.cat3-lade .cat3-ck { min-height: 44px; font-size: 15px; }
.cat3-lade .cat3-ck input { width: 20px; height: 20px; }
.cat3-lade .cat3-ck small { font-size: 13px; }
.cat3-lade .cat3-sw { min-height: 44px; font-size: 15px; }
.cat3-lade .cat3-alle > summary { min-height: 44px; font-size: 14px; }
.cat3-lade .cat3-zoek, .cat3-lade .cat3-veld, .cat3-lade .cat3-preset { height: 44px; }
.cat3-lade .cat3-zoek input, .cat3-lade .cat3-veld input { font-size: 16px; }
.cat3-lade .cat3-toepassen { display: none; }
.cat3-lade__voet { padding: 12px 16px 24px; }
.cat3-lade__voet .cat3-knop { min-height: 48px; font-size: 15px; font-weight: 400; }
.cat3-lade__voet .cat3-knop--primair { flex: 1 1 auto; font-size: 16px; font-weight: 700; }

/* Touch: targets at least 44 px in the column as well. */
@media (pointer: coarse) {
    .cat3-ck, .cat3-sw, .cat3-alle > summary, .cat3-lade .cat3-paneel__chips .cat3-chip { min-height: 44px; }
    .cat3-preset, .cat3-veld, .cat3-zoek { height: 44px; }
    .cat3-paneel__kop .cat3-link { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .cat3-fg__pijl, .cat3-sw input[role="switch"], .cat3-sw input[role="switch"]::before { transition: none; }
}
