/**
 * Product Filters — styling voor [mpf_filter] en [mpf_active_filters].
 */

/* Wrapper */
.mpf-filter {
    margin-bottom: 1.5rem;
}

/* Titel */
.mpf-filter__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Checkboxes lijst */
.mpf-filter__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mpf-filter__item {
    margin-bottom: 0.25rem;
}

.mpf-filter__item a {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.mpf-filter__item a:hover {
    background: #f5f5f5;
}

.mpf-filter__item--active a {
    background: #f0f0f0;
    font-weight: 600;
}

/* Visuele checkbox */
.mpf-filter__checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    flex-shrink: 0;
}

.mpf-filter__item--active .mpf-filter__checkbox {
    border-color: #333;
    color: #333;
    background: #f0f0f0;
}

/* Label en count */
.mpf-filter__label {
    flex: 1;
}

.mpf-filter__count {
    color: #999;
    font-size: 0.85em;
    margin-left: 0.5rem;
}

/* Dropdown */
.mpf-filter select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Buttons */
.mpf-filter__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mpf-filter__button {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.mpf-filter__button:hover {
    border-color: #333;
}

.mpf-filter__button--active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Focus states */
.mpf-filter__item a:focus-visible,
.mpf-filter__button:focus-visible,
.mpf-filter select:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Details/summary (inklapbare filters) */
.mpf-filter summary {
    cursor: pointer;
    list-style: none;
}

.mpf-filter summary::-webkit-details-marker {
    display: none;
}

.mpf-filter summary::after {
    content: "\25BE";
    float: right;
    font-size: 0.8em;
    color: #999;
    transition: transform 0.2s;
}

.mpf-filter:not([open]) summary::after {
    content: "\25B8";
}

/* Mobiel: standaard ingeklapt */
@media (max-width: 768px) {
    .mpf-filter:not([open]) .mpf-filter__list,
    .mpf-filter:not([open]) .mpf-filter__buttons,
    .mpf-filter:not([open]) select {
        display: none;
    }
}

/* "Toon meer/minder" toggle */
.mpf-filter__toggle {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0;
    border: none;
    background: none;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.mpf-filter__toggle:hover {
    color: #333;
}

/* Active filters chips */
.mpf-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.mpf-active-filters__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.mpf-active-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #333;
    text-decoration: none;
    transition: all 0.15s;
}

.mpf-active-filters__chip:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.mpf-active-filters__chip:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.mpf-active-filters__remove {
    font-size: 1.1em;
    line-height: 1;
    color: #999;
}

.mpf-active-filters__chip:hover .mpf-active-filters__remove {
    color: #c00;
}

.mpf-active-filters__clear {
    font-size: 0.85rem;
    color: #999;
    text-decoration: underline;
    margin-left: 0.5rem;
}

.mpf-active-filters__clear:hover {
    color: #333;
}

.mpf-active-filters__clear:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Screen reader only */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

/* Kleurstalen (swatches) */
.mpf-filter__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.mpf-filter__swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 0 0 2px #fff;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease;
}

.mpf-filter__swatch:hover {
    transform: scale(1.1);
}

.mpf-filter__swatch--active {
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #333;
    border-color: #333;
}

.mpf-filter__swatch--empty {
    background: #f3f3f3;
    color: #777;
    font-size: 12px;
    text-transform: uppercase;
    box-shadow: none;
}

.mpf-filter__swatch-initial {
    line-height: 1;
}

/* Archive template: twee-kolom layout (sidebar-breedte instelbaar via variabele) */
.mpf-archive-layout {
    display: grid;
    grid-template-columns: var(--mpf-sidebar-width, 260px) 1fr;
    gap: 2rem;
    max-width: var(--mpf-layout-width, 1200px);
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.mpf-archive-sidebar,
.mpf-archive-content {
    min-width: 0;
}

@media (max-width: 768px) {
    .mpf-archive-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .mpf-archive-sidebar { order: 2; }
    .mpf-archive-content { order: 1; }
}

/* Automatische filters via hooks (fallback) */
.mpf-auto-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.mpf-auto-filters .mpf-filter {
    margin-bottom: 0;
}

.mpf-auto-filters .mpf-filter__title {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

@media (max-width: 768px) {
    .mpf-auto-filters {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Prijsfilter */
.mpf-price-filter {
    margin-bottom: 1.5rem;
}

.mpf-price-filter__title {
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.6rem;
}

/* Prijs-/range-slider: één balk met twee handles via jQuery UI. */
.mpf-price-filter__ui,
.mpf-range__ui {
    position: relative;
    height: 4px;
    margin: 16px 7px 18px;
    background: #e2e2e2;
    border: none;
    border-radius: 2px;
}

.mpf-price-filter__ui .ui-slider-range,
.mpf-range__ui .ui-slider-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: #333;
    border-radius: 2px;
}

.mpf-price-filter__ui .ui-slider-handle,
.mpf-range__ui .ui-slider-handle {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    transform: translateY(-50%);
    background: #333;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #999;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    z-index: 2;
}

.mpf-price-filter__amounts {
    text-align: center;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.6rem;
}

.mpf-price-filter__amount-sep {
    color: #999;
    margin: 0 0.15rem;
}

.mpf-price-filter__inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.mpf-price-filter__field {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.mpf-price-filter__currency {
    color: #777;
    font-size: 0.9rem;
}

.mpf-price-filter__input {
    width: 100%;
    min-width: 0;
    padding: 0.35rem 0.45rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.mpf-price-filter__sep {
    color: #999;
}

.mpf-price-filter__submit {
    padding: 0.4rem 0.9rem;
    border: 1px solid #333;
    border-radius: 4px;
    background: #333;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.mpf-price-filter__submit:hover {
    background: #000;
}

/* Generieke range-filter (meta) — hergebruikt de prijs-slider styling */
.mpf-range-filter {
    margin-bottom: 1.5rem;
}

.mpf-range-filter__title {
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.6rem;
}

.mpf-range__amounts {
    text-align: center;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.6rem;
}

.mpf-range__amount-sep {
    color: #999;
    margin: 0 0.15rem;
}

/* AJAX loading-state op de productgrid */
.mpf-is-loading {
    position: relative;
    opacity: 0.5;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

/* Archief-titel (H1) */
.mpf-archive-title {
    margin: 0 0 1rem;
}

/* Zoekbalk */
.mpf-search {
    display: flex;
    align-items: stretch;
    margin-bottom: 1.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.mpf-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    outline: none;
}

.mpf-search__submit {
    flex: 0 0 auto;
    border: 0;
    background: #f5f5f5;
    padding: 0 0.8rem;
    cursor: pointer;
    font-size: 1rem;
}

.mpf-search__submit:hover {
    background: #ececec;
}

/* "Toon meer"-knop (load-more paginatie) */
body.mpf-loadmore .woocommerce-pagination {
    display: none;
}

.mpf-load-more {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.7rem 1.6rem;
    border: 1px solid #333;
    border-radius: 4px;
    background: #333;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}

.mpf-load-more:hover {
    background: #000;
}

.mpf-load-more--loading {
    opacity: 0.6;
    pointer-events: none;
}
