/* GAB Facetas v1 — piel base neutra; personalizar con variables --gab-fac-*. */

.gab-fac {
	--gab-fac-acento: currentColor;
	--gab-fac-borde: rgba(0, 0, 0, 0.35);
	display: grid;
	gap: 2rem;
	font-size: 1rem;
}

@media (min-width: 900px) {
	.gab-fac {
		grid-template-columns: 260px 1fr;
		align-items: start;
	}
}

.gab-fac__filtros {
	display: grid;
	gap: 1.2rem;
	position: sticky;
	top: 1rem;
}

.gab-fac__campo label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
}

.gab-fac input[type="search"],
.gab-fac select {
	width: 100%;
	min-height: 48px;
	padding: 0.5rem 0.8rem;
	font: inherit;
	border: 1px solid var(--gab-fac-borde);
	border-radius: 6px;
	background: transparent;
	color: inherit;
}

.gab-fac__cascada {
	display: grid;
	gap: 0.9rem;
}

.gab-fac select:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.gab-fac__grupo {
	border: 1px solid var(--gab-fac-borde);
	border-radius: 6px;
	padding: 0.7rem 1rem 0.9rem;
	margin: 0;
}

.gab-fac__grupo legend {
	font-weight: 700;
	padding: 0 0.4rem;
}

.gab-fac__opcion {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 44px;
	cursor: pointer;
}

.gab-fac__opcion input {
	width: 1.2rem;
	height: 1.2rem;
	accent-color: var(--gab-fac-acento);
	flex: none;
}

.gab-fac__cuenta {
	opacity: 0.65;
	font-size: 0.9em;
	margin-left: auto;
}

.gab-fac__opcion--cero {
	opacity: 0.45;
	cursor: not-allowed;
}

.gab-fac__acciones {
	display: flex;
	gap: 1rem;
	align-items: center;
	margin: 0;
}

.gab-fac__filtrar {
	min-height: 48px;
	padding: 0.6rem 1.4rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	border: 2px solid currentColor;
	border-radius: 6px;
	background: transparent;
	color: inherit;
}

.gab-fac__limpiar {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

/* Mapa: bloque de altura fija para que no haya salto al abrirlo. */
.gab-fac__mapa {
	--gab-fac-mapa-alto: 420px;
	position: relative;
	height: var(--gab-fac-mapa-alto);
	margin: 0 0 1.6rem;
	border: 1px solid var(--gab-fac-borde);
	border-radius: 10px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.03);
}

.gab-fac__mapa-aviso {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	height: 100%;
	padding: 1.5rem;
	text-align: center;
}

.gab-fac__mapa-texto {
	max-width: 34rem;
	margin: 0;
	font-size: 0.94em;
	opacity: 0.8;
}

.gab-fac__mapa-boton {
	min-height: 48px;
	padding: 0.6rem 1.5rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	border: 2px solid currentColor;
	border-radius: 6px;
	background: transparent;
	color: inherit;
}

.gab-fac__mapa-lienzo {
	height: 100%;
}

/* Marcador propio: sin imágenes, solo CSS (evita cargar los PNG de Leaflet). */
.gab-fac__pin {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--gab-fac-acento, currentColor);
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.gab-fac__pin-titulo {
	font-weight: 700;
}

.gab-fac__pin-dato {
	opacity: 0.75;
}

.gab-fac__resumen {
	margin: 0 0 1rem;
	font-weight: 600;
}

.gab-fac__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 1.4rem;
}

.gab-fac__item-enlace {
	display: grid;
	gap: 0.5rem;
	text-decoration: none;
	color: inherit;
}

.gab-fac__item-imagen {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.gab-fac__item-titulo {
	font-weight: 700;
}

.gab-fac__item-enlace:hover .gab-fac__item-titulo {
	text-decoration: underline;
}

.gab-fac__item-datos {
	font-size: 0.9em;
	opacity: 0.75;
}

.gab-fac__vacio {
	padding: 2rem 0;
}

.gab-fac__paginacion ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0;
	margin: 1.6rem 0 0;
}

.gab-fac__paginacion a,
.gab-fac__paginacion span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.6rem;
	border: 1px solid var(--gab-fac-borde);
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
}

.gab-fac__paginacion .current {
	font-weight: 700;
	border-width: 2px;
}

.gab-fac--cargando #gab-fac-resultados {
	opacity: 0.5;
	transition: opacity 160ms ease;
}

.gab-fac a:focus-visible,
.gab-fac button:focus-visible,
.gab-fac input:focus-visible,
.gab-fac select:focus-visible {
	outline: 3px solid var(--gab-fac-acento);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.gab-fac * {
		transition: none !important;
	}
}
