/* 1. Theme tokens and outer shell. Inner cards retain their own backgrounds. */
.mpf {
	--mpf-accent: #3f4a2c;
	--mpf-border: #dfe2d7;
	--mpf-panel-bg: #fcfbf7;
	--mpf-muted-bg: #eef0e9;
	--mpf-muted-text: #68734a;
	--mpf-pill-radius: 999px;
	--mpf-panel-radius: 14px;
	--mpf-panel-shadow: 0 3px 14px rgba(40, 51, 31, .045);
	background: transparent;
	color: #28331f;
	overflow-anchor: none;
	position: relative;
	width: 100%;
}
.mpf [hidden] { display: none; }
.mpf-drawer-toggle[hidden],
.mpf-drawer:not([open]) { display: none !important; }

.mpf-drawer-toggle,
.mpf-drawer .mpf-drawer__done {
	background: #28331f;
	border: 0;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	min-height: 44px;
	padding: 8px 16px;
}
.mpf-drawer-toggle {
	border-radius: 0 999px 999px 0;
	bottom: calc(80px + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 3px 12px rgba(0, 0, 0, .2);
	left: 0;
	padding-left: max(16px, env(safe-area-inset-left, 0px));
	position: fixed;
	z-index: 1000;
}
.mpf-drawer[open] {
	background: #fff;
	border: 0;
	box-shadow: 8px 0 32px rgba(0, 0, 0, .18);
	box-sizing: border-box;
	color: #28331f;
	display: flex;
	flex-direction: column;
	height: 100%;
	height: 100dvh;
	inset: 0 auto 0 0;
	margin: 0;
	max-height: none;
	max-width: none;
	overflow: hidden;
	padding: 0;
	position: fixed;
	width: min(420px, calc(100% - 24px));
}
.mpf-drawer::backdrop { background: rgba(0, 0, 0, .48); }
html:has(.mpf-drawer[open]) { overflow: hidden; }
.mpf-drawer__header,
.mpf-drawer__content,
.mpf-drawer__footer { padding-inline: max(16px, env(safe-area-inset-left, 0px)) 16px; }
.mpf-drawer__header {
	align-items: center;
	border-bottom: 1px solid #dfe2d7;
	display: flex;
	justify-content: space-between;
	padding-block: max(8px, env(safe-area-inset-top, 0px)) 8px;
}
.mpf-drawer__header h2 { color: inherit; font-size: 20px; margin: 0; }
.mpf-drawer .mpf-drawer__close {
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: inherit;
	cursor: pointer;
	font: 26px/1 system-ui, sans-serif;
	height: 44px;
	padding: 0;
	width: 44px;
}
.mpf-drawer__content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-block: 16px; }
.mpf-drawer__footer { border-top: 1px solid #dfe2d7; padding-block: 12px max(12px, env(safe-area-inset-bottom, 0px)); }
.mpf-drawer .mpf-drawer__done { border-radius: 999px; width: 100%; }
.mpf-drawer .mpf__heading .mpf__heading-title,
.mpf-drawer .mpf__heading:has(.mpf__summary[hidden]) { display: none; }
.mpf-drawer-toggle:focus-visible,
.mpf-drawer__close:focus-visible,
.mpf-drawer__done:focus-visible { outline: 2px solid #626e4b; outline-offset: 2px; }

.mpf__surface { background: transparent; position: relative; }
.mpf__heading {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: space-between;
	margin: 0 0 14px;
	padding: 0 2px;
}
.mpf__heading-title {
	color: inherit;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.2;
	margin: 0;
}
.mpf__summary {
	background: #e7eadf;
	border-radius: var(--mpf-pill-radius);
	color: #53603d;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	padding: 6px 8px;
	white-space: nowrap;
}

/* 2. Cards and accordion controls. Elementor's saved colors/padding remain authoritative. */
.mpf__groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: 100%; }
.mpf__group {
	background: var(--mpf-panel-bg);
	border: 1px solid var(--mpf-border);
	border-radius: var(--mpf-panel-radius);
	box-shadow: var(--mpf-panel-shadow);
	min-width: 0;
	overflow: hidden;
	width: 100%;
}
.mpf__group-toggle,
.mpf__group-title {
	align-items: center;
	background: transparent;
	border: 0;
	color: inherit;
	display: flex;
	font: inherit;
	font-weight: 700;
	justify-content: flex-start;
	margin: 0;
	padding: 15px 16px;
	text-align: left;
	width: 100%;
}
.mpf__group-toggle { cursor: pointer; gap: 9px; }
.mpf__group-toggle:hover { background: rgba(63, 74, 44, .035); }
.mpf__group-toggle:focus-visible { outline: 2px solid var(--mpf-accent); outline-offset: -3px; }
.mpf__selected-count {
	align-items: center;
	background: var(--mpf-accent);
	border-radius: var(--mpf-pill-radius);
	color: #fff;
	display: inline-flex;
	font-size: 11px;
	font-weight: 700;
	height: 21px;
	justify-content: center;
	min-width: 21px;
	padding: 0 6px;
}
.mpf__chevron {
	border-bottom: 2px solid currentColor;
	border-right: 2px solid currentColor;
	height: 8px;
	margin-left: auto;
	transform: rotate(45deg) translateY(-2px);
	transition: transform .2s ease;
	width: 8px;
}
.mpf__group.is-open .mpf__chevron { transform: rotate(225deg) translate(-2px, -2px); }
.mpf__panel { padding: 0 16px 15px; }

/* 3. Options, checkboxes and term counters. */
.mpf__option {
	align-items: center;
	border-radius: 8px;
	cursor: pointer;
	display: grid;
	gap: 9px;
	grid-template-columns: 20px minmax(0, 1fr) auto;
	margin: 2px 0;
	padding: 8px 7px;
	transition: background-color .16s ease;
}
.mpf__option:hover { background: rgba(63, 74, 44, .055); }
.mpf__option input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.mpf__box {
	background: #fff;
	border: 1.5px solid #9ca28f;
	border-radius: 5px;
	box-sizing: border-box;
	height: 19px;
	position: relative;
	transition: .16s ease;
	width: 19px;
}
.mpf__option input:checked + .mpf__box { background: var(--mpf-accent); border-color: var(--mpf-accent); }
.mpf__option input:checked + .mpf__box::after {
	background: var(--mpf-check-color, #fff);
	clip-path: polygon(0 47%, 16% 31%, 38% 56%, 84% 0, 100% 15%, 39% 100%);
	content: "";
	height: 62%;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 68%;
}
.mpf__option input:focus-visible + .mpf__box { outline: 2px solid var(--mpf-accent); outline-offset: 2px; }
.mpf__option-name { min-width: 0; overflow-wrap: anywhere; }
.mpf__term-count {
	background: var(--mpf-muted-bg);
	border-radius: var(--mpf-pill-radius);
	color: var(--mpf-muted-text);
	font-size: 12px;
	line-height: 1;
	padding: 5px 7px;
}

/* 4. Active filters: one canonical rule for each component. */
.mpf__active {
	background: var(--mpf-active-bg, #fffdf8);
	border: 1px solid var(--mpf-border);
	border-radius: 16px;
	box-shadow: 0 4px 16px rgba(40, 51, 31, .04);
	display: block;
	margin-top: 14px;
	padding: 16px;
}
.mpf__active-heading {
	align-items: center;
	border-bottom: 1px solid var(--mpf-border);
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	justify-content: space-between;
	margin-bottom: 14px;
	padding-bottom: 12px;
}
.mpf__active-label { color: var(--mpf-active-label, inherit); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.mpf__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mpf__chip,
.mpf__clear { border-radius: var(--mpf-pill-radius); cursor: pointer; font: inherit; transition: .16s ease; }
.mpf__chip {
	align-items: center;
	background: var(--mpf-muted-bg);
	border: 1px solid var(--mpf-border);
	color: var(--mpf-accent);
	display: inline-flex;
	font-size: 13px;
	font-weight: 600;
	gap: 8px;
	line-height: 1.35;
	max-width: 100%;
	overflow-wrap: anywhere;
	padding: 7px 10px;
	text-align: left;
	white-space: normal;
}
.mpf__chip:hover,
.mpf__chip:focus-visible { background: #e3e7da; filter: none; transform: translateY(-1px); }
.mpf__chip > span[aria-hidden] {
	align-items: center;
	background: rgba(127, 127, 127, .15);
	border-radius: 50%;
	display: inline-flex;
	flex: 0 0 18px;
	font-size: 15px;
	height: 18px;
	justify-content: center;
	line-height: 1;
	width: 18px;
}
.mpf__clear {
	background: transparent;
	border: 0;
	color: var(--mpf-muted-text);
	font-size: 12px;
	margin-left: auto;
	padding: 2px;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.mpf__clear:hover,
.mpf__clear:focus-visible { color: var(--mpf-accent); }

/* 5. Unified layout. The outer surface is transparent, not the inner cards. */
.mpf--unified .mpf__surface {
	border: 1px solid var(--mpf-border);
	border-radius: 18px;
	box-shadow: 0 8px 28px rgba(40, 51, 31, .065);
	overflow: hidden;
}
.mpf--unified .mpf__groups { gap: 0; }
.mpf--unified .mpf__group {
	background: var(--mpf-unified-card-bg, #fff);
	border: 0;
	border-bottom: 1px solid var(--mpf-border);
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
}
.mpf--unified .mpf__group:last-child { border-bottom: 0; }
.mpf--unified .mpf__group-toggle,
.mpf--unified .mpf__group-title { min-height: 58px; padding-left: 17px; padding-right: 17px; }
.mpf--unified .mpf__panel { padding: 2px 17px 15px; }
.mpf--unified .mpf__option { margin: 1px 0; padding-left: 5px; padding-right: 5px; }
.mpf--unified .mpf__active { border-radius: 0; box-shadow: none; margin: 0; }

/* The explicit Elementor full-width switch must override per-widget width/alignment. */
.elementor-widget-mederi-product-filters.mpf-full-width-yes {
	--container-widget-width: 100%;
	width: 100% !important;
	max-width: 100% !important;
	align-self: stretch !important;
}
.mpf-full-width-yes > .elementor-widget-container { width: 100%; max-width: 100%; box-sizing: border-box; }

/* 6. Price slider. Keep its 5px thumb clearance above Elementor's generic panel padding. */
.mpf__price {
	--mpf-price-track: var(--mpf-border);
	--mpf-price-active: var(--mpf-accent);
	--mpf-price-thumb: var(--mpf-accent);
	padding-top: 5px !important;
}
.mpf__price-values { align-items: center; display: flex; font-size: 13px; font-weight: 650; justify-content: space-between; margin-bottom: 15px; }
.mpf__price-value {
	background: #f3f4ef;
	border: 1px solid var(--mpf-border);
	border-radius: 8px;
	color: #3f4a2c;
	min-width: 76px;
	padding: 7px 8px;
	text-align: center;
}
.mpf__price-slider { background: var(--mpf-price-track); border-radius: var(--mpf-pill-radius); height: 5px; margin: 0 9px 7px; position: relative; }
.mpf__price-progress { background: var(--mpf-price-active); border-radius: var(--mpf-pill-radius); inset: 0; position: absolute; }
.mpf__price-input { -webkit-appearance: none; appearance: none; background: transparent; height: 5px; left: 0; margin: 0; pointer-events: none; position: absolute; top: 0; width: 100%; }
.mpf__price-input::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; background: var(--mpf-price-thumb);
	border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 5px rgba(40, 51, 31, .3);
	cursor: grab; height: 20px; pointer-events: auto; width: 20px;
}
.mpf__price-input::-moz-range-thumb {
	background: var(--mpf-price-thumb); border: 3px solid #fff; border-radius: 50%;
	box-shadow: 0 1px 5px rgba(40, 51, 31, .3); cursor: grab; height: 14px; pointer-events: auto; width: 14px;
}
.mpf__price-input:focus-visible::-webkit-slider-thumb,
.mpf__price-input:focus-visible::-moz-range-thumb { outline: 2px solid var(--mpf-accent); outline-offset: 2px; }

/* 7. Results, empty state and load indicators. */
.mpf__results { align-items: center; background: var(--mpf-muted-bg); border-radius: var(--mpf-pill-radius); color: #53603d; display: inline-flex; font-size: 13px; font-weight: 600; margin: 12px 2px 0; padding: 6px 10px; }
.mpf__results:empty { display: none; }
.mpf__error { color: #b42318; }
.mpf__empty { background: var(--mpf-panel-bg); border: 1px solid var(--mpf-border); border-radius: 12px; margin-top: 16px; padding: 18px; }
.mpf-grid-is-empty .elementor-posts-nothing-found,
.mpf-grid-is-empty .e-loop-nothing-found { display: none; }
.mpf-grid-empty-state {
	align-items: center; background: #fcfbf7; border: 1px solid #dfe2d7; border-radius: 18px;
	box-sizing: border-box; color: #28331f; display: flex; flex-direction: column; gap: 14px;
	justify-content: center; min-height: 260px; padding: 40px 24px; text-align: center; width: 100%;
}
.mpf-grid-empty-state h3 { margin: 0; font-size: 24px; line-height: 1.25; }
.mpf-grid-empty-state p { margin: 0; max-width: 440px; line-height: 1.6; }
.mpf-grid-empty-state button { background: var(--e-global-color-primary, #3f4a2c); border: 0; border-radius: 999px; color: #fff; cursor: pointer; font: inherit; padding: 12px 22px; }
.mpf-grid-empty-state button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.mpf.is-loading .mpf__surface::after { animation: mpf-progress 1.05s ease-in-out infinite; background: var(--mpf-accent); border-radius: var(--mpf-pill-radius); content: ""; height: 3px; left: 0; pointer-events: none; position: absolute; top: 0; width: 38%; z-index: 4; }
.mpf-load-more-status { align-items: center; box-sizing: border-box; display: flex; grid-column: 1/-1; justify-content: center; min-height: 64px; padding: 20px; width: 100%; }
.mpf-load-more-spinner { animation: mpf-load-more-spin .8s linear infinite; border: 3px dotted currentColor; border-radius: 50%; display: block; height: 16px; width: 16px; }
/* Only hide the native indicator while this plugin owns the same request. */
.mpf-loading-more .e-load-more-spinner { display: none !important; }
@keyframes mpf-progress { 0% { left: -38%; opacity: .45; } 50% { opacity: 1; } 100% { left: 100%; opacity: .45; } }
@keyframes mpf-load-more-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.mpf-load-more-spinner { animation-duration: 2s; }
	.mpf.is-loading .mpf__surface::after { animation: none; left: 0; width: 100%; }
	.mpf__chip, .mpf__clear, .mpf__option, .mpf__box, .mpf__chevron { transition: none; }
}
