/* ---------- Escritorio: lista vertical ---------- */
.mamf.is-loading .mamf-cuerpo { opacity: 0.6; pointer-events: none; }
.mamf-cuerpo { display: flex; flex-direction: column; gap: 20px; }

.mamf-abrir, .mamf-cabecera, .mamf-pie, .mamf-cuenta { display: none; }

.mamf-titulo {
	margin: 0 0 8px;
	font-size: 1em;
	font-weight: 700;
	padding-bottom: 6px;
	border-bottom: 1px solid #e5e5e5;
}

.mamf-opciones {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 245px;      /* ~9 opciones y media: la última asoma cortada */
	overflow-y: auto;
	padding-right: 8px;
	scrollbar-width: thin;                 /* Firefox */
	scrollbar-color: #1339FE #DAE0FF;
}
/* Barra de scroll siempre visible (Chrome/Edge/Safari escritorio y Android) */
.mamf-opciones::-webkit-scrollbar { width: 5px; -webkit-appearance: none; }
.mamf-opciones::-webkit-scrollbar-track { background: #DAE0FF; border-radius: 5px; }
.mamf-opciones::-webkit-scrollbar-thumb { background: #1339FE; border-radius: 5px; }

/* Degradado abajo mientras quedan opciones por ver */
.mamf-opciones.tiene-mas:not(.al-final) {
	-webkit-mask-image: linear-gradient(to bottom, #000 70%, rgba(0, 0, 0, 0.25));
	mask-image: linear-gradient(to bottom, #000 70%, rgba(0, 0, 0, 0.25));
}
.mamf-opciones li { margin: 0 0 6px; }
.mamf-opciones label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.95em;
	line-height: 1.3;
}
.mamf-opciones input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.mamf-num { opacity: 0.55; font-size: 0.9em; }

.mamf-limpiar {
	align-self: flex-start;
	background: none;
	border: 0;
	padding: 0;
	text-decoration: underline;
	cursor: pointer;
	color: inherit;
	font-size: 0.9em;
}

.mamf-cargando { opacity: 0.4; pointer-events: none; transition: opacity 0.15s; }

/* ---------- Móvil: botón "Filtrar" + panel lateral ---------- */
@media (max-width: 767px) {
	.mamf-abrir {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		padding: 12px 16px;
		border: 1px solid #ccc;
		border-radius: 6px;
		background: #fff;
		color: inherit;
		font-weight: 600;
		font-size: 1em;
		cursor: pointer;
	}
	.mamf.mamf-externo .mamf-abrir { display: none; }  /* usa tu botón de la plantilla */

	.mamf-panel {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		width: min(88vw, 380px);
		background: #fff;
		z-index: 100000;
		display: flex;
		flex-direction: column;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
	}
	.mamf.is-open .mamf-panel { transform: none; box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15); }
	.mamf.is-open::before {
		content: '';
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		z-index: 99999;
	}

	.mamf-panel,
	.mamf-panel button,
	.mamf-panel label,
	.mamf-panel h4 { font-family: 'Rajdhani', sans-serif; }

	.mamf-cabecera {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 14px 16px;
		background: #DAE0FF;
		border-bottom: 1px solid #c5cdf5;
		font-weight: 700;
		font-size: 1.1em;
	}
	.mamf-cerrar {
		background: none;
		border: 0;
		font-size: 28px;
		line-height: 1;
		padding: 0 4px;
		cursor: pointer;
		color: inherit;
	}

	.mamf-cuerpo { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px 16px; gap: 0; }
	.mamf-limpiar { margin: 8px 0; }

	/* Acordeón: títulos plegables */
	.mamf-grupo { border-bottom: 1px solid #e5e5e5; }
	.mamf-titulo {
		display: flex;
		align-items: center;
		gap: 10px;
		margin: 0;
		padding: 14px 2px;
		border-bottom: 0;
		cursor: pointer;
		user-select: none;
		-webkit-tap-highlight-color: transparent;
	}
	.mamf-titulo-txt { flex: 1; }
	.mamf-titulo::after {
		content: '';
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
		margin-top: -4px;
		transition: transform 0.2s;
	}
	.mamf-grupo.is-open .mamf-titulo::after { transform: rotate(-135deg); margin-top: 4px; }
	.mamf-grupo:not(.is-open) .mamf-opciones { display: none; }
	.mamf-grupo.is-open .mamf-opciones { margin-bottom: 12px; }
	.mamf-cuenta {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		height: 20px;
		padding: 0 6px;
		border-radius: 10px;
		background: #1339FE;
		color: #fff;
		font-size: 12px;
		font-weight: 700;
		line-height: 1;
	}
	.mamf-opciones {
		max-height: 202px;              /* 5 opciones y media: la 6ª asoma cortada */
		overflow-y: auto;
		overscroll-behavior: contain;   /* al llegar al final no arrastra el panel */
		-webkit-overflow-scrolling: touch;
		padding-right: 6px;
	}
	.mamf-opciones li { margin: 0; }
	.mamf-opciones label { padding: 8px 0; font-size: 1em; }  /* más fácil de tocar con el dedo */
	.mamf-opciones input[type=checkbox] { width: 20px; height: 20px; }

	.mamf-pie { display: block; padding: 12px 16px; border-top: 1px solid #eee; }
	.mamf-ver {
		width: 100%;
		padding: 14px;
		background: #111;
		color: #fff;
		border: 0;
		border-radius: 6px;
		font-weight: 600;
		font-size: 1em;
		cursor: pointer;
	}
}

html.mamf-bloqueo, html.mamf-bloqueo body { overflow: hidden; }

/* Número de filtros activos */
.mamf-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	border-radius: 11px;
	background: #111;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}
.mamf-boton { cursor: pointer; }
.mamf-boton .mamf-badge { background: #1339FE; margin-left: 10px; }
.mamf-boton .elementor-icon-list-item { align-items: center; }
