/* ──────────────────────────────────────────────────────────────
   [product_filter] — productfilter-zijbalk (in-place filtering).
   Filtert de producten van de Divi WooCommerce/Shop-module op de pagina.
   Huisstijl: primair #2D3E7C, accent #FFC943, font Outfit.
   ────────────────────────────────────────────────────────────── */

.junnect-pf {
    --pf-primary: #2D3E7C;
    --pf-accent: #FFC943;
    --pf-ink: #121212;
    --pf-ink-soft: #414141;
    --pf-muted: #717171;
    --pf-rule: #dbdad9;
    --pf-box: #e7e7e7;
    font-family: 'Outfit', sans-serif;
}

.junnect-pf *,
.junnect-pf *::before,
.junnect-pf *::after {
    box-sizing: border-box;
}

/* ── zijbalkpaneel ───────────────────────────────────────────── */
.junnect-pf__panel {
    width: 280px;
    max-width: 100%;
}

.junnect-pf__form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 0;
}

/* ── header: "Filters | <n> RESULTATEN GEVONDEN" ─────────────── */
.junnect-pf__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.junnect-pf__header-title,
.junnect-pf__header-count {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    line-height: 1.2;
    color: var(--pf-ink-soft);
    text-transform: uppercase;
}

.junnect-pf__header-title {
    font-weight: 600;
}

.junnect-pf__header-divider {
    width: 1px;
    height: 19px;
    background: var(--pf-ink-soft);
    flex: 0 0 auto;
}

.junnect-pf__header-count {
    flex: 1 1 auto;
}

.junnect-pf__panel-close {
    display: none;
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: var(--pf-ink-soft);
    cursor: pointer;
    padding: 0 4px;
}

.junnect-pf__notice {
    margin: 0;
    color: var(--pf-muted);
    font-size: 14px;
}

/* ── filtersecties ───────────────────────────────────────────── */
.junnect-pf__section {
    border-top: 1px solid var(--pf-rule);
    padding-top: 24px;
}

/* horizontale streep ook boven de eerste sectie na de header */
.junnect-pf__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.junnect-pf__section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--pf-ink);
    text-transform: uppercase;
}

.junnect-pf__chevron {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    transition: transform 180ms ease;
}

/* chevron wijst standaard omlaag (ingeklapt); omhoog wanneer open */
.junnect-pf__section.is-open .junnect-pf__chevron {
    transform: rotate(180deg);
}

.junnect-pf__section-body {
    margin-top: 16px;
    overflow: hidden;
}

.junnect-pf__section:not(.is-open) .junnect-pf__section-body {
    display: none;
}

/* ── checkbox-rijen ──────────────────────────────────────────── */
.junnect-pf__options {
    /* !important: de zijbalk staat doorgaans in een Divi Text-module, die
       ul/li in content-gebieden met list-style-type: disc style't en zo
       opsommingstekens forceert. */
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.junnect-pf__option {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.junnect-pf__option::marker {
    content: "";
}

.junnect-pf__checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* het echte vinkje verbergen, eigen vakje tonen */
.junnect-pf__checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.junnect-pf__checkbox-box {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid var(--pf-muted);
    border-radius: 2px;
    background: #fff;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.junnect-pf__checkbox-box svg {
    width: 10px;
    height: 9px;
    opacity: 0;
    transition: opacity 120ms ease;
}

.junnect-pf__checkbox input:checked + .junnect-pf__checkbox-box {
    background: var(--pf-primary);
    border-color: var(--pf-primary);
}

.junnect-pf__checkbox input:checked + .junnect-pf__checkbox-box svg {
    opacity: 1;
}

.junnect-pf__checkbox input:focus-visible + .junnect-pf__checkbox-box {
    outline: 2px solid var(--pf-accent);
    outline-offset: 2px;
}

.junnect-pf__checkbox-label {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    line-height: 1.3;
    color: var(--pf-ink);
}

.junnect-pf__checkbox-count {
    color: var(--pf-muted);
}

/* ── prijsfilter ─────────────────────────────────────────────── */
.junnect-pf__price {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* dual-range slider */
.junnect-pf__range {
    position: relative;
    height: 24px;
}

.junnect-pf__range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    transform: translateY(-50%);
    background: var(--pf-rule);
    border-radius: 2px;
}

.junnect-pf__range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--pf-primary);
    border-radius: 2px;
}

/* beide range-inputs liggen over elkaar; alleen de duimen vangen events */
.junnect-pf__range-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    background: none;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

.junnect-pf__range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pf-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.junnect-pf__range-input::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pf-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.junnect-pf__range-input::-webkit-slider-runnable-track {
    background: none;
}

.junnect-pf__range-input::-moz-range-track {
    background: none;
}

/* waardevakken: [€ 0] – [€ 999] */
.junnect-pf__price-values {
    display: flex;
    align-items: center;
    gap: 8px;
}

.junnect-pf__price-box {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    background: var(--pf-box);
    border-radius: 6px;
    padding: 10px 20px;
}

.junnect-pf__price-symbol {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    color: #0e0e0e;
    flex: 0 0 auto;
}

.junnect-pf__price-value {
    width: 100%;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    color: #0e0e0e;
    padding: 0;
}

.junnect-pf__price-value:focus {
    outline: none;
}

.junnect-pf__price-dash {
    flex: 0 0 auto;
    color: #0e0e0e;
    font-size: 18px;
}

/* ── acties ──────────────────────────────────────────────────── */
.junnect-pf__actions {
    border-top: 1px solid var(--pf-rule);
    padding-top: 24px;
}

.junnect-pf__clear {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--pf-primary);
    border-radius: 6px;
    background: #fff;
    color: var(--pf-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.junnect-pf__clear:hover {
    background: var(--pf-primary);
    color: #fff;
}

/* ── laadstatus over de productlijst van de pagina ───────────── */
.junnect-pf-loading {
    position: relative;
}

.junnect-pf-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0.7);
}

.junnect-pf-loading::before {
    content: "";
    position: absolute;
    top: 60px;
    left: 50%;
    z-index: 6;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border: 3px solid var(--pf-rule);
    border-top-color: var(--pf-primary);
    border-radius: 50%;
    animation: junnect-pf-spin 0.7s linear infinite;
}

@keyframes junnect-pf-spin {
    to { transform: rotate(360deg); }
}

/* ── lege staat ──────────────────────────────────────────────── */
.junnect-pf-empty {
    margin: 24px 0;
    padding: 28px;
    text-align: center;
    color: var(--pf-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
}

/* ── "Meer laden"-knop (door JS toegevoegd na de productlijst) ── */
.junnect-pf-loadmore-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 32px 0;
}

.junnect-pf-loadmore {
    padding: 13px 38px;
    border: none;
    border-radius: 6px;
    background: var(--pf-primary);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 150ms ease;
}

.junnect-pf-loadmore:hover {
    opacity: 0.9;
}

.junnect-pf-loadmore[disabled] {
    opacity: 0.55;
    cursor: default;
}

/* ── mobiele filterknop ──────────────────────────────────────── */
.junnect-pf__mobile-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    background: var(--pf-primary);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.junnect-pf__mobile-toggle-icon {
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 5h18M6 12h12M10 19h4'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 5h18M6 12h12M10 19h4'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── responsief: offcanvas-paneel op mobiel ──────────────────── */
@media (max-width: 980px) {
    .junnect-pf__mobile-toggle {
        display: inline-flex;
    }

    .junnect-pf__panel {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100000;
        width: min(340px, 88vw);
        height: 100%;
        padding: 24px 20px;
        background: #fff;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 220ms ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
    }

    .junnect-pf.is-panel-open .junnect-pf__panel {
        transform: translateX(0);
    }

    .junnect-pf__panel-close {
        display: inline-block;
        margin-left: auto;
    }

    /* overlay achter het offcanvas-paneel */
    .junnect-pf.is-panel-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 99999;
        background: rgba(0, 0, 0, 0.45);
    }
}

/* ──────────────────────────────────────────────────────────────
   Gefilterd productraster — behoud het kolomaantal van de Divi-module.
   De via AJAX teruggegeven WooCommerce-loopmarkup valt anders terug op
   het WooCommerce-catalogusaantal (vaak 2 of 4) i.p.v. de kolommen die
   de Divi Shop-module toont. assets/js/product-filter.js meet het
   bestaande raster op en zet --junnect-pf-cols; dit grid forceert dat
   aantal. Te overschrijven met het shortcode-attribuut columns="3".
   ────────────────────────────────────────────────────────────── */
.junnect-pf-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--junnect-pf-cols, 3), minmax(0, 1fr));
    gap: 32px 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.junnect-pf-grid > li.product {
    width: auto !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 0;
    list-style: none !important;
    float: none !important;
    clear: none !important;
}

/* WooCommerce/Divi voegt aan ul.products een clearfix toe via ::before en
   ::after. In een grid-container worden die pseudo-elementen zelf grid-items
   en nemen ze cellen in beslag (spookitems). Uitschakelen zolang het grid
   actief is. */
.junnect-pf-grid::before,
.junnect-pf-grid::after {
    content: none !important;
    display: none !important;
}

@media (max-width: 768px) {
    .junnect-pf-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 16px;
    }
}

@media (max-width: 480px) {
    .junnect-pf-grid {
        grid-template-columns: 1fr;
    }
}
