/* ============================================================
   Boer Product Filter — Zalando-style compact horizontal bar
   ============================================================ */

/* --- Spinner overlay --- */
.boer-spinner {
	display: none;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 9999;
	width: 36px;
	height: 36px;
	border: 3px solid #eee;
	border-top: 3px solid var(--brand-primary, #0073aa);
	border-radius: 50%;
	animation: boer-spin 0.75s linear infinite;
}

@keyframes boer-spin {
	0%   { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Form wrapper --- */
.product-filters {
	margin-bottom: 0.75rem;
}

/* --- Shell: contains filter bar + dropdown panels --- */
.boer-filters-shell {
	position: relative;
}

/* ============================================================
   Filter Bar (horizontal row)
   ============================================================ */
.boer-filterbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* --- Filter buttons row --- */
.boer-filterbar__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
	flex: 1 1 auto;
}

/* --- Individual filter button (pill) --- */
.boer-filterbar__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	height: 34px;
	padding: 0 0.75rem;
	border: 1px solid rgba(0,0,0,0.18);
	border-radius: 999px;
	background: #fff;
	color: var(--text-dark, #1a1a1a);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s ease;
	user-select: none;
}

.boer-filterbar__btn:hover {
	border-color: rgba(0,0,0,0.35);
	background: rgba(0,0,0,0.02);
}

.boer-filterbar__btn[aria-expanded="true"] {
	border-color: var(--brand-primary, #0073aa);
	background: var(--bg-primary-soft, rgba(0,115,170,0.06));
	color: var(--brand-primary, #0073aa);
}

/* Active state: filled look */
.boer-filterbar__btn--active {
	border-color: var(--brand-primary, #0073aa);
	background: var(--brand-primary, #0073aa);
	color: #fff;
}

.boer-filterbar__btn--active:hover {
	background: var(--brand-primary, #0073aa);
	opacity: 0.9;
}

.boer-filterbar__btn--active .boer-filterbar__btn-chevron {
	color: #fff;
}

/* Icon inside button (e.g. search icon) */
.boer-filterbar__btn-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* Badge inside button */
.boer-filterbar__btn-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: rgba(255,255,255,0.3);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1;
}

.boer-filterbar__btn:not(.boer-filterbar__btn--active) .boer-filterbar__btn-badge {
	background: var(--brand-primary, #0073aa);
	color: #fff;
}

/* Chevron icon */
.boer-filterbar__btn-chevron {
	width: 12px;
	height: 12px;
	opacity: 0.5;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.boer-filterbar__btn[aria-expanded="true"] .boer-filterbar__btn-chevron {
	transform: rotate(180deg);
	opacity: 0.8;
}

/* Reset link */
.boer-filterbar__reset {
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 0.6rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--brand-primary, #0073aa);
	text-decoration: none;
	border-radius: 6px;
	transition: background 0.15s;
}

.boer-filterbar__reset:hover {
	background: rgba(0,115,170,0.06);
	text-decoration: underline;
}

/* Result count (meta) */
.boer-filterbar__meta {
	margin-left: auto;
	flex-shrink: 0;
}

.boer-filters-result-count {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--text-dark, #444);
	white-space: nowrap;
}

/* ============================================================
   Dropdown panels
   ============================================================ */
.boer-dropdown-panels {
	position: relative;
}

.boer-dropdown {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	background: #fff;
	border: 1px solid rgba(0,0,0,0.1);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
	animation: boer-dropdown-in 0.15s ease-out;
}

.boer-dropdown[hidden] {
	display: none !important;
}

@keyframes boer-dropdown-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.boer-dropdown__inner {
	padding: 1rem 1.25rem;
}

/* ============================================================
   Search dropdown
   ============================================================ */
.boer-search-dropdown__input-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.boer-search-dropdown__icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	opacity: 0.45;
	pointer-events: none;
}

.boer-search-dropdown__input-wrap input[type="text"] {
	width: 100%;
	height: 42px;
	padding: 0 2.5rem 0 2.25rem;
	border: 1px solid rgba(0,0,0,0.15);
	border-radius: 8px;
	font-size: 0.875rem;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.boer-search-dropdown__input-wrap input[type="text"]:focus {
	outline: none;
	border-color: var(--brand-primary, #0073aa);
	box-shadow: 0 0 0 2px rgba(0,115,170,0.12);
}

.boer-search-dropdown__clear {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--text-dark, #555);
	cursor: pointer;
	opacity: 0.5;
	transition: opacity 0.15s, background 0.15s;
	padding: 0;
}

.boer-search-dropdown__clear:hover {
	opacity: 1;
	background: rgba(0,0,0,0.06);
}

.boer-search-dropdown__clear[hidden] {
	display: none !important;
}

/* ============================================================
   Filter fields inside dropdowns
   ============================================================ */
.boer-filter-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0.75rem;
}

.boer-filter-fields--stacked {
	grid-template-columns: 1fr;
}

.boer-filter-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
}

.boer-filter-field--hidden {
	display: none !important;
}

.boer-filter-field label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--text-dark, #555);
}

.boer-filter-field input[type="number"] {
	width: 100%;
	min-height: 36px;
	padding: 0.5rem 0.6rem;
	border: 1px solid rgba(0,0,0,0.12);
	border-radius: 6px;
	font-size: 0.8125rem;
}

.boer-filter-field input[type="number"]:focus {
	outline: none;
	border-color: var(--brand-primary, #0073aa);
	box-shadow: 0 0 0 2px rgba(0,115,170,0.12);
}

/* Checkbox */
.boer-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 36px;
	font-size: 0.8125rem;
	cursor: pointer;
}

.boer-checkbox input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--brand-primary, #0073aa);
}

/* Slider wrapper */
.boer-slider-field {
	padding: 0.5rem 0.25rem 0.25rem;
}

.boer-range-slider {
	margin: 1rem 0 2rem;
}

.boer-range-slider.noUi-target {
	border: 0;
	box-shadow: none;
	background: rgba(0,0,0,0.08);
	height: 5px;
	border-radius: 999px;
}

.boer-range-slider .noUi-connect {
	background: var(--brand-primary, #0073aa);
}

.boer-range-slider .noUi-handle {
	width: 18px !important;
	height: 18px !important;
	right: -9px !important;
	top: -7px !important;
	border-radius: 50%;
	border: 2px solid var(--brand-primary, #0073aa);
	background: #fff;
	box-shadow: 0 1px 6px rgba(0,0,0,0.12);
	cursor: pointer;
	transition: box-shadow 0.15s;
}

.boer-range-slider .noUi-handle:hover {
	box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.boer-range-slider .noUi-handle:before,
.boer-range-slider .noUi-handle:after {
	display: none;
}

.boer-range-slider .noUi-tooltip {
	border: 0;
	border-radius: 999px;
	padding: 0.25rem 0.5rem;
	background: var(--brand-primary, #0073aa);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1;
	bottom: -30px;
	top: auto;
	transform: translate(-50%, 0);
	white-space: nowrap;
}

.boer-range-slider .noUi-touch-area {
	cursor: pointer;
}

/* Placeholder message */
.boer-filter-placeholder {
	min-height: 36px;
	display: flex;
	align-items: center;
	padding: 0.5rem 0.75rem;
	border: 1px dashed rgba(0,0,0,0.15);
	border-radius: 6px;
	background: rgba(0,0,0,0.02);
	color: rgba(0,0,0,0.5);
	font-size: 0.8125rem;
}

.boer-filter-select-hidden,
.boer-filter-select-hidden + .select2 {
	display: none !important;
}

/* ============================================================
   Select2 overrides for compact dropdowns
   ============================================================ */
.boer-dropdown .select2-container {
	font-size: 0.8125rem;
}

.boer-dropdown .select2-container--default .select2-selection--multiple {
	min-height: 36px;
	border: 1px solid rgba(0,0,0,0.12);
	border-radius: 6px;
	padding: 2px 4px;
}

.boer-dropdown .select2-container--default .select2-selection--multiple .select2-selection__choice {
	font-size: 0.75rem;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--bg-primary-soft, rgba(0,115,170,0.08));
	border-color: transparent;
	color: var(--brand-primary, #0073aa);
}

/* ============================================================
   Loading state
   ============================================================ */
body.boer-filters-is-loading .products {
	opacity: 0.45;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

/* ============================================================
   Load more button
   ============================================================ */
.boer-load-more {
	display: none;
	margin: 1.5rem auto;
	padding: 0.6rem 1.5rem;
	font-size: 0.8125rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
	.boer-filterbar {
		gap: 0.4rem;
	}

	.boer-filterbar__buttons {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 2px;
	}

	.boer-filterbar__buttons::-webkit-scrollbar {
		display: none;
	}

	.boer-filterbar__btn {
		flex-shrink: 0;
		height: 32px;
		font-size: 0.75rem;
		padding: 0 0.6rem;
	}

	.boer-filterbar__meta {
		margin-left: 0;
		flex: 1 1 100%;
		order: 10;
		padding-top: 0.25rem;
	}

	.boer-dropdown {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		border-radius: 16px 16px 0 0;
		max-height: 70vh;
		overflow-y: auto;
		z-index: 1000;
		animation: boer-dropdown-mobile-in 0.2s ease-out;
	}

	@keyframes boer-dropdown-mobile-in {
		from { transform: translateY(100%); opacity: 0; }
		to   { transform: translateY(0); opacity: 1; }
	}

	.boer-dropdown__inner {
		padding: 1.25rem 1rem;
	}

	.boer-filter-fields {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.boer-filterbar__btn {
		height: 30px;
		font-size: 0.7rem;
		padding: 0 0.5rem;
	}

	.boer-filterbar__btn-badge {
		min-width: 16px;
		height: 16px;
		font-size: 0.625rem;
	}
}

/* ============================================================
   Mobile dropdown backdrop overlay
   ============================================================ */
.boer-dropdown-backdrop {
	display: none;
}

@media (max-width: 768px) {
	.boer-dropdown-backdrop {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0,0,0,0.35);
		z-index: 999;
		animation: boer-fade-in 0.15s ease;
	}

	@keyframes boer-fade-in {
		from { opacity: 0; }
		to   { opacity: 1; }
	}
}


.boer-spinner {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 9999;
        width: 48px;
        height: 48px;
        border: 5px solid #eee;
        border-top: 5px solid var(--brand-primary, #0073aa);
        border-radius: 50%;
        animation: boer-spin 1s linear infinite;
}

@keyframes boer-spin {
        0% {
                transform: translate(-50%, -50%) rotate(0deg);
        }
        100% {
                transform: translate(-50%, -50%) rotate(360deg);
        }
}

.product-filters {
        margin-bottom: 1.5rem;
}

.boer-filters-shell {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 1.25rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.boer-filters-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
}

.boer-filters-toolbar__search {
        flex: 1 1 320px;
}

.boer-filters-toolbar__search input {
        width: 90%;
        min-height: 44px;
        padding: 0.75rem 1rem;
        border: 1px solid rgba(0, 0, 0, 0.12);
        border-radius: 12px;
}

.boer-filters-toolbar__status {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
        align-items: center;
}

.boer-filters-result-count {
        font-weight: 700;
}

.boer-filters-active {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
}

.boer-filter-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.35rem 0.5rem 0.35rem 0.75rem;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.05);
        font-size: 0.85rem;
        line-height: 1.2;
}

.boer-filter-chip__remove {
        border: 0;
        background: transparent;
        cursor: pointer;
        font: inherit;
        line-height: 1;
        padding: 0;
        width: 1.25rem;
        height: 1.25rem;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
}

.boer-filter-chip__remove:hover {
        background: rgba(0, 0, 0, 0.08);
}

.boer-filters-accordion {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
}

.boer-filter-group {
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 16px;
        overflow: visible;
        background: #fff;
}

.boer-filter-group__heading {
        margin: 0;
}

.boer-filter-group__trigger {
        appearance: none;
        width: 100%;
        border: 0;
        margin: 0;
        padding: 0.95rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        text-align: left;
        font: inherit;
        font-weight: 700;
        cursor: pointer;
        background: var(--brand-secondary, #6c757d);
        color: #fff;
        border-radius: 16px 16px 0 0;
}

.boer-filter-group:not(.is-open) .boer-filter-group__trigger {
        border-radius: 16px;
}

.boer-filter-group__icon {
        display: inline-flex;
        width: 1rem;
        height: 1rem;
        transition: transform 0.2s ease;
}

.boer-filter-group__icon svg {
        display: block;
        width: 1rem;
        height: 1rem;
}

.boer-filter-group.is-open .boer-filter-group__icon {
        transform: rotate(180deg);
}

.boer-filter-group__panel {
        padding: 1rem;
        background: #fff;
        border-radius: 0 0 16px 16px;
        overflow: visible;
}

.boer-filter-group__panel[hidden] {
        display: none !important;
}

.boer-filter-fields {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
}

.boer-filter-fields--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
}

.boer-filter-field {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        min-width: 0;
}

.boer-filter-field--hidden {
        display: none !important;
}

.boer-filter-field label {
        font-size: 0.9rem;
        font-weight: 600;
}

.boer-filter-field input[type="number"] {
        width: 100%;
        min-height: 42px;
        padding: 0.65rem 0.8rem;
        border: 1px solid rgba(0, 0, 0, 0.12);
        border-radius: 10px;
}

.boer-checkbox {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        min-height: 42px;
}

.boer-slider-field {
        padding: 0.75rem 0.75rem 2.5rem;
        position: relative;
}

.boer-range-slider {
        margin: 1.25rem 0.5rem 0;
}

.boer-range-slider.noUi-target {
        border: 0;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.08);
        height: 8px;
        border-radius: 999px;
}

.boer-range-slider .noUi-connect {
        background: var(--brand-primary, #0073aa);
}

.boer-range-slider .noUi-handle {
        width: 22px !important;
        height: 22px !important;
        right: -11px !important;
        top: -7px !important;
        border-radius: 50%;
        border: 2px solid var(--brand-primary, #0073aa);
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
        cursor: pointer;
}

.boer-range-slider .noUi-handle:before,
.boer-range-slider .noUi-handle:after {
        display: none;
}

.boer-range-slider .noUi-tooltip {
        border: 0;
        border-radius: 6px;
        padding: 0.3rem 0.55rem;
        background: var(--brand-primary, #0073aa);
        color: #fff;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.2;
        bottom: -30px;
        top: auto;
        transform: translate(-50%, 0);
        white-space: nowrap;
        z-index: 10;
        pointer-events: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Prevent left tooltip from overflowing left edge */
.boer-range-slider .noUi-handle-lower .noUi-tooltip {
        left: 50%;
        right: auto;
}

/* Prevent right tooltip from overflowing right edge */
.boer-range-slider .noUi-handle-upper .noUi-tooltip {
        left: 50%;
        right: auto;
}

.boer-range-slider .noUi-touch-area {
        cursor: pointer;
}

.boer-filter-placeholder {
        min-height: 42px;
        display: flex;
        align-items: center;
        padding: 0.75rem 0.9rem;
        border: 1px dashed rgba(0, 0, 0, 0.18);
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.02);
        color: rgba(0, 0, 0, 0.65);
        font-size: 0.95rem;
}

.boer-filter-select-hidden,
.boer-filter-select-hidden + .select2 {
        display: none !important;
}

.filter-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: flex-end;
}

body.boer-filters-is-loading .products {
        opacity: 0.55;
        transition: opacity 0.15s ease;
}

.boer-load-more {
        display: none;
        margin: 20px auto;
}

@media (max-width: 900px) {
        .boer-filter-fields,
        .boer-filter-fields--compact {
                grid-template-columns: 1fr;
        }

        .boer-slider-field {
                padding: 0.75rem 0.75rem 2.25rem;
        }

        .boer-range-slider {
                margin: 1rem 0.5rem 0;
        }
}