/* ==========================================================================
   Shopify-Style Mobile & Desktop Filters Pro (MFX)
   ========================================================================== */

.mfx-root {
	--mfx-accent: var(--spf-accent, #111827);
	--mfx-ink: var(--spf-accent-text, #ffffff);
	--mfx-text: #111827;
	--mfx-muted: #6b7280;
	--mfx-line: #e5e7eb;
	--mfx-soft: #f3f4f6;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0s linear .34s;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-tap-highlight-color: transparent;
}
.mfx-root.is-open {
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}
.mfx-root *,
.mfx-root *::before,
.mfx-root *::after {
	box-sizing: border-box;
}
html.mfx-lock,
html.mfx-lock body {
	overflow: hidden !important;
}

/* Backdrop */
.mfx-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	opacity: 0;
	transition: opacity .28s ease;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}
.mfx-root.is-open .mfx-overlay {
	opacity: 1;
}

/* Sheet / Drawer */
.mfx-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 88vh;
	height: 88dvh;
	max-height: calc(100vh - 20px);
	display: flex;
	flex-direction: column;
	background: #ffffff;
	color: var(--mfx-text);
	border-radius: 22px 22px 0 0;
	box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.22);
	transform: translateY(100%);
	transition: transform .34s cubic-bezier(.32, .72, 0, 1);
	outline: 0;
	overflow: hidden;
}
.mfx-root.is-open .mfx-sheet {
	transform: none;
}

/* Header & Grab Handle */
.mfx-grab {
	flex: none;
	border-bottom: 1px solid var(--mfx-line);
	touch-action: none;
	background: #ffffff;
}
.mfx-handle {
	display: block;
	width: 42px;
	height: 4px;
	border-radius: 4px;
	background: #d1d5db;
	margin: 10px auto 6px;
}
.mfx-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 20px 14px;
}
.mfx-head-left {
	display: flex;
	align-items: center;
	gap: 8px;
}
#mfx-filters .mfx-head h2 {
	margin: 0;
	padding: 0;
	font-size: 19px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--mfx-text);
	text-transform: none;
}
.mfx-head-sub {
	font-size: 12px;
	font-weight: 600;
	color: var(--mfx-muted);
	background: var(--mfx-soft);
	padding: 2px 8px;
	border-radius: 999px;
}
#mfx-filters .mfx-x {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-height: 0;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mfx-soft);
	color: var(--mfx-text);
	box-shadow: none;
	cursor: pointer;
	transition: background .15s;
}
#mfx-filters .mfx-x:hover {
	background: #e5e7eb;
}

/* Scrollable Form Body */
.mfx-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 0 20px 16px;
	margin: 0;
}

/* Search Input inside Filters */
.mfx-search-wrap {
	padding: 14px 0 6px;
}
.mfx-search-box {
	position: relative;
	display: flex;
	align-items: center;
}
.mfx-search-box svg {
	position: absolute;
	left: 13px;
	color: var(--mfx-muted);
	pointer-events: none;
}
#mfx-filters .mfx-search-in {
	width: 100%;
	height: 44px;
	padding: 0 14px 0 40px;
	border: 1.5px solid var(--mfx-line);
	border-radius: 12px;
	background: var(--mfx-soft);
	font-size: 14px;
	font-weight: 500;
	color: var(--mfx-text);
	outline: none;
	box-shadow: none;
	transition: border-color .15s, background .15s;
}
#mfx-filters .mfx-search-in:focus {
	background: #ffffff;
	border-color: var(--mfx-accent);
}

/* Accordion Sections */
.mfx-sec {
	border-bottom: 1px solid var(--mfx-line);
}
.mfx-sec > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--mfx-text);
	cursor: pointer;
	list-style: none;
	-webkit-user-select: none;
	user-select: none;
}
.mfx-sec > summary::-webkit-details-marker {
	display: none;
}
.mfx-sec > summary::after {
	content: "";
	width: 8px;
	height: 8px;
	margin-right: 4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s ease;
	opacity: .75;
}
.mfx-sec[open] > summary::after {
	transform: rotate(-135deg);
}

/* Hidden Native Inputs */
#mfx-filters .mfx-in {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	pointer-events: none !important;
	appearance: none;
	-webkit-appearance: none;
}

/* Pills & Chips */
.mfx-pills,
.mfx-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 0 16px;
}
.mfx-pill,
.mfx-chip {
	position: relative;
	cursor: pointer;
	margin: 0;
}
.mfx-pill span,
.mfx-chip span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 14px;
	border: 1.5px solid var(--mfx-line);
	border-radius: 999px;
	background: #ffffff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--mfx-text);
	transition: all .15s ease;
}
.mfx-chip span i {
	font-style: normal;
	font-size: 11px;
	opacity: 0.65;
	font-weight: 500;
}
.mfx-in:checked + span {
	background: var(--mfx-accent);
	border-color: var(--mfx-accent);
	color: var(--mfx-ink);
}
.mfx-in:focus-visible + span,
.mfx-in:focus-visible + .mfx-box,
.mfx-in:focus-visible + i {
	outline: 2px solid var(--mfx-accent);
	outline-offset: 2px;
}

/* Toggle Switch Rows (Availability) */
.mfx-row {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0 14px;
	font-size: 14px;
	font-weight: 500;
	color: var(--mfx-text);
	cursor: pointer;
	margin: 0;
}
.mfx-row-label {
	display: flex;
	align-items: center;
	gap: 6px;
}
.mfx-row-label em {
	font-style: normal;
	font-size: 12px;
	color: var(--mfx-muted);
}
.mfx-sw {
	position: relative;
	display: inline-block;
	flex: none;
}
.mfx-sw i {
	display: block;
	width: 46px;
	height: 26px;
	border-radius: 99px;
	background: #d1d5db;
	position: relative;
	transition: background .2s;
}
.mfx-sw i::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	transition: transform .2s;
}
.mfx-in:checked + i {
	background: var(--mfx-accent);
}
.mfx-in:checked + i::after {
	transform: translateX(20px);
}

/* Category List with Checkboxes */
.mfx-list {
	padding-bottom: 12px;
	max-height: 280px;
	overflow-y: auto;
}
.mfx-opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 4px 9px calc(var(--d, 0) * 20px);
	font-size: 14px;
	font-weight: 500;
	color: var(--mfx-text);
	cursor: pointer;
	margin: 0;
	border-radius: 8px;
	transition: background .12s;
}
.mfx-opt:hover {
	background: #f9fafb;
}
.mfx-box {
	flex: none;
	width: 20px;
	height: 20px;
	display: inline-grid;
	place-items: center;
	border: 1.5px solid #cbd5e1;
	border-radius: 6px;
	background: #ffffff;
	transition: background .15s, border-color .15s;
}
.mfx-box::after {
	content: "";
	width: 5px;
	height: 10px;
	margin-top: -2px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform .15s;
}
.mfx-in:checked + .mfx-box {
	background: var(--mfx-accent);
	border-color: var(--mfx-accent);
}
.mfx-in:checked + .mfx-box::after {
	transform: rotate(45deg) scale(1);
}
.mfx-opt em {
	margin-left: auto;
	font-style: normal;
	font-size: 12px;
	font-weight: 600;
	color: var(--mfx-muted);
	background: var(--mfx-soft);
	padding: 2px 7px;
	border-radius: 999px;
}

/* Price / Amount Range Section */
.mfx-price {
	padding: 0 0 18px;
}
.mfx-price-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	font-size: 13px;
	color: var(--mfx-muted);
}
.mfx-price-head strong {
	color: var(--mfx-text);
	font-weight: 700;
}
.mfx-price-in {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}
.mfx-price-in em {
	font-style: normal;
	color: var(--mfx-muted);
	font-weight: 600;
}
.mfx-price-in label {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 6px;
	height: 46px;
	padding: 0 12px;
	border: 1.5px solid var(--mfx-line);
	border-radius: 10px;
	background: #ffffff;
	margin: 0;
}
.mfx-price-in label:focus-within {
	border-color: var(--mfx-accent);
}
.mfx-price-in label span {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--mfx-muted);
}
.mfx-price-in label b {
	font-weight: 700;
	color: var(--mfx-text);
	font-size: 14px;
}
#mfx-filters .mfx-price-in input {
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	outline: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--mfx-text);
	-moz-appearance: textfield;
}
#mfx-filters .mfx-price-in input::-webkit-outer-spin-button,
#mfx-filters .mfx-price-in input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.mfx-range {
	position: relative;
	height: 30px;
	margin: 4px 0 14px;
	--lf: 0;
	--rf: 1;
}
.mfx-track,
.mfx-fill {
	position: absolute;
	top: 50%;
	height: 5px;
	margin-top: -2.5px;
	border-radius: 5px;
}
.mfx-track {
	left: 12px;
	right: 12px;
	background: #e2e8f0;
}
.mfx-fill {
	background: var(--mfx-accent);
	left: calc(12px + (100% - 24px) * var(--lf));
	right: calc(12px + (100% - 24px) * (1 - var(--rf)));
}
#mfx-filters .mfx-range input[type=range] {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 30px;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
	outline: 0;
}
#mfx-filters .mfx-range input[type=range]::-webkit-slider-runnable-track {
	-webkit-appearance: none;
	background: transparent;
	height: 30px;
	border: 0;
}
#mfx-filters .mfx-range input[type=range]::-moz-range-track {
	background: transparent;
	height: 30px;
	border: 0;
}
#mfx-filters .mfx-range input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: 24px;
	height: 24px;
	margin-top: 3px;
	border-radius: 50%;
	background: #ffffff;
	border: 2.5px solid var(--mfx-accent);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
	cursor: grab;
}
#mfx-filters .mfx-range input[type=range]::-moz-range-thumb {
	pointer-events: auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ffffff;
	border: 2.5px solid var(--mfx-accent);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
	cursor: grab;
}

/* Quick Price Bracket Buttons */
.mfx-price-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.mfx-preset-btn {
	appearance: none;
	-webkit-appearance: none;
	background: var(--mfx-soft);
	color: var(--mfx-text);
	border: 1px solid var(--mfx-line);
	border-radius: 999px;
	padding: 5px 11px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s ease;
}
.mfx-preset-btn:hover,
.mfx-preset-btn.is-active {
	background: var(--mfx-accent);
	color: var(--mfx-ink);
	border-color: var(--mfx-accent);
}

/* Drawer Footer */
.mfx-foot {
	flex: none;
	display: grid;
	grid-template-columns: 1fr 1.7fr;
	gap: 12px;
	padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--mfx-line);
	background: #ffffff;
}
#mfx-filters .mfx-btn {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	min-height: 50px;
	margin: 0;
	padding: 0 16px;
	border-radius: 12px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.2px;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	transition: transform .12s, opacity .2s;
}
#mfx-filters .mfx-btn:active {
	transform: scale(.98);
}
#mfx-filters .mfx-btn:disabled {
	opacity: .6;
	cursor: default;
}
#mfx-filters .mfx-solid {
	background: var(--mfx-accent);
	color: var(--mfx-ink);
	border: 1.5px solid var(--mfx-accent);
}
#mfx-filters .mfx-ghost {
	background: #ffffff;
	color: var(--mfx-text);
	border: 1.5px solid var(--mfx-line);
}

/* Bottom Nav Badge */
.mfx-nav-filter {
	position: relative;
}
.mfx-nav-badge {
	position: absolute;
	top: 2px;
	left: calc(50% + 6px);
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 99px;
	background: var(--spf-accent, #111827);
	color: var(--spf-accent-text, #ffffff);
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	pointer-events: none;
	box-shadow: 0 0 0 2px #ffffff;
}
.mfx-nav-badge[hidden] {
	display: none !important;
}

/* Shop Toolbar Filter Trigger & Active Filter Chips */
.mfx-shop-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 16px;
	padding: 0;
}
.mfx-trigger-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #ffffff;
	color: #111827;
	border: 1.5px solid #e5e7eb;
	border-radius: 999px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
	transition: all .15s ease;
}
.mfx-trigger-btn:hover {
	border-color: var(--spf-accent, #111827);
	background: #f9fafb;
}
.mfx-trigger-btn svg {
	flex: none;
}
.mfx-trigger-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--spf-accent, #111827);
	color: var(--spf-accent-text, #ffffff);
	font-size: 11px;
	font-weight: 700;
}
.mfx-active-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.mfx-active-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #f3f4f6;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	padding: 5px 11px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	transition: all .15s ease;
}
.mfx-active-tag:hover {
	background: #e5e7eb;
	color: #111827;
}
.mfx-active-clear {
	font-size: 12px;
	font-weight: 700;
	color: #dc2626;
	text-decoration: underline;
	padding: 4px 6px;
}

@media (min-width: 768px) {
	.mfx-sheet {
		left: auto;
		top: 0;
		width: 430px;
		height: 100%;
		max-height: none;
		border-radius: 0;
		transform: translateX(100%);
		box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16);
	}
	.mfx-handle {
		display: none;
	}
	.mfx-grab {
		touch-action: auto;
	}
	.mfx-head {
		padding-top: 18px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.mfx-sheet,
	.mfx-overlay {
		transition: none;
	}
}
