/* AN Mapa de Ubicaciones — frontend
   Sobrescribe las variables en tu tema para adaptar los colores. */

.an-mapa {
	--an-mapa-borde: #F2C200;
	--an-mapa-fondo: #FFFFFF;
	--an-mapa-fondo-suave: #FDF6E3;
	--an-mapa-texto: #2C2C2A;
	--an-mapa-secundario: #6B6B66;
	--an-mapa-enlace: #C0642B;
	--an-mapa-radio: 4px;
	--an-mapa-gap: 20px;

	box-sizing: border-box;
	width: 100%;
	color: var(--an-mapa-texto);
	font-family: inherit;
}

.an-mapa *,
.an-mapa *::before,
.an-mapa *::after {
	box-sizing: border-box;
}

.an-mapa__titulo {
	margin: 0 0 var(--an-mapa-gap);
	font-size: 1.6rem;
	line-height: 1.2;
}

/* ---------- Layout ---------- */

.an-mapa__wrap {
	display: grid;
	gap: var(--an-mapa-gap);
	grid-template-columns: 1fr;
	align-items: start;
}

.an-mapa--split .an-mapa__wrap {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 900px) {
	.an-mapa--split .an-mapa__wrap {
		grid-template-columns: 1fr;
	}
}

/* ---------- Mapa ---------- */

.an-mapa__mapa {
	width: 100%;
	min-height: 260px;
	border-radius: var(--an-mapa-radio);
	overflow: hidden;
	background: #E8E4DA;
	z-index: 0;
}

.an-mapa__mapa .leaflet-container {
	font-family: inherit;
	background: #E8E4DA;
}

.an-mapa__popup-nombre {
	display: block;
	font-weight: 700;
	margin-bottom: 2px;
}

.an-mapa__popup-dir {
	display: block;
	color: var(--an-mapa-secundario);
	font-size: 0.9em;
}

.an-mapa__popup a {
	display: inline-block;
	margin-top: 6px;
	color: var(--an-mapa-enlace);
}

/* ---------- Listado ---------- */

.an-mapa__lista {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-height: none;
}

.an-mapa--split .an-mapa__lista {
	max-height: 520px;
	overflow-y: auto;
	padding-right: 6px;
}

.an-mapa__item {
	border: 3px solid var(--an-mapa-borde);
	background: var(--an-mapa-fondo);
	border-radius: var(--an-mapa-radio);
	padding: 10px 14px 14px;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	cursor: pointer;
}

.an-mapa__item:hover,
.an-mapa__item.is-activo {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.an-mapa__item-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.an-mapa__item-nombre {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.25;
	font-weight: 700;
}

.an-mapa__item-web {
	flex: 0 0 auto;
	font-size: 0.9rem;
	color: var(--an-mapa-enlace);
	text-decoration: none;
	white-space: nowrap;
}

.an-mapa__item-web:hover {
	text-decoration: underline;
}

.an-mapa__item-body {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.an-mapa__item-foto {
	flex: 0 0 190px;
	max-width: 45%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 2px;
	background: var(--an-mapa-fondo-suave);
}

.an-mapa__item-foto img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	color: transparent;
	font-size: 0;
}

.an-mapa__item-datos {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.an-mapa__linea {
	display: block;
	line-height: 1.45;
	word-break: break-word;
}

.an-mapa__linea a {
	color: inherit;
	text-decoration: none;
}

.an-mapa__linea a:hover {
	text-decoration: underline;
}

.an-mapa__desc {
	margin: 8px 0 0;
	color: var(--an-mapa-secundario);
	font-size: 0.92em;
	line-height: 1.5;
}

.an-mapa__vacio {
	padding: 16px;
	background: var(--an-mapa-fondo-suave);
	border-radius: var(--an-mapa-radio);
	color: var(--an-mapa-secundario);
}

@media (max-width: 560px) {
	.an-mapa__item-body {
		flex-direction: column;
	}

	.an-mapa__item-foto {
		flex: 1 1 auto;
		max-width: 100%;
		width: 100%;
	}
}

/* ---------- Layout compacto / enlaces (v1.1.0) ---------- */

.an-mapa--compacto .an-mapa__wrap {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: start;
}

@media (max-width: 900px) {
	.an-mapa--compacto .an-mapa__wrap {
		grid-template-columns: 1fr;
	}
}

.an-mapa__enlaces {
	display: grid;
	grid-template-columns: repeat(var(--an-mapa-cols, 1), minmax(0, 1fr));
	gap: 4px 32px;
	align-content: start;
}

.an-mapa__enlace-fila {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 18px;
	padding: 14px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.an-mapa__enlace-fila:last-child {
	border-bottom: 0;
}

.an-mapa__enlace-fila:hover,
.an-mapa__enlace-fila.is-activo {
	background-color: rgba(0, 0, 0, 0.03);
}

.an-mapa__enlace-nombre {
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1.3;
	min-width: 0;
	word-break: break-word;
}

.an-mapa__enlace-web {
	flex: 0 0 auto;
	color: var(--an-mapa-enlace);
	text-decoration: none;
	font-size: 0.95rem;
	white-space: nowrap;
}

.an-mapa__enlace-web:hover {
	text-decoration: underline;
}

/* Sin mapa: los enlaces ocupan todo el ancho */
.an-mapa--enlaces .an-mapa__wrap {
	grid-template-columns: 1fr;
}

@media (max-width: 640px) {
	.an-mapa__enlaces {
		grid-template-columns: 1fr;
	}

	.an-mapa__enlace-fila {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
}

/* ---------- Botón "Cómo llegar" (v1.2.0) ---------- */

.an-mapa__ruta {
	display: inline-block;
	margin-top: 10px;
	padding: 6px 16px;
	border: 1px solid var(--an-mapa-enlace);
	border-radius: 40px;
	color: var(--an-mapa-enlace);
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 600;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.an-mapa__ruta:hover {
	background: var(--an-mapa-enlace);
	color: #fff;
}

.an-mapa__popup-ruta {
	display: inline-block;
	margin-top: 6px;
	margin-left: 12px;
}
