/* Buen Pique Filter Engine — uses Blocksy theme tokens where available */
.bpfe-filters {
	color: var(--theme-text-color, inherit);
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.bpfe-filters__title {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	color: var(--theme-text-color, inherit);
}

.bpfe-filters__status {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
	font-size: 0.8rem;
	min-height: 0;
}

.bpfe-filters__status:has(> .bpfe-filters__reset[hidden]:only-child) {
	display: none;
	margin: 0;
}

.bpfe-filters__reset {
	appearance: none;
	background: transparent;
	border: 0;
	padding: 0.15rem 0;
	color: var(--theme-link-initial-color, var(--theme-text-color, inherit));
	text-decoration: underline;
	cursor: pointer;
	min-height: 32px;
	font-size: inherit;
}

.bpfe-filters__reset[hidden] {
	display: none !important;
}

.bpfe-filters__reset:hover,
.bpfe-filters__reset:focus-visible {
	color: var(--theme-link-hover-color, var(--theme-link-initial-color, inherit));
	outline: 2px solid var(--theme-palette-color-1, currentColor);
	outline-offset: 2px;
}

.bpfe-filters__footer {
	display: none;
}

.bpfe-filters__apply {
	appearance: none;
	width: 100%;
	border: 0;
	border-radius: 2px;
	padding: 0.75rem 1rem;
	min-height: 48px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	background: var(--theme-palette-color-1, #1a1a1a);
	color: #fff;
}

.bpfe-filters__apply:hover,
.bpfe-filters__apply:focus-visible {
	filter: brightness(1.05);
	outline: 2px solid var(--theme-palette-color-1, currentColor);
	outline-offset: 2px;
}

/* Offcanvas / mobile: sticky Apply + 44px taps */
.ct-panel .bpfe-filters__footer {
	display: block;
	position: sticky;
	bottom: 0;
	z-index: 5;
	margin: 0.75rem -0.25rem 0;
	padding: 0.65rem 0.25rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
	background: var(--theme-palette-color-8, #fff);
	border-top: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.12));
	box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.06);
}

.ct-panel .bpfe-filters__list label {
	min-height: 40px;
	padding: 0.3rem 0;
}

.ct-panel .bpfe-filters__section summary {
	min-height: 32px;
}

.ct-panel .bpfe-size-chip {
	min-height: 40px;
	min-width: 40px;
	padding: 0.4rem 0.55rem;
}

@media (max-width: 999px) {
	.bpfe-filters__footer {
		display: block;
		position: sticky;
		bottom: 0;
		z-index: 5;
		margin-top: 0.75rem;
		padding: 0.65rem 0 calc(0.65rem + env(safe-area-inset-bottom, 0px));
		background: var(--theme-palette-color-8, #fff);
		border-top: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.12));
	}

	.bpfe-filters__list label {
		min-height: 40px;
		padding: 0.3rem 0;
	}

	.bpfe-filters__section summary {
		min-height: 32px;
	}
}

/* Desktop sidebar: hide Apply (live updates) */
#sidebar .bpfe-filters__footer,
.ct-sidebar .bpfe-filters__footer {
	display: none;
}

.bpfe-filters__loading {
	margin-bottom: 0.5rem;
	font-size: 0.8rem;
	opacity: 0.8;
}

.bpfe-filters__loading.is-error {
	opacity: 1;
	color: var(--theme-palette-color-1, #b32d2e);
}

.bpfe-filters__empty-index {
	margin-bottom: 0.65rem;
	padding: 0.5rem 0.6rem;
	font-size: 0.8rem;
	line-height: 1.35;
	border: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.15));
	border-radius: 2px;
	background: rgba(0, 0, 0, 0.03);
}

.bpfe-filters.is-loading {
	opacity: 0.65;
	pointer-events: none;
}

.bpfe-filters__section {
	border-top: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.12));
	padding: 0.2rem 0;
}

.bpfe-filters__section summary {
	cursor: pointer;
	font-weight: 600;
	list-style: none;
	min-height: 28px;
	display: flex;
	align-items: center;
	font-size: 0.84rem;
}

.bpfe-filters__section summary::-webkit-details-marker {
	display: none;
}

.bpfe-filters__list {
	list-style: none;
	margin: 0.1rem 0 0;
	padding: 0;
	max-height: 220px;
	overflow: auto;
}

.bpfe-filters__list li {
	margin: 0;
	line-height: 1.15;
}

.bpfe-filters__list label {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.02rem 0;
	cursor: pointer;
	min-height: 0;
}

.bpfe-filters__list input {
	margin: 0;
	flex: 0 0 auto;
}

.bpfe-brand-logo {
	width: 60px;
	height: 35px;
	object-fit: contain;
	flex: 0 0 auto;
	border-radius: 2px;
	display: block;
}

.bpfe-filters__label {
	flex: 1 1 auto;
	line-height: 1.2;
	font-size: 0.84rem;
}

.bpfe-filters__count {
	opacity: 0.65;
	font-size: 0.8em;
	flex: 0 0 auto;
}

.bpfe-filters__price {
	margin-top: 0.35rem;
}

.bpfe-filters__price-display {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	margin-bottom: 0.55rem;
}

.bpfe-filters__price-edit {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.2rem;
	min-width: 0;
	font-weight: 500;
}

.bpfe-filters__price-caption {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0.7;
}

.bpfe-filters__price-field {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	min-height: 32px;
	padding: 0 0.45rem;
	border: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.18));
	border-radius: 4px;
	background: var(--theme-palette-color-8, transparent);
}

.bpfe-filters__price-field:focus-within {
	border-color: var(--theme-palette-color-1, currentColor);
	outline: 2px solid var(--theme-palette-color-1, currentColor);
	outline-offset: 1px;
}

.bpfe-filters__price-edit input[type="text"],
.bpfe-filters__price-edit input[type="number"] {
	width: 100%;
	min-width: 0;
	min-height: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	appearance: textfield;
	-moz-appearance: textfield;
}

.bpfe-filters__price-edit input[type="number"]::-webkit-outer-spin-button,
.bpfe-filters__price-edit input[type="number"]::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}

.bpfe-filters__currency {
	opacity: 0.7;
	font-size: 0.85em;
	flex: 0 0 auto;
	font-weight: 600;
}

.bpfe-filters__price-sep {
	display: none;
}

.bpfe-filters__price-slider {
	position: relative;
	height: 40px;
	margin: 0.15rem 0 0.1rem;
	overflow: visible;
	--bpfe-range-left: 0%;
	--bpfe-range-right: 100%;
}

.bpfe-filters__price-slider::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 6px;
	transform: translateY(-50%);
	border-radius: 3px;
	background: var(--theme-border-color, rgba(0, 0, 0, 0.15));
	z-index: 0;
}

.bpfe-filters__price-slider::after {
	content: "";
	position: absolute;
	left: var(--bpfe-range-left);
	width: calc(var(--bpfe-range-right) - var(--bpfe-range-left));
	top: 50%;
	height: 6px;
	transform: translateY(-50%);
	border-radius: 3px;
	background: var(--theme-palette-color-1, currentColor);
	pointer-events: none;
	z-index: 1;
}

.bpfe-filters__price-slider input[type="range"] {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0;
	background: transparent;
	pointer-events: none;
	appearance: none;
	-webkit-appearance: none;
	z-index: 2;
}

.bpfe-filters__price-slider input[type="range"].bpfe-filter-price-range-max {
	z-index: 3;
}

.bpfe-filters__price-slider input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	margin-top: -7px;
	border-radius: 50%;
	border: 2px solid var(--theme-palette-color-1, #333);
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	pointer-events: auto;
	position: relative;
	z-index: 4;
}

.bpfe-filters__price-slider input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid var(--theme-palette-color-1, #333);
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	pointer-events: auto;
}

.bpfe-filters__price-slider input[type="range"]::-webkit-slider-runnable-track {
	height: 6px;
	background: transparent;
	border: none;
}

.bpfe-filters__price-slider input[type="range"]::-moz-range-track {
	height: 6px;
	background: transparent;
	border: none;
}

/* Facet chips (no visible checkbox) */
.bpfe-filters__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.22rem;
	margin-top: 0.2rem;
	max-height: 220px;
	overflow: auto;
}

.bpfe-filter-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	margin: 0;
	padding: 0.18rem 0.45rem;
	min-height: 28px;
	border: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.18));
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	font-size: 0.8rem;
	line-height: 1.15;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.bpfe-filter-chip--logo {
	padding: 0.25rem 0.45rem;
	min-width: 72px;
	min-height: 40px;
	border-radius: 8px;
}

.bpfe-filter-chip--swatch {
	gap: 0.3rem;
}

.bpfe-filter-chip__swatch {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	flex: 0 0 auto;
	border: 1px solid rgba(0, 0, 0, 0.2);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.bpfe-filter-chip:hover {
	border-color: var(--theme-palette-color-1, currentColor);
}

.bpfe-filter-chip:focus-within {
	outline: 2px solid var(--theme-palette-color-1, currentColor);
	outline-offset: 1px;
}

.bpfe-filter-chip:has(input:checked) {
	border-color: var(--theme-palette-color-1, #333);
	background: var(--theme-palette-color-1, #333);
	color: #fff;
}

.bpfe-filter-chip:has(input:checked) .bpfe-filter-chip__swatch {
	border-color: rgba(255, 255, 255, 0.55);
}

.bpfe-filter-chip__label {
	font-weight: 500;
}

.bpfe-filter-chip__count {
	opacity: 0.65;
	font-size: 0.75em;
}

.bpfe-filter-chip:has(input:checked) .bpfe-filter-chip__count {
	opacity: 0.85;
}

.ct-panel .bpfe-filter-chip {
	min-height: 36px;
	padding: 0.3rem 0.55rem;
}

.ct-panel .bpfe-filter-chip--logo {
	min-height: 42px;
	min-width: 72px;
}

.ct-panel .bpfe-filters__section summary {
	min-height: 36px;
}

ul.products.bpfe-grid-loading {
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

.bpfe-no-results {
	margin: 1rem 0;
}

.bpfe-size-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-top: 0.4rem;
	min-height: 1.4rem;
	position: relative;
	z-index: 2;
}

.bpfe-size-chip {
	appearance: none;
	border: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.18));
	background: transparent;
	color: var(--theme-text-color, inherit);
	font-size: 0.75rem;
	line-height: 1;
	padding: 0.35rem 0.45rem;
	min-height: 28px;
	cursor: pointer;
	border-radius: 2px;
}

.bpfe-size-chip:hover,
.bpfe-size-chip:focus-visible {
	border-color: var(--theme-palette-color-1, currentColor);
	outline: 2px solid var(--theme-palette-color-1, currentColor);
	outline-offset: 1px;
}

.bpfe-size-chip.is-active {
	border-color: var(--theme-palette-color-1, currentColor);
	background: var(--theme-palette-color-1, currentColor);
	color: #fff;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
