/* Mike iStore Shop Filters
 * Change the look from the variables below.
 */
.mf-filters {
	--mf-bg: #ffffff;
	--mf-page-bg: #f5f6f8;
	--mf-border: #eceef1;
	--mf-text: #111111;
	--mf-muted: #6b7280;
	--mf-soft: #f3f4f6;
	--mf-accent: #111111;
	--mf-accent-text: #ffffff;
	--mf-radius: 16px;
	--mf-gap: 16px;

	font-size: 14px;
	line-height: 1.4;
	color: var(--mf-text);
}

.mf-filters *,
.mf-filters *::before,
.mf-filters *::after { box-sizing: border-box; }

.mf-filters svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}

/* Reset theme button and link styles inside the filters */
.mf-filters button,
.mf-filters button:hover,
.mf-filters button:focus {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font: inherit;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}
.mf-filters a,
.mf-filters a:hover,
.mf-filters a:focus { color: inherit; text-decoration: none; box-shadow: none; }
.mf-filters :focus-visible { outline: 2px solid var(--mf-accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.mf-scroll { display: flex; flex-direction: column; gap: var(--mf-gap); }

.mf-card {
	background: var(--mf-bg);
	border: 1px solid var(--mf-border);
	border-radius: var(--mf-radius);
	padding: 18px;
}

/* ---------- Group header ---------- */
.mf-filters .mf-group-head {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 15px;
	font-weight: 700;
	text-align: left;
}
.mf-chevron { color: var(--mf-muted); transition: transform .2s ease; }
.mf-group-body { margin-top: 12px; }
.mf-group.is-collapsed .mf-group-body { display: none; }
.mf-group.is-collapsed .mf-chevron { transform: rotate(-90deg); }

/* ---------- Option lists ---------- */
/* Lists take the full height they need: no inner scrollbars */
.mf-filters .mf-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: none;
	overflow: visible;
}
.mf-filters .mf-list li { margin: 0; padding: 0; list-style: none; }

.mf-filters .mf-opt,
.mf-filters .mf-cat {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 38px;
	margin: 0;
	padding: 7px 8px;
	border-radius: 10px;
	transition: background-color .15s ease;
}
.mf-opt:hover,
.mf-cat:hover { background: var(--mf-soft); }

.mf-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.mf-count {
	flex: none;
	min-width: 26px;
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--mf-soft);
	color: var(--mf-muted);
	font-size: 12px;
	text-align: center;
}
.mf-opt:hover .mf-count,
.mf-cat:hover .mf-count { background: #e9eaee; }

/* Checkbox */
.mf-box {
	position: relative;
	flex: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid #cfd3d9;
	border-radius: 5px;
	background: #fff;
	transition: background-color .15s ease, border-color .15s ease;
}
.mf-opt:hover .mf-box { border-color: var(--mf-accent); }
.mf-opt.is-active .mf-box { background: var(--mf-accent); border-color: var(--mf-accent); }
.mf-opt.is-active .mf-box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1.5px;
	width: 5px;
	height: 10px;
	border: solid var(--mf-accent-text);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.mf-opt.is-active .mf-label { font-weight: 600; }

/* Options with no products right now */
.mf-filters .mf-opt.is-disabled { opacity: .45; cursor: default; }
.mf-filters .mf-opt.is-disabled:hover { background: transparent; }
.mf-filters .mf-opt.is-disabled:hover .mf-box { border-color: #cfd3d9; }

/* Categories */
.mf-filters .mf-cat.mf-depth-1 { padding-left: 24px; color: #374151; }
.mf-filters .mf-cat.mf-depth-2 { padding-left: 40px; color: #374151; font-size: 13px; }
.mf-cat.is-ancestor { font-weight: 600; }
.mf-cat.is-current { background: var(--mf-accent); color: var(--mf-accent-text); font-weight: 600; }
.mf-filters a.mf-cat.is-current,
.mf-filters a.mf-cat.is-current:hover { color: var(--mf-accent-text); background: var(--mf-accent); }
.mf-cat.is-current .mf-count { background: rgba(255, 255, 255, .18); color: var(--mf-accent-text); }

/* ---------- Price ---------- */
.mf-price-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.mf-price-field {
	position: relative;
	flex: 1;
	min-width: 0;
	margin: 0;
}
.mf-cur {
	position: absolute;
	left: 11px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--mf-muted);
	font-size: 13px;
	pointer-events: none;
}
.mf-filters .mf-price-field input {
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 8px 0 24px;
	border: 1px solid var(--mf-border);
	border-radius: 10px;
	background: #fff;
	color: var(--mf-text);
	font: inherit;
	font-size: 16px; /* 16px stops iOS zooming in on focus */
	box-shadow: none;
	-moz-appearance: textfield;
}
.mf-filters .mf-price-field input::-webkit-outer-spin-button,
.mf-filters .mf-price-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mf-filters .mf-price-field input:focus { border-color: var(--mf-accent); outline: none; }
.mf-price-sep { color: var(--mf-muted); }
.mf-filters .mf-price-go,
.mf-filters .mf-price-go:hover,
.mf-filters .mf-price-go:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--mf-accent);
	color: var(--mf-accent-text);
}

/* ---------- Active filters ---------- */
.mf-active-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	font-size: 15px;
	font-weight: 700;
}
.mf-filters .mf-clear { font-size: 13px; font-weight: 500; color: var(--mf-muted); text-decoration: underline; }
.mf-filters .mf-clear:hover { color: var(--mf-text); text-decoration: underline; }
.mf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mf-filters .mf-chip,
.mf-filters .mf-chip:hover {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px 6px 12px;
	border-radius: 999px;
	background: var(--mf-accent);
	color: var(--mf-accent-text);
	font-size: 13px;
	font-weight: 500;
}
.mf-chip svg { width: 14px; height: 14px; opacity: .8; }
.mf-chip:hover svg { opacity: 1; }

/* ---------- Loading state while products update ---------- */
body.mf-is-loading .elementor-widget-wc-archive-products,
body.mf-is-loading .elementor-widget-woocommerce-products,
body.mf-is-loading .elementor-widget-loop-grid,
body.mf-is-loading .mf-scroll {
	opacity: .45;
	pointer-events: none;
	transition: opacity .2s ease;
}

/* ---------- Mobile / tablet drawer ---------- */
.mf-scroll { overflow-x: hidden; }

/* Desktop: drawer parts hidden. !important beats theme button styles
   (Hello Elementor sets display on every button). */
@media (min-width: 1025px) {
	.mf-filters .mf-mobile-toggle,
	.mf-filters .mf-overlay,
	.mf-filters .mf-drawer-head,
	.mf-filters .mf-drawer-foot { display: none !important; }
}

@media (max-width: 1024px) {
	.mf-filters .mf-mobile-toggle,
	.mf-filters .mf-mobile-toggle:hover,
	.mf-filters .mf-mobile-toggle:focus {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		height: 46px;
		border: 1px solid var(--mf-border);
		border-radius: 12px;
		background: var(--mf-bg);
		color: var(--mf-text);
		font-size: 15px;
		font-weight: 600;
	}
	.mf-badge {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		height: 20px;
		padding: 0 6px;
		border-radius: 999px;
		background: var(--mf-accent);
		color: var(--mf-accent-text);
		font-size: 12px;
	}

	.mf-overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 99998;
		background: rgba(17, 17, 17, .45);
		opacity: 0;
		visibility: hidden;
		transition: opacity .25s ease, visibility .25s ease;
	}

	.mf-panel {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 99999;
		display: flex;
		flex-direction: column;
		width: min(380px, 88vw);
		height: 100%;
		height: 100dvh;
		background: var(--mf-page-bg);
		box-shadow: 0 0 40px rgba(0, 0, 0, .18);
		transform: translateX(-105%);
		visibility: hidden;
		transition: transform .3s ease, visibility .3s ease;
	}

	.mf-filters.mf-open .mf-overlay { opacity: 1; visibility: visible; }
	.mf-filters.mf-open .mf-panel { transform: none; visibility: visible; }

	.mf-drawer-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex: none;
		padding: 16px 16px 12px 20px;
	}
	.mf-drawer-title { font-size: 18px; font-weight: 700; }
	.mf-filters .mf-close,
	.mf-filters .mf-close:hover,
	.mf-filters .mf-close:focus {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		border-radius: 10px;
		background: var(--mf-bg);
		border: 1px solid var(--mf-border);
	}

	.mf-scroll {
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		padding: 4px 16px 16px;
		gap: 12px;
	}

	/* Larger tap targets */
	.mf-filters .mf-opt,
	.mf-filters .mf-cat { min-height: 44px; }

	.mf-drawer-foot {
		display: block;
		flex: none;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		background: var(--mf-bg);
		border-top: 1px solid var(--mf-border);
	}
	.mf-filters .mf-apply,
	.mf-filters .mf-apply:hover,
	.mf-filters .mf-apply:focus {
		display: block;
		width: 100%;
		height: 48px;
		border-radius: 12px;
		background: var(--mf-accent);
		color: var(--mf-accent-text);
		font-size: 15px;
		font-weight: 600;
		text-align: center;
	}

	html.mf-lock,
	html.mf-lock body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	.mf-panel,
	.mf-overlay,
	.mf-chevron { transition: none; }
}
