/**
 * Movento Advanced Custom Filter — default styles (v1.1)
 * Scope: .mafc-filter
 */

.mafc-filter {
	--azul: #004680;
	--azul-oscuro: #00365F;
	--dark: #212322;
	--grey-1: #464B48;
	--grey-2: #808683;
	--grey-3: #C9CDCB;
	--light: #F1F3F2;
	--naranja: #FF6A14;
	--white: #FFFFFF;
	--radius-lg: 12px;
	--radius-sm: 8px;
	--shadow: 0 6px 18px rgba(33, 35, 34, 0.08);
	--font-heading: "Noto Sans", system-ui, sans-serif;
	--font-body: "Poppins", system-ui, sans-serif;
	--panel-width: 280px;
	--ease: cubic-bezier(0.4, 0, 0.2, 1);
	--dur: 0.22s;
	box-sizing: border-box;
	font-family: var(--font-body);
	color: var(--dark);
	line-height: 1.45;
	width: 100%;
	max-width: 100%;
	position: relative;
	isolation: isolate;
	clear: both;
	display: block;
}

/* Contenedor Elementor: evita que el widget se comprima / solape */
.elementor-widget-movento-advanced-filter,
.elementor-widget-movento-advanced-filter > .elementor-widget-container {
	width: 100%;
	max-width: 100%;
	overflow: visible;
}

.mafc-filter *,
.mafc-filter *::before,
.mafc-filter *::after {
	box-sizing: border-box;
}

/* Respetar atributo hidden (evita que display:flex del loader lo anule) */
.mafc-filter [hidden],
.mafc-filter [hidden].mafc-loading,
.mafc-filter [hidden].mafc-acc-panel,
.mafc-filter [hidden].mafc-empty-keyword,
.mafc-filter [hidden].mafc-drawer-backdrop,
.mafc-filter [hidden].mafc-active-chips,
.mafc-filter [hidden].mafc-suggest-list,
.mafc-filter [hidden].mafc-found-visible {
	display: none !important;
}

/* Wrapper interno: evita solaparse con columnas Elementor */
.mafc-layout-inner {
	display: grid;
	gap: 20px;
	width: 100%;
	align-items: start;
}

.mafc-filter.mafc-layout-sidebar .mafc-layout-inner {
	grid-template-columns: var(--panel-width) minmax(0, 1fr);
}

.mafc-filter.mafc-layout-top .mafc-layout-inner {
	grid-template-columns: 1fr;
}

.mafc-filters-panel,
.mafc-results {
	min-width: 0;
	position: relative;
	z-index: 1;
}

.mafc-results {
	z-index: 0;
}

/* —— Mobile open (oculto en desktop; Elementor puede forzar visible en tablet/móvil) —— */
.mafc-mobile-open {
	display: none !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-bottom: 12px;
	position: relative;
	z-index: 2;
}

/* —— Panel —— */
.mafc-filters-panel {
	background: var(--white);
	border: 1px solid rgba(201, 205, 203, 0.65);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 12px;
	align-self: start;
	max-height: none;
	overflow: visible;
}

.mafc-filter.mafc-layout-sidebar .mafc-filters-panel {
	position: sticky;
	top: 16px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.mafc-filters-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(201, 205, 203, 0.55);
}

.mafc-filters-title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--azul);
}

.mafc-drawer-close {
	display: none;
	border: 0;
	background: transparent;
	color: var(--grey-1);
	font-size: 1.05rem;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.mafc-drawer-close:hover {
	background: var(--light);
	color: var(--dark);
}

.mafc-drawer-backdrop {
	display: none;
}

/* —— Search —— */
.mafc-search-wrap {
	position: relative;
	margin: 0;
}

.mafc-search-icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--grey-2);
	pointer-events: none;
	font-size: 0.8rem;
}

.mafc-search-input {
	width: 100%;
	border: 1px solid var(--grey-3);
	border-radius: var(--radius-sm);
	padding: 8px 10px 8px 32px;
	font: inherit;
	font-size: 0.82rem;
	background: var(--light);
	color: var(--dark);
	transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.mafc-search-input:focus {
	outline: none;
	border-color: var(--azul);
	background: var(--white);
	box-shadow: 0 0 0 2px rgba(0, 70, 128, 0.1);
}

.mafc-field-hint {
	margin: 6px 0 0;
	font-size: 0.72rem;
	color: var(--grey-2);
	line-height: 1.35;
}

/* —— Active chips —— */
.mafc-active-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 8px;
}

.mafc-active-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(0, 70, 128, 0.08);
	color: var(--azul);
	font-size: 0.7rem;
	font-weight: 500;
	animation: mafc-chip-in 0.18s var(--ease);
}

.mafc-active-chip button {
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	opacity: 0.7;
}

.mafc-active-chip button:hover {
	opacity: 1;
}

@keyframes mafc-chip-in {
	from {
		opacity: 0;
		transform: translateY(3px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* —— Accordion —— */
.mafc-filters-body {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.mafc-acc {
	border-bottom: 1px solid rgba(201, 205, 203, 0.55);
}

.mafc-acc:last-child {
	border-bottom: 0;
}

.mafc-acc-trigger {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 2px;
	border: 0;
	background: transparent;
	font-family: var(--font-heading);
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--dark);
	cursor: pointer;
	text-align: left;
}

.mafc-acc-trigger:hover {
	color: var(--azul);
}

.mafc-acc-icon {
	color: var(--grey-2);
	font-size: 0.68rem;
	transition: transform var(--dur) var(--ease);
	flex-shrink: 0;
}

.mafc-acc.is-open .mafc-acc-icon {
	transform: rotate(180deg);
	color: var(--naranja);
}

.mafc-acc-panel {
	display: none;
	padding: 0 2px 10px;
	animation: mafc-panel-in 0.2s var(--ease);
}

.mafc-acc.is-open > .mafc-acc-panel {
	display: block;
}

@keyframes mafc-panel-in {
	from {
		opacity: 0;
		transform: translateY(-3px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* —— Fields —— */
.mafc-field {
	margin-bottom: 10px;
}

.mafc-field:last-child {
	margin-bottom: 0;
}

.mafc-field-label,
.mafc-sublabel {
	display: block;
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--grey-1);
	margin-bottom: 6px;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.mafc-sublabel {
	margin-top: 6px;
	text-transform: none;
}

.mafc-chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.mafc-chip {
	border: 1px solid var(--grey-3);
	background: var(--white);
	color: var(--grey-1);
	border-radius: 999px;
	padding: 4px 9px;
	font: inherit;
	font-size: 0.72rem;
	font-weight: 500;
	cursor: pointer;
	line-height: 1.25;
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.mafc-chip:hover {
	border-color: var(--azul);
	color: var(--azul);
}

.mafc-chip.is-active {
	background: var(--azul);
	border-color: var(--azul);
	color: var(--white);
}

.mafc-text-input,
.mafc-select {
	width: 100%;
	border: 1px solid var(--grey-3);
	border-radius: var(--radius-sm);
	padding: 7px 9px;
	font: inherit;
	font-size: 0.8rem;
	background: var(--white);
	color: var(--dark);
}

.mafc-text-input:focus,
.mafc-select:focus {
	outline: none;
	border-color: var(--azul);
	box-shadow: 0 0 0 2px rgba(0, 70, 128, 0.1);
}

.mafc-autocomplete {
	position: relative;
}

.mafc-suggest-list {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	top: calc(100% + 3px);
	margin: 0;
	padding: 4px;
	list-style: none;
	background: var(--white);
	border: 1px solid var(--grey-3);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	max-height: 180px;
	overflow: auto;
}

.mafc-suggest-list li {
	padding: 6px 8px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.8rem;
}

.mafc-suggest-list li:hover,
.mafc-suggest-list li.is-active {
	background: var(--light);
	color: var(--azul);
}

/* —— Toggle —— */
.mafc-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
}

.mafc-toggle-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.mafc-toggle-track {
	width: 36px;
	height: 20px;
	border-radius: 999px;
	background: var(--grey-3);
	position: relative;
	flex-shrink: 0;
	transition: background var(--dur) var(--ease);
}

.mafc-toggle-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--white);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
	transition: transform var(--dur) var(--ease);
}

.mafc-toggle input:checked + .mafc-toggle-track {
	background: var(--azul);
}

.mafc-toggle input:checked + .mafc-toggle-track .mafc-toggle-thumb {
	transform: translateX(16px);
}

.mafc-toggle-label {
	font-size: 0.8rem;
	font-weight: 500;
}

/* —— Range —— */
.mafc-range-values {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}

.mafc-range-min-num,
.mafc-range-max-num {
	width: 100%;
	border: 1px solid var(--grey-3);
	border-radius: 6px;
	padding: 5px 6px;
	font: inherit;
	font-size: 0.75rem;
	text-align: center;
}

.mafc-range-sep {
	color: var(--grey-2);
	font-size: 0.75rem;
}

.mafc-range-sliders {
	position: relative;
	height: 22px;
}

.mafc-range-sliders input[type="range"] {
	position: absolute;
	left: 0;
	width: 100%;
	top: 6px;
	margin: 0;
	pointer-events: none;
	appearance: none;
	background: transparent;
	height: 3px;
}

.mafc-range-sliders input[type="range"]::-webkit-slider-runnable-track {
	height: 3px;
	background: var(--grey-3);
	border-radius: 999px;
}

.mafc-range-sliders input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--azul);
	border: 2px solid var(--white);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
	margin-top: -5.5px;
	pointer-events: auto;
	cursor: pointer;
}

.mafc-range-sliders input[type="range"]::-moz-range-track {
	height: 3px;
	background: var(--grey-3);
	border-radius: 999px;
}

.mafc-range-sliders input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--azul);
	border: 2px solid var(--white);
	pointer-events: auto;
	cursor: pointer;
}

/* —— Footer panel —— */
.mafc-filters-foot {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(201, 205, 203, 0.55);
}

.mafc-btn-primary,
.mafc-btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border-radius: var(--radius-sm);
	padding: 8px 12px;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.mafc-btn-primary {
	border: 0;
	background: var(--azul);
	color: var(--white);
}

.mafc-btn-primary:hover {
	background: var(--azul-oscuro);
}

.mafc-btn-ghost {
	border: 1px solid var(--grey-3);
	background: transparent;
	color: var(--grey-1);
}

.mafc-btn-ghost:hover {
	border-color: var(--naranja);
	color: var(--naranja);
}

.mafc-apply-mobile {
	display: none;
}

/* —— Results —— */
.mafc-results-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.mafc-results-count {
	font-size: 0.88rem;
	color: var(--grey-1);
}

.mafc-results-count strong {
	color: var(--azul);
	font-family: var(--font-heading);
	font-size: 1.05rem;
}

.mafc-found-visible {
	font-size: 0.78rem;
	color: var(--grey-2);
	margin-left: 4px;
}

.mafc-sort-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.mafc-sort-label {
	font-size: 0.75rem;
	color: var(--grey-2);
	white-space: nowrap;
}

.mafc-sort-select {
	border: 1px solid var(--grey-3);
	border-radius: 6px;
	padding: 6px 8px;
	font: inherit;
	font-size: 0.78rem;
	background: var(--white);
	max-width: 100%;
}

.mafc-sort-field {
	min-width: 140px;
	flex: 1 1 140px;
}

.mafc-sort-dir {
	min-width: 110px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mafc-results-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	transition: opacity var(--dur) var(--ease);
	width: 100%;
}

.mafc-filter.is-loading .mafc-results-grid {
	opacity: 0.4;
	pointer-events: none;
}

.mafc-result-item {
	min-width: 0;
	animation: mafc-item-in 0.28s var(--ease) both;
}

.mafc-result-item.is-keyword-hidden,
.mafc-result-item.is-meta-hidden {
	display: none !important;
}

@keyframes mafc-item-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.mafc-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px;
	color: var(--azul);
	font-size: 0.82rem;
	font-weight: 500;
}

.mafc-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(0, 70, 128, 0.2);
	border-top-color: var(--azul);
	border-radius: 50%;
	animation: mafc-spin 0.65s linear infinite;
}

@keyframes mafc-spin {
	to {
		transform: rotate(360deg);
	}
}

.mafc-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 36px 16px;
	color: var(--grey-2);
	font-size: 0.92rem;
	background: var(--light);
	border-radius: var(--radius-lg);
}

.mafc-empty-keyword {
	margin-top: 12px;
}

/* —— Fallback card —— */
.mafc-fallback-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--white);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow);
	text-decoration: none;
	color: inherit;
	transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.mafc-fallback-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(33, 35, 34, 0.12);
}

.mafc-fallback-media {
	aspect-ratio: 16 / 10;
	background: var(--light);
	overflow: hidden;
}

.mafc-fallback-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mafc-fallback-body {
	padding: 12px 14px 14px;
}

.mafc-fallback-brand {
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--naranja);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mafc-fallback-title {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.9rem;
	margin-top: 3px;
	color: var(--azul);
}

.mafc-fallback-price {
	margin-top: 8px;
	font-weight: 700;
	color: var(--dark);
	font-size: 0.9rem;
}

.mafc-fallback-price small {
	font-weight: 500;
	color: var(--grey-2);
	margin-left: 2px;
}

/* —— Responsive —— */
@media (max-width: 1100px) {
	.mafc-filter.mafc-layout-sidebar .mafc-layout-inner {
		grid-template-columns: 260px minmax(0, 1fr);
	}
}

@media (max-width: 900px) {
	.mafc-filter.mafc-layout-sidebar .mafc-layout-inner {
		grid-template-columns: 1fr;
	}

	.mafc-mobile-open {
		display: inline-flex !important;
	}

	.mafc-filter.mafc-layout-sidebar .mafc-filters-panel,
	.mafc-filters-panel {
		position: fixed;
		z-index: 10050;
		inset: 0 auto 0 0;
		width: min(90vw, 340px);
		max-height: 100vh;
		border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
		transform: translateX(-105%);
		transition: transform 0.28s var(--ease);
		padding-bottom: 20px;
		overflow-y: auto;
	}

	.mafc-filter.is-drawer-open .mafc-filters-panel {
		transform: translateX(0);
	}

	.mafc-drawer-close {
		display: inline-flex;
	}

	.mafc-drawer-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 10040;
		background: rgba(33, 35, 34, 0.42);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.24s var(--ease);
	}

	.mafc-filter.is-drawer-open .mafc-drawer-backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	.mafc-drawer-backdrop[hidden] {
		display: none;
	}

	.mafc-filter.is-drawer-open .mafc-drawer-backdrop[hidden] {
		display: block;
	}

	.mafc-apply-mobile {
		display: inline-flex;
	}

	.mafc-results-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.mafc-results-grid {
		grid-template-columns: 1fr;
	}

	.mafc-results-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
}
