/**
 * Product Filters & Sorting for Elementor
 * Deliberately low-specificity so Elementor's style controls always win.
 */

.ecf-filters {
	--ecf-accent: #2563eb;
	--ecf-divider: rgba( 0, 0, 0, 0.1 );
	--ecf-swatch-size: 28px;
	--ecf-radius: 6px;
	position: relative;
}

.ecf-panel {
	--ecf-drawer-width: 86%;
}

.ecf-groups {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

/* ---------------------------------------------------------------- Groups */

.ecf-group {
	min-width: 0;
}

.ecf-group + .ecf-group {
	border-top: 1px solid var( --ecf-divider );
	padding-top: 14px;
}

.ecf-groups[ style*='repeat(1' ] .ecf-group + .ecf-group,
.ecf-groups .ecf-group + .ecf-group {
	border-top: 1px solid var( --ecf-divider );
}

.ecf-group__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	margin: 0 0 10px;
	padding: 0;
	background: none;
	border: 0;
	font: inherit;
	font-weight: 600;
	text-align: inherit;
	color: inherit;
	cursor: pointer;
}

.ecf-group:not( .is-collapsible ) .ecf-group__title {
	cursor: default;
}

.ecf-chevron {
	width: 8px;
	height: 8px;
	flex: 0 0 auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate( 45deg );
	transition: transform 0.2s ease;
	opacity: 0.65;
}

.ecf-group.is-open .ecf-chevron {
	transform: rotate( -135deg );
}

.ecf-group__scroll {
	overscroll-behavior: contain;
}

.ecf-search {
	width: 100%;
	margin-bottom: 10px;
	padding: 7px 10px;
	font: inherit;
	font-size: 0.9em;
	border: 1px solid var( --ecf-divider );
	border-radius: var( --ecf-radius );
	background: transparent;
	color: inherit;
}

/* --------------------------------------------------------------- Options */

.ecf-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ecf-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ecf-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ecf-checkbox {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}

.ecf-option {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	cursor: pointer;
	line-height: 1.35;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.ecf-option__label {
	flex: 1 1 auto;
	min-width: 0;
}

.ecf-count {
	flex: 0 0 auto;
	opacity: 0.6;
	font-size: 0.85em;
}

.ecf-count::before {
	content: '(';
}

.ecf-count::after {
	content: ')';
}

/* Checkbox mark */
.ecf-box {
	position: relative;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border: 1px solid var( --ecf-divider );
	border-radius: 4px;
	background: transparent;
	transition: inherit;
}

.ecf-option.is-selected .ecf-box {
	background: var( --ecf-accent );
	border-color: var( --ecf-accent );
}

.ecf-option.is-selected .ecf-box::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate( 45deg );
}

.ecf-checkbox:focus-visible + .ecf-option .ecf-box,
.ecf-checkbox:focus-visible + .ecf-option .ecf-swatch {
	outline: 2px solid var( --ecf-accent );
	outline-offset: 2px;
}

/* Pills / buttons */
.ecf-pills .ecf-option {
	padding: 6px 12px;
	border: 1px solid var( --ecf-divider );
	border-radius: 999px;
}

.ecf-pills .ecf-option.is-selected {
	border-color: var( --ecf-accent );
	box-shadow: inset 0 0 0 1px var( --ecf-accent );
}

/* Colour swatches */
.ecf-style--swatch .ecf-option {
	padding: 4px;
	border: 1px solid transparent;
	border-radius: 999px;
}

.ecf-style--swatch .ecf-option.is-selected {
	border-color: var( --ecf-accent );
}

.ecf-swatch {
	flex: 0 0 auto;
	width: var( --ecf-swatch-size );
	height: var( --ecf-swatch-size );
	border-radius: 50%;
	border: 1px solid var( --ecf-divider );
	box-shadow: inset 0 0 0 2px #fff;
}

.ecf-stars {
	letter-spacing: 1px;
	color: #f0a132;
}

.ecf-empty,
.ecf-notice {
	margin: 0;
	opacity: 0.7;
	font-size: 0.9em;
}

/* ---------------------------------------------------------------- Select */

.ecf-select {
	width: 100%;
	max-width: 100%;
	padding: 8px 10px;
	font: inherit;
	color: inherit;
	background-color: transparent;
	border: 1px solid var( --ecf-divider, rgba( 0, 0, 0, 0.15 ) );
	border-radius: var( --ecf-radius, 6px );
}

/* ----------------------------------------------------------------- Price */

.ecf-price__slider {
	position: relative;
	height: 28px;
	margin: 4px 0 10px;
}

.ecf-price__rail,
.ecf-price__fill {
	position: absolute;
	top: 50%;
	height: 4px;
	border-radius: 4px;
	transform: translateY( -50% );
}

.ecf-price__rail {
	left: 0;
	right: 0;
	background: var( --ecf-divider );
}

.ecf-price__fill {
	background: var( --ecf-accent );
}

.ecf-price__range {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 28px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.ecf-price__range::-webkit-slider-thumb {
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var( --ecf-accent );
	cursor: pointer;
}

.ecf-price__range::-moz-range-thumb {
	pointer-events: auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var( --ecf-accent );
	cursor: pointer;
}

.ecf-price__range::-moz-range-track {
	background: none;
}

.ecf-price__fields {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.9em;
}

.ecf-price__input {
	width: 100%;
	min-width: 0;
	padding: 6px 8px;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid var( --ecf-divider );
	border-radius: var( --ecf-radius );
	-moz-appearance: textfield;
}

.ecf-price__input::-webkit-outer-spin-button,
.ecf-price__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ecf-price__symbol {
	opacity: 0.65;
}

/* ------------------------------------------------- Attribute range slider */

.ecf-range .ecf-price__slider {
	margin-top: 8px;
}

.ecf-range__readout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 0.9em;
	font-variant-numeric: tabular-nums;
}

.ecf-range__dash {
	opacity: 0.5;
}

/* --------------------------------------------------------------- Buttons */

.ecf-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.ecf-actions:empty {
	display: none;
}

.ecf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	font: inherit;
	line-height: 1.2;
	color: inherit;
	background-color: transparent;
	border: 1px solid var( --ecf-divider, rgba( 0, 0, 0, 0.15 ) );
	border-radius: var( --ecf-radius, 6px );
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.ecf-btn:hover {
	opacity: 0.85;
}

.ecf-btn--primary {
	color: #fff;
	background-color: var( --ecf-accent );
	border-color: var( --ecf-accent );
}

.ecf-btn--ghost {
	background: transparent;
}

.ecf-btn.is-selected {
	border-color: var( --ecf-accent );
	box-shadow: inset 0 0 0 1px var( --ecf-accent );
}

/* --------------------------------------------------------- Active filters */

.ecf-active.is-empty:empty {
	display: none;
}

.ecf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ecf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	font: inherit;
	font-size: 0.9em;
	line-height: 1.3;
	color: inherit;
	background-color: rgba( 0, 0, 0, 0.05 );
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

.ecf-chip__source {
	opacity: 0.6;
}

.ecf-chip__x {
	font-size: 1.15em;
	line-height: 1;
	opacity: 0.6;
}

.ecf-chip:hover .ecf-chip__x {
	opacity: 1;
}

.ecf-chip--clear {
	background: transparent;
	text-decoration: underline;
}

/* ---------------------------------------------------------------- Sorting */

.ecf-sort {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.ecf-sort__label {
	flex: 0 0 auto;
	white-space: nowrap;
}

.ecf-sort .ecf-select {
	width: auto;
	min-width: 180px;
}

/* ---------------------------------------------------------------- Loading */

.ecf-loading {
	position: relative;
	min-height: 120px;
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.ecf-loading::after {
	content: '';
	position: absolute;
	top: 60px;
	left: 50%;
	width: 34px;
	height: 34px;
	margin-left: -17px;
	border: 3px solid rgba( 0, 0, 0, 0.15 );
	border-top-color: var( --ecf-accent, #2563eb );
	border-radius: 50%;
	animation: ecf-spin 0.7s linear infinite;
}

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

/* ----------------------------------------------------------------- Drawer */

.ecf-drawer-toggle,
.ecf-panel__head,
.ecf-overlay {
	display: none;
}

.ecf-drawer-toggle__icon {
	width: 14px;
	height: 10px;
	border-top: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	position: relative;
}

.ecf-drawer-toggle__icon::after {
	content: '';
	position: absolute;
	left: 0;
	top: 3px;
	width: 9px;
	border-top: 2px solid currentColor;
}

.ecf-drawer-toggle__badge {
	min-width: 20px;
	padding: 1px 5px;
	font-size: 0.75em;
	line-height: 1.5;
	color: #fff;
	background: var( --ecf-accent );
	border-radius: 999px;
}

.ecf-drawer-toggle__badge.is-hidden {
	display: none;
}

body.ecf-no-scroll {
	overflow: hidden;
}

/* Mobile */
@media ( max-width: 767px ) {
	.ecf-drawer--mobile .ecf-drawer-toggle { display: inline-flex; width: 100%; }
	.ecf-drawer--mobile .ecf-panel__head { display: flex; align-items: center; justify-content: space-between; margin: -16px -16px 16px; padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var( --ecf-divider ); }
	.ecf-drawer--mobile .ecf-panel { position: fixed; top: 0; bottom: 0; z-index: 100000; width: var( --ecf-drawer-width, 86% ); max-width: 420px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: 0 0 40px rgba( 0, 0, 0, 0.2 ); transition: transform 0.28s ease; }
	.ecf-drawer--mobile.ecf-drawer-pos--left .ecf-panel { left: 0; transform: translateX( -102% ); }
	.ecf-drawer--mobile.ecf-drawer-pos--right .ecf-panel { right: 0; transform: translateX( 102% ); }
	.ecf-drawer--mobile.is-drawer-open .ecf-panel { transform: translateX( 0 ); }
	.ecf-drawer--mobile .ecf-overlay { display: block; position: fixed; inset: 0; z-index: 99999; background: rgba( 0, 0, 0, 0.5 ); }
	.ecf-drawer--mobile .ecf-overlay[ hidden ] { display: none; }
	.ecf-drawer--mobile .ecf-panel__close { padding: 0 4px; font-size: 26px; line-height: 1; background: none; border: 0; color: inherit; cursor: pointer; }
	.ecf-drawer--mobile .ecf-actions { position: sticky; bottom: -16px; margin: 18px -16px -16px; padding: 12px 16px; background: #fff; border-top: 1px solid var( --ecf-divider ); }
	.ecf-drawer--mobile .ecf-actions .ecf-btn { flex: 1 1 0; }
	.ecf-sort { justify-content: space-between; }
	.ecf-sort .ecf-select { flex: 1 1 auto; min-width: 0; }
}

/* Tablet and below */
@media ( max-width: 1024px ) {
	.ecf-drawer--tablet .ecf-drawer-toggle { display: inline-flex; width: 100%; }
	.ecf-drawer--tablet .ecf-panel__head { display: flex; align-items: center; justify-content: space-between; margin: -16px -16px 16px; padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var( --ecf-divider ); }
	.ecf-drawer--tablet .ecf-panel { position: fixed; top: 0; bottom: 0; z-index: 100000; width: var( --ecf-drawer-width, 86% ); max-width: 420px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: 0 0 40px rgba( 0, 0, 0, 0.2 ); transition: transform 0.28s ease; }
	.ecf-drawer--tablet.ecf-drawer-pos--left .ecf-panel { left: 0; transform: translateX( -102% ); }
	.ecf-drawer--tablet.ecf-drawer-pos--right .ecf-panel { right: 0; transform: translateX( 102% ); }
	.ecf-drawer--tablet.is-drawer-open .ecf-panel { transform: translateX( 0 ); }
	.ecf-drawer--tablet .ecf-overlay { display: block; position: fixed; inset: 0; z-index: 99999; background: rgba( 0, 0, 0, 0.5 ); }
	.ecf-drawer--tablet .ecf-overlay[ hidden ] { display: none; }
	.ecf-drawer--tablet .ecf-panel__close { padding: 0 4px; font-size: 26px; line-height: 1; background: none; border: 0; color: inherit; cursor: pointer; }
	.ecf-drawer--tablet .ecf-actions { position: sticky; bottom: -16px; margin: 18px -16px -16px; padding: 12px 16px; background: #fff; border-top: 1px solid var( --ecf-divider ); }
	.ecf-drawer--tablet .ecf-actions .ecf-btn { flex: 1 1 0; }
}

/* Always */
.ecf-drawer--always .ecf-drawer-toggle { display: inline-flex; }
.ecf-drawer--always .ecf-panel__head { display: flex; align-items: center; justify-content: space-between; margin: -16px -16px 16px; padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var( --ecf-divider ); }
.ecf-drawer--always .ecf-panel { position: fixed; top: 0; bottom: 0; z-index: 100000; width: var( --ecf-drawer-width, 86% ); max-width: 420px; padding: 16px; overflow-y: auto; background: #fff; box-shadow: 0 0 40px rgba( 0, 0, 0, 0.2 ); transition: transform 0.28s ease; }
.ecf-drawer--always.ecf-drawer-pos--left .ecf-panel { left: 0; transform: translateX( -102% ); }
.ecf-drawer--always.ecf-drawer-pos--right .ecf-panel { right: 0; transform: translateX( 102% ); }
.ecf-drawer--always.is-drawer-open .ecf-panel { transform: translateX( 0 ); }
.ecf-drawer--always .ecf-overlay { display: block; position: fixed; inset: 0; z-index: 99999; background: rgba( 0, 0, 0, 0.5 ); }
.ecf-drawer--always .ecf-overlay[ hidden ] { display: none; }
.ecf-drawer--always .ecf-panel__close { padding: 0 4px; font-size: 26px; line-height: 1; background: none; border: 0; color: inherit; cursor: pointer; }

@media ( prefers-reduced-motion: reduce ) {
	.ecf-panel,
	.ecf-chevron,
	.ecf-option {
		transition: none !important;
	}
}
