.vmf-filter-panel {
	--vmf-border: #d8d8d8;
	--vmf-muted: #666;
	--vmf-surface: #fff;
	margin: 0;
	padding: 1rem;
	border: 1px solid var(--vmf-border);
	border-radius: 0.5rem;
	background: var(--vmf-surface);
	width: 100%;
}

.vmf-filter-form,
.vmf-filter-form * {
	box-sizing: border-box;
}

.vmf-filter-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
}

.vmf-filter-group {
	min-width: 0;
	margin: 0;
	padding: 0 0 1rem;
	border: 0;
	border-bottom: 1px solid var(--vmf-border);
}

.vmf-filter-group + .vmf-filter-group {
	padding-top: 1rem;
}

.vmf-filter-group:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.vmf-filter-group legend {
	width: 100%;
	margin: 0 0 0.75rem;
	padding: 0;
	font-size: 1rem;
	font-weight: 700;
}

.vmf-filter-options {
	display: grid;
	gap: 0.45rem;
	max-height: 18rem;
	overflow: auto;
	padding: 0.125rem 0.25rem 0.125rem 0;
	scrollbar-width: thin;
}

.vmf-filter-options--categories {
	max-height: none;
	overflow: visible;
	padding-right: 0;
}

.vmf-filter-option {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	min-width: 0;
	margin: 0;
	line-height: 1.35;
	cursor: pointer;
}

.vmf-filter-option input {
	flex: 0 0 auto;
	margin: 0.15rem 0 0;
}

.vmf-filter-option span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.vmf-category-tree {
	display: grid;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vmf-category-children {
	margin-top: 0.25rem;
	padding-left: 1.25rem;
}

.vmf-category-branch[hidden] {
	display: none;
}

.vmf-category-row {
	display: grid;
	grid-template-columns: 1.25rem minmax(0, 1fr);
	align-items: start;
	gap: 0.25rem;
	min-height: 1.75rem;
}

.vmf-category-toggle,
.vmf-category-toggle-spacer {
	width: 1.25rem;
	height: 1.5rem;
}

.vmf-category-toggle {
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.vmf-category-toggle::before {
	content: "";
	position: absolute;
	top: 0.42rem;
	left: 0.34rem;
	width: 0.42rem;
	height: 0.42rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 140ms ease;
}

.vmf-category-toggle[aria-expanded="true"]::before {
	transform: rotate(45deg) translate(-0.08rem, -0.08rem);
}

.vmf-category-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

.vmf-category-option {
	padding-top: 0.08rem;
}

.vmf-price-fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.625rem;
}

.vmf-price-fields label {
	display: grid;
	gap: 0.35rem;
	margin: 0;
	font-size: 0.875rem;
	color: var(--vmf-muted);
}

.vmf-price-fields input {
	width: 100%;
	min-height: 2.5rem;
	padding: 0.5rem 0.625rem;
	border: 1px solid var(--vmf-border);
	border-radius: 0.25rem;
	background: var(--vmf-surface);
	color: inherit;
}

.vmf-price-help {
	margin: 0.5rem 0 0;
	font-size: 0.78rem;
	line-height: 1.35;
	color: var(--vmf-muted);
}

.vmf-filter-actions {
	display: grid;
	gap: 0.625rem;
	margin-top: 1rem;
}

.vmf-filter-actions .button {
	width: 100%;
	margin: 0;
	text-align: center;
}

.vmf-clear-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.vmf-feedback {
	min-height: 1.25em;
	font-size: 0.875rem;
	color: var(--vmf-muted);
}

.vmf-results,
.elementor-widget-wc-archive-products,
[data-vmf-results-target] {
	position: relative;
	scroll-margin-top: 1.5rem;
	transition: opacity 160ms ease;
}

.vmf-results[aria-busy="true"],
.elementor-widget-wc-archive-products[aria-busy="true"],
[data-vmf-results-target][aria-busy="true"] {
	opacity: 0.55;
	pointer-events: none;
}

.vmf-results[aria-busy="true"]::before,
.elementor-widget-wc-archive-products[aria-busy="true"]::before,
[data-vmf-results-target][aria-busy="true"]::before {
	content: "";
	position: absolute;
	z-index: 50;
	top: 0.75rem;
	left: 50%;
	width: 1.75rem;
	height: 1.75rem;
	margin-left: -0.875rem;
	border: 3px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: vmf-spin 700ms linear infinite;
}

.vmf-editor-notice {
	padding: 0.75rem;
	border: 1px dashed #a0a0a0;
	background: #f7f7f7;
	font-size: 0.875rem;
}

@keyframes vmf-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
	.vmf-filter-panel {
		padding: 0.875rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vmf-results,
	.elementor-widget-wc-archive-products,
	[data-vmf-results-target] {
		transition: none;
	}
}
