/* ============================================================
   Woo Ajax Filter for Elementor — filter.css
   Mobile-first, accordion breakdown, drawer mobile, no deps
   ============================================================ */

.wafe {
	--wafe-accent: #0a0a0a;
	--wafe-border: #e5e7eb;
	--wafe-bg: #ffffff;
	--wafe-text: #111827;
	--wafe-muted: #6b7280;
	--wafe-radius: 8px;
	--wafe-gap: 12px;
	--wafe-touch: 44px;
	color: var(--wafe-text);
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
}
.wafe *,
.wafe *::before,
.wafe *::after {
	box-sizing: inherit;
}

.wafe-sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0);
	white-space: nowrap; border: 0;
}

/* ------------------------- Mobile toggle ------------------------ */
.wafe-mobile-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: var(--wafe-touch);
	padding: 10px 16px;
	background: var(--wafe-accent);
	color: #fff;
	border: 0;
	border-radius: var(--wafe-radius);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
	justify-content: center;
}
.wafe-mobile-toggle:focus-visible {
	outline: 2px solid var(--wafe-accent);
	outline-offset: 2px;
}
.wafe-active-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	background: #fff;
	color: var(--wafe-accent);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
}

/* ----------------------------- Panel ---------------------------- */
.wafe-panel {
	background: var(--wafe-bg);
	border: 1px solid var(--wafe-border);
	border-radius: var(--wafe-radius);
}
.wafe-panel-header,
.wafe-panel-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 16px;
	border-bottom: 1px solid var(--wafe-border);
}
.wafe-panel-footer {
	border-bottom: 0;
	border-top: 1px solid var(--wafe-border);
	justify-content: space-between;
	position: sticky;
	bottom: 0;
	background: var(--wafe-bg);
}
.wafe-panel-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	flex: 1;
}
.wafe-panel-close {
	display: none;
	min-width: var(--wafe-touch);
	min-height: var(--wafe-touch);
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	color: var(--wafe-text);
	cursor: pointer;
	border-radius: var(--wafe-radius);
}
.wafe-panel-close:hover { background: #f3f4f6; }

/* --------------------------- Form / sections ------------------- */
.wafe-form {
	max-height: 70vh;
	overflow-y: auto;
	padding: 0;
}
.wafe-form::-webkit-scrollbar { width: 6px; }
.wafe-form::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.wafe-field {
	padding: 12px 16px;
	border-bottom: 1px solid var(--wafe-border);
}
.wafe-field-search input.wafe-search {
	width: 100%;
	min-height: var(--wafe-touch);
	padding: 0 14px;
	border: 1px solid var(--wafe-border);
	border-radius: var(--wafe-radius);
	background: #f9fafb;
	font: inherit;
	color: inherit;
}
.wafe-field-search input.wafe-search:focus {
	outline: 2px solid var(--wafe-accent);
	outline-offset: 1px;
	background: #fff;
}
.wafe-field-sort label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--wafe-muted);
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-bottom: 6px;
}
.wafe-field-sort select {
	width: 100%;
	min-height: var(--wafe-touch);
	padding: 0 14px;
	border: 1px solid var(--wafe-border);
	border-radius: var(--wafe-radius);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
	appearance: none;
	font: inherit;
}

/* ----------------------- Section accordion --------------------- */
.wafe-section {
	border-bottom: 1px solid var(--wafe-border);
}
.wafe-section:last-of-type { border-bottom: 0; }

.wafe-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: var(--wafe-touch);
	padding: 12px 16px;
	background: transparent;
	border: 0;
	font: inherit;
	color: inherit;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
}
.wafe-section-header:hover { background: #f9fafb; }
.wafe-section-header:focus-visible {
	outline: 2px solid var(--wafe-accent);
	outline-offset: -2px;
}
.wafe-chevron {
	flex-shrink: 0;
	transition: transform .2s ease;
	color: var(--wafe-muted);
}
.wafe-section.is-open .wafe-chevron { transform: rotate(180deg); }

.wafe-section-body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .25s ease;
}
.wafe-section.is-open .wafe-section-body {
	grid-template-rows: 1fr;
}
.wafe-section-body > * {
	overflow: hidden;
	min-height: 0;
}
.wafe-section.is-open .wafe-section-body > * {
	padding: 0 16px 14px;
}

/* ----------------------- Checkbox options --------------------- */
.wafe-options {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
}
.wafe-options li { margin: 0; }
.wafe-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 6px;
	min-height: var(--wafe-touch);
	cursor: pointer;
	border-radius: 6px;
}
.wafe-option:hover { background: #f9fafb; }
.wafe-option input[type="checkbox"] {
	flex-shrink: 0;
	width: 18px; height: 18px;
	margin: 0;
	accent-color: var(--wafe-accent);
	cursor: pointer;
}
.wafe-option-label { flex: 1; }
.wafe-option-count {
	font-size: 12px;
	color: var(--wafe-muted);
	background: #f3f4f6;
	padding: 2px 8px;
	border-radius: 999px;
}

/* ----------------------- Toggle (switch) ---------------------- */
.wafe-toggle {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: var(--wafe-touch);
	padding: 6px 0;
	cursor: pointer;
}
.wafe-toggle input[type="checkbox"] {
	appearance: none;
	width: 40px; height: 22px;
	background: #d1d5db;
	border-radius: 999px;
	position: relative;
	cursor: pointer;
	transition: background .2s;
	flex-shrink: 0;
}
.wafe-toggle input[type="checkbox"]::after {
	content: "";
	position: absolute;
	width: 18px; height: 18px;
	background: #fff;
	border-radius: 50%;
	top: 2px; left: 2px;
	transition: transform .2s;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.wafe-toggle input[type="checkbox"]:checked {
	background: var(--wafe-accent);
}
.wafe-toggle input[type="checkbox"]:checked::after {
	transform: translateX(18px);
}

/* ----------------------- Rating ------------------------------- */
.wafe-rating-row {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: var(--wafe-touch);
	padding: 4px 0;
	cursor: pointer;
}
.wafe-rating-row input { accent-color: var(--wafe-accent); }

/* ----------------------- Price -------------------------------- */
.wafe-price-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}
.wafe-price-field {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 4px;
	border: 1px solid var(--wafe-border);
	border-radius: var(--wafe-radius);
	padding: 0 10px;
	min-height: var(--wafe-touch);
	background: #fff;
}
.wafe-price-field:focus-within {
	border-color: var(--wafe-accent);
	box-shadow: 0 0 0 2px rgba(10,10,10,.08);
}
.wafe-price-symbol {
	color: var(--wafe-muted);
	font-size: 13px;
}
.wafe-price-field input {
	flex: 1;
	width: 100%;
	border: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	padding: 0;
	min-height: var(--wafe-touch);
}
.wafe-price-field input:focus { outline: none; }
.wafe-price-sep { color: var(--wafe-muted); }

.wafe-price-slider {
	position: relative;
	height: 24px;
}
.wafe-price-slider input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	width: 100%;
	height: 24px;
	background: transparent;
	pointer-events: none;
	margin: 0;
}
.wafe-price-slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px; height: 20px;
	background: var(--wafe-accent);
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.wafe-price-slider input[type="range"]::-moz-range-thumb {
	width: 20px; height: 20px;
	background: var(--wafe-accent);
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
}
.wafe-price-track {
	position: absolute;
	top: 10px; left: 0; right: 0; height: 4px;
	background: #e5e7eb;
	border-radius: 2px;
}
.wafe-price-fill {
	position: absolute;
	top: 10px; height: 4px;
	background: var(--wafe-accent);
	border-radius: 2px;
}

/* ----------------------- Swatches ----------------------------- */
.wafe-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.wafe-swatch {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px 6px 6px;
	border: 1px solid var(--wafe-border);
	border-radius: 999px;
	cursor: pointer;
	min-height: 36px;
	background: #fff;
	transition: border-color .15s, transform .15s;
}
.wafe-swatch:hover { transform: translateY(-1px); }
.wafe-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.wafe-swatch-dot {
	width: 22px; height: 22px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,.1);
	flex-shrink: 0;
}
.wafe-swatch-name { font-size: 13px; }
.wafe-swatch:has(input:checked) {
	border-color: var(--wafe-accent);
	background: var(--wafe-accent);
	color: #fff;
}
.wafe-swatch:has(input:checked) .wafe-swatch-dot {
	border-color: #fff;
	box-shadow: 0 0 0 2px var(--wafe-accent);
}

/* ----------------------- Active chips ------------------------- */
.wafe-active-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 16px;
}
.wafe-active-chips:empty { display: none; }
.wafe-active-chips + .wafe-form { padding-top: 12px; }
.wafe-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px 4px 12px;
	background: #f3f4f6;
	border-radius: 999px;
	font-size: 12px;
	border: 0;
	cursor: pointer;
	font: inherit;
}
.wafe-chip:hover { background: #e5e7eb; }
.wafe-chip svg { color: var(--wafe-muted); }

/* ----------------------- Buttons ------------------------------ */
.wafe-btn {
	flex: 1;
	min-height: var(--wafe-touch);
	padding: 0 16px;
	border: 0;
	border-radius: var(--wafe-radius);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}
.wafe-btn-primary {
	background: var(--wafe-accent);
	color: #fff;
}
.wafe-btn-primary:hover { opacity: .92; }
.wafe-btn-ghost {
	background: transparent;
	color: var(--wafe-text);
	border: 1px solid var(--wafe-border);
}
.wafe-btn-ghost:hover { background: #f9fafb; }
.wafe-btn:focus-visible {
	outline: 2px solid var(--wafe-accent);
	outline-offset: 2px;
}

/* ----------------------- Empty / loading --------------------- */
.wafe-empty {
	color: var(--wafe-muted);
	font-size: 13px;
	padding: 8px 0;
	margin: 0;
}
.wafe-loading {
	position: relative;
	min-height: 200px;
}
.wafe-loading::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255,255,255,.6);
	z-index: 1;
	border-radius: var(--wafe-radius);
}
.wafe-loading::after {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	width: 32px; height: 32px;
	margin: -16px 0 0 -16px;
	border: 3px solid #e5e7eb;
	border-top-color: var(--wafe-accent);
	border-radius: 50%;
	animation: wafe-spin .8s linear infinite;
	z-index: 2;
}
@keyframes wafe-spin {
	to { transform: rotate(360deg); }
}

/* ----------------------- Backdrop ----------------------------- */
.wafe-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.45);
	z-index: 9998;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}
.wafe.is-open .wafe-backdrop {
	opacity: 1;
	pointer-events: auto;
}

/* ============================================================
   MOBILE (<= 1024px) — drawer
   ============================================================ */
@media (max-width: 1024px) {
	.wafe[data-mobile-drawer="1"] .wafe-mobile-toggle { display: inline-flex; }
	.wafe[data-mobile-drawer="1"] .wafe-panel {
		position: fixed;
		top: 0; right: 0;
		width: min(420px, 92vw);
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
		border-left: 1px solid var(--wafe-border);
		border-top: 0;
		border-right: 0;
		border-bottom: 0;
		transform: translateX(100%);
		transition: transform .25s ease;
		z-index: 9999;
		display: flex;
		flex-direction: column;
		box-shadow: -8px 0 24px rgba(0,0,0,.1);
	}
	.wafe[data-mobile-drawer="1"].is-open .wafe-panel {
		transform: translateX(0);
	}
	.wafe[data-mobile-drawer="1"] .wafe-panel-close { display: inline-flex; }
	.wafe[data-mobile-drawer="1"] .wafe-form {
		flex: 1;
		max-height: none;
	}
}

@media (min-width: 1025px) {
	.wafe .wafe-mobile-toggle { display: none; }
	.wafe .wafe-backdrop { display: none !important; }
}

/* ----------------------- Reduced motion ----------------------- */
@media (prefers-reduced-motion: reduce) {
	.wafe *,
	.wafe *::before,
	.wafe *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* ----------------------- Dark scheme support ------------------ */
@media (prefers-color-scheme: dark) {
	.wafe[data-dark-auto="1"] {
		--wafe-bg: #111827;
		--wafe-text: #f9fafb;
		--wafe-muted: #9ca3af;
		--wafe-border: #1f2937;
		--wafe-accent: #f9fafb;
	}
}

/* ----------------------- Pagination styling ------------------- */
.wafe-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	list-style: none;
	margin: 24px 0 0;
	padding: 0;
}
.wafe-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
}
.wafe-pagination .page-numbers.current {
	background: #0a0a0a;
	color: #fff;
	border-color: #0a0a0a;
}
