.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;
	}
}

/* =========================================
   VMUSICA - filtros responsive / popup móvil
========================================= */
.vmf-mobile-filter-trigger,
.vmf-mobile-header {
	display: none;
}

.vmf-mobile-dialog,
.vmf-mobile-sheet {
	display: contents;
}

.vmf-mobile-backdrop {
	display: none;
}

@media (max-width: 767px) {
	.vmf-filter-panel {
		padding: 0;
		border: 0;
		background: transparent;
	}

	.vmf-mobile-filter-trigger {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-height: 48px;
		padding: 0.75rem 1rem;
		border: 1px solid #d8d8d8;
		border-radius: 6px;
		background: #fff;
		color: inherit;
		font: inherit;
		font-weight: 700;
		cursor: pointer;
	}

	.vmf-mobile-filter-trigger::before {
		content: "";
		width: 18px;
		height: 18px;
		margin-right: 9px;
		background: linear-gradient(currentColor, currentColor) 2px 3px / 14px 2px no-repeat,
			linear-gradient(currentColor, currentColor) 5px 8px / 11px 2px no-repeat,
			linear-gradient(currentColor, currentColor) 8px 13px / 8px 2px no-repeat;
	}

	.vmf-mobile-dialog {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999999;
		visibility: hidden;
		pointer-events: none;
	}

	.vmf-mobile-dialog.is-open {
		visibility: visible;
		pointer-events: auto;
	}

	.vmf-mobile-backdrop {
		display: block;
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, 0.48);
		opacity: 0;
		transition: opacity 180ms ease;
	}

	.vmf-mobile-dialog.is-open .vmf-mobile-backdrop {
		opacity: 1;
	}

	.vmf-mobile-sheet {
		display: flex;
		flex-direction: column;
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(92vw, 420px);
		max-width: 100%;
		background: #fff;
		transform: translateX(100%);
		transition: transform 220ms ease;
		box-shadow: -10px 0 35px rgba(0, 0, 0, 0.18);
	}

	.vmf-mobile-dialog.is-open .vmf-mobile-sheet {
		transform: translateX(0);
	}

	.vmf-mobile-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex: 0 0 auto;
		padding: 1rem;
		border-bottom: 1px solid #e7e7e7;
		font-size: 1.05rem;
	}

	.vmf-mobile-close {
		display: grid;
		place-items: center;
		width: 38px;
		height: 38px;
		padding: 0;
		border: 0;
		background: transparent;
		color: inherit;
		font-size: 30px;
		font-weight: 300;
		line-height: 1;
		cursor: pointer;
	}

	.vmf-mobile-sheet .vmf-filter-form {
		display: flex;
		flex: 1 1 auto;
		min-height: 0;
		flex-direction: column;
		overflow: hidden;
	}

	.vmf-mobile-sheet .vmf-filter-grid {
		flex: 1 1 auto;
		overflow-y: auto;
		padding: 1rem;
		-webkit-overflow-scrolling: touch;
	}

	.vmf-mobile-sheet .vmf-filter-options {
		max-height: none;
		overflow: visible;
	}

	.vmf-mobile-sheet .vmf-filter-actions {
		position: sticky;
		bottom: 0;
		z-index: 3;
		flex: 0 0 auto;
		margin: 0;
		padding: 0.85rem 1rem max(0.85rem, env(safe-area-inset-bottom));
		border-top: 1px solid #e7e7e7;
		background: #fff;
		box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.06);
	}

	.vmf-mobile-sheet .vmf-apply-button {
		min-height: 48px;
		font-weight: 700;
	}

	body.vmf-mobile-filters-open {
		overflow: hidden;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vmf-mobile-backdrop,
	.vmf-mobile-sheet {
		transition: none;
	}
}

/* =========================================
   VMUSICA - acordeones de filtros
========================================= */
.vmf-accordion-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: inherit;
	text-align: left;
	cursor: default;
}

.vmf-accordion-icon {
	display: none;
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

@media (max-width: 767px) {
	.vmf-mobile-sheet .vmf-filter-group {
		padding: 0;
		border-bottom: 1px solid #e7e7e7;
	}

	.vmf-mobile-sheet .vmf-filter-group + .vmf-filter-group {
		padding-top: 0;
	}

	.vmf-mobile-sheet .vmf-filter-group legend {
		width: 100%;
		margin: 0;
		padding: 0;
	}

	.vmf-mobile-sheet .vmf-accordion-toggle {
		min-height: 54px;
		padding: 0.9rem 0;
		cursor: pointer;
	}

	.vmf-mobile-sheet .vmf-accordion-icon {
		display: block;
	}

	.vmf-mobile-sheet .vmf-accordion-icon::before,
	.vmf-mobile-sheet .vmf-accordion-icon::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 12px;
		height: 2px;
		background: currentColor;
		transform: translate(-50%, -50%);
		transition: transform 160ms ease, opacity 160ms ease;
	}

	.vmf-mobile-sheet .vmf-accordion-icon::after {
		transform: translate(-50%, -50%) rotate(90deg);
	}

	.vmf-mobile-sheet .vmf-accordion-toggle[aria-expanded="true"] .vmf-accordion-icon::after {
		opacity: 0;
		transform: translate(-50%, -50%) rotate(0deg);
	}

	.vmf-mobile-sheet .vmf-accordion-panel {
		padding: 0 0 1rem;
	}

	.vmf-mobile-sheet .vmf-accordion-panel[hidden] {
		display: none !important;
	}

	.vmf-mobile-sheet .vmf-filter-options {
		margin: 0;
	}
}
