/* XWoo Filter — Elementor widget styles. Mobile-menu first. */

.xwoo-filter-wrap {
	--xwoo-accent: #af1f31;
	--xwoo-anim: 240ms;
	--xwoo-drawer-width: 380px;
	--xwoo-z-backdrop: 99998;
	--xwoo-z-drawer: 99999;
	--xwoo-row-divider: rgba(0,0,0,0.08);
	--xwoo-row-hover: rgba(0,0,0,0.04);
	--xwoo-row-active: rgba(0,0,0,0.06);
	--xwoo-header-height: 56px;
	box-sizing: border-box;
}
.xwoo-filter-wrap *,
.xwoo-filter-wrap *::before,
.xwoo-filter-wrap *::after { box-sizing: border-box; }

/* ───── Trigger button (the "open menu" affordance) ─────
   Transparent, small, icon-led. Theme button rules (Astra/Woo) get heavy-handed,
   so override with !important. */
.xwoo-filter-trigger-wrap {
	display: flex;
	width: 100%;
	margin-bottom: 0.75rem;
}
.xwoo-filter-trigger {
	display: inline-flex !important;
	align-items: center;
	gap: 0.5em;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--xwoo-accent) !important;
	cursor: pointer;
	font: inherit;
	font-weight: 600 !important;
	font-size: 14px !important;
	line-height: 1.2 !important;
	padding: 6px 8px !important;
	min-height: 0 !important;
	height: auto !important;
	border-radius: 6px !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	transition: opacity var(--xwoo-anim), transform 120ms ease, background-color var(--xwoo-anim);
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}
.xwoo-filter-trigger:hover,
.xwoo-filter-trigger:focus {
	background: rgba(0,0,0,0.05) !important;
	color: var(--xwoo-accent) !important;
	outline: none;
}
.xwoo-filter-trigger:active { transform: scale(0.96); }
.xwoo-filter-trigger-icon {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	font-size: 20px;
}
.xwoo-filter-trigger-icon svg,
.xwoo-filter-trigger-icon i {
	width: 1em;
	height: 1em;
	font-size: 1em;
	color: var(--xwoo-accent) !important;
	fill: currentColor;
}
.xwoo-filter-trigger-text {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.xwoo-filter-trigger-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.4em;
	height: 1.4em;
	padding: 0 0.4em;
	border-radius: 999px;
	background: var(--xwoo-accent);
	color: #fff;
	font-size: 0.7em;
	font-weight: 700;
	margin-left: 0.2em;
}
.xwoo-filter-trigger-count[hidden] { display: none; }

/* ───── Inline container (used when display_mode = inline) ───── */
.xwoo-filter { width: 100%; }
.xwoo-filter-inline .xwoo-filter { background: transparent; }

/* ───── Section row: looks like an iOS/Android settings list item ───── */
.xwoo-filter .prdctfltr_filter {
	border-bottom: 1px solid var(--xwoo-row-divider);
	padding: 0;
	margin: 0;
	background: transparent;
}
.xwoo-filter .prdctfltr_filter:last-child { border-bottom: none; }

.xwoo-filter .pf-help-title {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	min-height: 56px;
	cursor: default;
	user-select: none;
	margin: 0;
	background: transparent;
	transition: background-color var(--xwoo-anim);
	-webkit-tap-highlight-color: transparent;
}
.xwoo-collapsible .xwoo-filter .pf-help-title { cursor: pointer; }
.xwoo-collapsible .xwoo-filter .pf-help-title:hover { background-color: var(--xwoo-row-hover); }
.xwoo-collapsible .xwoo-filter .pf-help-title:active { background-color: var(--xwoo-row-active); }

.xwoo-filter .pf-help-title .widget-title,
.xwoo-filter .pf-help-title .prdctfltr_widget_title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 1;
	margin: 0;
	padding: 0;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.3;
	text-align: left;
	transition: color var(--xwoo-anim);
}

/* Chevron — rotates 180° when section is open */
.xwoo-filter .prdctfltr-down,
.xwoo-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-left: 0.5em;
	transition: transform var(--xwoo-anim);
	color: currentColor;
	flex: 0 0 auto;
}
.xwoo-filter .prdctfltr-down::before,
.xwoo-chevron::before {
	content: '';
	display: block;
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translate(-15%, -15%);
	transform-origin: center;
}
.xwoo-collapsible .prdctfltr_filter.xwoo-open > .pf-help-title .prdctfltr-down,
.xwoo-collapsible .prdctfltr_filter.xwoo-open > .pf-help-title .xwoo-chevron {
	transform: rotate(180deg);
}

/* Smooth dropdown body — uses grid-template-rows trick for animation that adapts to content */
.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_add_scroll,
.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_add_inputs,
.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_range_wrapper {
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows var(--xwoo-anim) ease, opacity var(--xwoo-anim);
	opacity: 1;
}
.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_add_scroll > *,
.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_add_inputs > *,
.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_range_wrapper > * {
	min-height: 0;
	overflow: hidden;
}
.xwoo-collapsible .prdctfltr_filter.xwoo-closed > .prdctfltr_add_scroll,
.xwoo-collapsible .prdctfltr_filter.xwoo-closed > .prdctfltr_add_inputs,
.xwoo-collapsible .prdctfltr_filter.xwoo-closed > .prdctfltr_range_wrapper {
	grid-template-rows: 0fr;
	opacity: 0;
	pointer-events: none;
}

/* Fallback for browsers that can't animate grid-template-rows */
@supports not (grid-template-rows: 1fr) {
	.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_add_scroll,
	.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_add_inputs,
	.xwoo-collapsible .xwoo-filter .prdctfltr_filter > .prdctfltr_range_wrapper {
		display: block;
		max-height: 2000px;
		overflow: hidden;
		transition: max-height var(--xwoo-anim) ease;
	}
	.xwoo-collapsible .prdctfltr_filter.xwoo-closed > .prdctfltr_add_scroll,
	.xwoo-collapsible .prdctfltr_filter.xwoo-closed > .prdctfltr_add_inputs,
	.xwoo-collapsible .prdctfltr_filter.xwoo-closed > .prdctfltr_range_wrapper {
		max-height: 0;
	}
}

/* Option rows — big tap targets, full-width */
.xwoo-filter .prdctfltr_checkboxes {
	padding: 4px 20px 12px;
}
.xwoo-filter .prdctfltr_checkboxes label {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 12px 4px;
	min-height: 44px;
	margin: 0;
	cursor: pointer;
	border-radius: 6px;
	border-bottom: 1px solid rgba(0,0,0,0.04);
	transition: color var(--xwoo-anim), background-color var(--xwoo-anim);
	-webkit-tap-highlight-color: transparent;
}
.xwoo-filter .prdctfltr_checkboxes label:last-child { border-bottom: none; }
.xwoo-filter .prdctfltr_checkboxes label:hover { background-color: var(--xwoo-row-hover); }
.xwoo-filter .prdctfltr_checkboxes label:active { background-color: var(--xwoo-row-active); }
.xwoo-filter .prdctfltr_checkboxes label span { font-size: 15px; }
.xwoo-filter .prdctfltr_checkboxes input[type="checkbox"],
.xwoo-filter .prdctfltr_checkboxes input[type="radio"] {
	accent-color: var(--xwoo-accent);
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	cursor: pointer;
}

/* Buttons inside the form (sale / out-of-stock toggles) — left native */
.xwoo-filter .prdctfltr_buttons {
	padding: 16px 20px;
}
.xwoo-filter .prdctfltr_buttons label {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 10px 0;
	min-height: 44px;
	cursor: pointer;
}

/* ───── Drawer / Full-screen overlay ─────
   Drawers and backdrops are portaled to <body> on init (so transformed
   Elementor ancestors can't break position:fixed). Styles target the
   elements directly — not via the wrap — and use !important on layout
   primitives so theme overrides can't dislodge them. */
.xwoo-filter-backdrop {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	background-color: rgba(0,0,0,0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--xwoo-anim);
	z-index: 99998;
	pointer-events: none;
}
.xwoo-filter-backdrop.xwoo-open,
.xwoo-filter-wrap.xwoo-open > .xwoo-filter-backdrop {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.xwoo-filter-drawer {
	position: fixed !important;
	top: 0 !important;
	bottom: 0 !important;
	width: var(--xwoo-drawer-width, 380px);
	max-width: 100vw;
	z-index: 99999;
	transform: translateX(-100%);
	transition: transform var(--xwoo-anim) ease, opacity var(--xwoo-anim) ease;
	visibility: hidden;
	display: flex !important;
	flex-direction: column;
	margin: 0 !important;
}
.xwoo-filter-drawer.xwoo-mode-drawer.xwoo-drawer-left,
.xwoo-mode-drawer.xwoo-drawer-left .xwoo-filter-drawer  { left: 0 !important; right: auto !important; transform: translateX(-100%); }
.xwoo-filter-drawer.xwoo-mode-drawer.xwoo-drawer-right,
.xwoo-mode-drawer.xwoo-drawer-right .xwoo-filter-drawer { right: 0 !important; left: auto !important; transform: translateX(100%); }
.xwoo-filter-drawer.xwoo-mode-fullscreen,
.xwoo-mode-fullscreen .xwoo-filter-drawer {
	top: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100vw !important;
	max-width: 100vw !important;
	transform: translateY(100%);
}

/* Popup mode: centered modal, scale-in feel */
.xwoo-filter-drawer.xwoo-mode-popup,
.xwoo-mode-popup .xwoo-filter-drawer {
	top: 50% !important;
	left: 50% !important;
	bottom: auto !important;
	right: auto !important;
	width: var(--xwoo-popup-width, min(480px, calc(100vw - 32px))) !important;
	max-width: calc(100vw - 32px) !important;
	height: auto !important;
	max-height: var(--xwoo-popup-max-h, 85vh);
	transform: translate(-50%, -50%) scale(0.96);
	opacity: 0;
	border-radius: 12px;
	overflow: hidden;
}
.xwoo-filter-drawer.xwoo-mode-popup.xwoo-open,
.xwoo-mode-popup .xwoo-filter-drawer.xwoo-open {
	transform: translate(-50%, -50%) scale(1) !important;
	opacity: 1;
}
.xwoo-filter-drawer.xwoo-mode-popup .xwoo-filter-drawer-panel {
	border-radius: 12px;
	max-height: var(--xwoo-popup-max-h, 85vh);
}
@media (max-width: 540px) {
	.xwoo-filter-drawer.xwoo-mode-popup,
	.xwoo-mode-popup .xwoo-filter-drawer {
		width: calc(100vw - 24px) !important;
		max-height: calc(100vh - 32px);
	}
}
.xwoo-filter-drawer.xwoo-open,
.xwoo-filter-wrap.xwoo-open > .xwoo-filter-drawer {
	transform: translate(0, 0) !important;
	visibility: visible;
}

/* Mobile: drawers go full width below this breakpoint */
@media (max-width: 540px) {
	.xwoo-filter-drawer.xwoo-mode-drawer,
	.xwoo-mode-drawer .xwoo-filter-drawer { width: 100vw !important; }
}

/* Drawer panel — relative so the close button can absolute-position to its corner */
.xwoo-filter-drawer-panel {
	position: relative !important;
	background: #fff;
	color: inherit;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 40px rgba(0,0,0,0.18);
}

/* Drawer header — title only; close button sits absolutely over the corner */
.xwoo-filter-drawer-header {
	position: sticky !important;
	top: 0 !important;
	z-index: 2;
	padding: 14px 56px 14px 20px !important;
	min-height: var(--xwoo-header-height);
	display: flex !important;
	align-items: center !important;
	border-bottom: 1px solid var(--xwoo-row-divider);
	flex: 0 0 auto;
	background: inherit;
}
.xwoo-filter-drawer-title {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
	flex: 1 1 auto;
	text-align: left;
	min-width: 0;
}

/* Close button — direct child of .xwoo-filter-drawer, pinned to its top-right.
   The drawer is position:fixed (or relative as fallback) so absolute positioning
   pins to the drawer corner, not to whatever nested element it lives in. */
.xwoo-filter-drawer > button.xwoo-filter-close,
.xwoo-filter-drawer > .xwoo-filter-close,
button.xwoo-filter-close {
	position: absolute !important;
	top: 12px !important;
	right: 12px !important;
	left: auto !important;
	bottom: auto !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--xwoo-accent) !important;
	cursor: pointer !important;
	line-height: 0 !important;
	border-radius: 50% !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: background-color var(--xwoo-anim), transform 120ms ease;
	-webkit-tap-highlight-color: transparent;
	z-index: 10;
	font-size: 0 !important;
	float: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	white-space: nowrap !important;
	flex: none !important;
}
.xwoo-filter-drawer > button.xwoo-filter-close:hover,
.xwoo-filter-drawer > button.xwoo-filter-close:focus,
button.xwoo-filter-close:hover,
button.xwoo-filter-close:focus {
	background-color: rgba(0,0,0,0.06) !important;
	color: var(--xwoo-accent) !important;
}
button.xwoo-filter-close:active { transform: scale(0.92); }
button.xwoo-filter-close svg {
	width: 18px !important;
	height: 18px !important;
	stroke: currentColor !important;
	fill: none !important;
	display: block !important;
}
button.xwoo-filter-close svg path { stroke: currentColor !important; fill: none !important; }

.xwoo-filter-drawer-body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* Strip the drawer body padding from the inner filter so section rows reach the edge — feels much more native */
.xwoo-filter-drawer-body .xwoo-filter { padding: 0 !important; background: transparent !important; }
.xwoo-filter-drawer-body .xwoo-filter > .prdctfltr_wc { padding: 0; }
.xwoo-filter-drawer-body .xwoo-filter form { margin: 0; }

/* Drawer footer (sticky action bar): even spacing — outer padding equals gap */
.xwoo-filter-drawer-footer {
	flex: 0 0 auto;
	display: flex;
	gap: 20px;
	padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--xwoo-row-divider);
	background: inherit;
	position: sticky;
	bottom: 0;
}
.xwoo-filter-reset,
.xwoo-filter-apply {
	flex: 1;
	cursor: pointer;
	padding: 14px 16px !important;
	min-height: 48px;
	border-radius: 8px !important;
	font-weight: 600 !important;
	font-size: 15px !important;
	line-height: 1.2 !important;
	transition: background-color var(--xwoo-anim), color var(--xwoo-anim), transform 120ms ease;
	-webkit-tap-highlight-color: transparent;
	background: transparent !important;
	color: var(--xwoo-accent) !important;
	border: 2px solid var(--xwoo-accent) !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}
.xwoo-filter-reset:hover,
.xwoo-filter-apply:hover,
.xwoo-filter-reset:focus,
.xwoo-filter-apply:focus {
	background: var(--xwoo-accent) !important;
	color: #fff !important;
	border-color: var(--xwoo-accent) !important;
}
.xwoo-filter-reset:active,
.xwoo-filter-apply:active { transform: scale(0.98); }

/* Body lock while drawer open */
body.xwoo-filter-locked { overflow: hidden; }

/* ───── Mobile-force-drawer behavior for inline mode ───── */
.xwoo-mode-inline .xwoo-mobile-only { display: none; }
.xwoo-mode-inline.xwoo-mobile-drawer .xwoo-mobile-only { display: flex; }

@media (max-width: 921px) {
	.xwoo-mode-inline.xwoo-mobile-drawer .xwoo-filter-inline {
		position: fixed;
		top: 0;
		left: 0;
		width: min(85vw, 380px);
		height: 100vh;
		max-width: 100vw;
		background: #fff;
		z-index: var(--xwoo-z-drawer);
		transform: translateX(-100%);
		transition: transform var(--xwoo-anim) ease;
		visibility: hidden;
		overflow-y: auto;
		padding-top: var(--xwoo-header-height);
		box-shadow: 0 10px 40px rgba(0,0,0,0.18);
	}
	.xwoo-mode-inline.xwoo-mobile-drawer.xwoo-open .xwoo-filter-inline {
		transform: translateX(0);
		visibility: visible;
	}
	.xwoo-mode-inline.xwoo-mobile-drawer .xwoo-filter-inline::before {
		content: '';
		position: absolute;
		top: 0; left: 0; right: 0;
		height: var(--xwoo-header-height);
		border-bottom: 1px solid var(--xwoo-row-divider);
		background: inherit;
	}
}
@media (min-width: 922px) {
	.xwoo-mode-inline.xwoo-mobile-drawer .xwoo-filter-trigger-wrap.xwoo-mobile-only,
	.xwoo-mode-inline.xwoo-mobile-drawer .xwoo-filter-backdrop {
		display: none;
	}
}

/* ───── Elementor editor preview ─────
   We let the drawer/popup behave the same in editor and live: hidden until the
   trigger is clicked. Designers click the trigger to open and configure it.
   No special inline-mode override here anymore. */

/* Editor placeholder */
.xwoo-filter-placeholder {
	padding: 20px;
	border: 1px dashed rgba(0,0,0,0.2);
	color: rgba(0,0,0,0.55);
	border-radius: 6px;
	text-align: center;
	font-size: 14px;
}

/* Focus visibility */
.xwoo-filter-trigger:focus-visible,
.xwoo-filter-close:focus-visible,
.xwoo-filter-reset:focus-visible,
.xwoo-filter-apply:focus-visible {
	outline: 2px solid var(--xwoo-accent);
	outline-offset: 2px;
}

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