/* =========================================================
   Standortkarte
========================================================= */

.standort-map-module {
	position: relative;
	width: 100%;
	height: min(850px, calc(100dvh - 90px));
	min-height: 650px;
	overflow: hidden;
	isolation: isolate;
	background: var(--color-bg-soft-2);
}

.standort-map-background, #standort-map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.standort-map-background {
	z-index: 0;
}

.standort-map-overlay {
	position: relative;
	z-index: 2;
	display: flex;
	width: min(440px, calc(100% - 60px));
	height: calc(100% - 60px);
	margin: 30px;
	flex-direction: column;
	gap: var(--space-md);
	pointer-events: none;
}

/* =========================================================
   Schwebende Überschrift
========================================================= */

.standort-map-header {
	padding: var(--space-lg);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.96);
	box-shadow: var(--shadow-contact);
	pointer-events: auto;
}

.standort-map-header h1 {
	margin: 0 0 var(--space-sm);
	font-size: var(--font-size-xl);
	line-height: 1.15;
	font-weight: 700;
	color: var(--color-primary);
}

.standort-map-header p:last-child {
	margin: 0;
	line-height: 1.5;
	color: var(--color-text-soft);
}

/* =========================================================
   Filter- und Standortpalette
========================================================= */

.standort-map-panel {
	display: flex;
	min-height: 0;
	flex: 1;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.97);
	box-shadow: var(--shadow-contact);
	pointer-events: auto;
}

.standort-map-filter {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-sm);
	padding: var(--space-md);
	border-bottom: 1px solid var(--color-bg-soft);
}

.standort-filter {
	margin: 0;
	padding: 0.7rem 0.5rem;
	border: 1px solid var(--color-accent);
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--color-accent-hover);
	font-family: inherit;
	font-size: var(--font-size-s);
	font-weight: 700;
	cursor: pointer;
	transition: background-color var(--transition-default), color var(--transition-default);
}

.standort-filter:hover {
	background: var(--color-accent-light);
}

.standort-filter.is-active {
	background: var(--color-accent);
	color: var(--color-text-light);
}

.standort-filter:focus-visible, .standort-list-button:focus-visible {
	outline: 3px solid var(--color-primary);
	outline-offset: 2px;
}

/* =========================================================
   Standortliste
========================================================= */

.standort-map-sidebar {
	display: flex;
	min-height: 0;
	flex: 1;
	flex-direction: column;
}

.standort-map-sidebar-title {
	margin: 0;
	padding: var(--space-md) var(--space-md) var(--space-sm);
	font-size: var(--font-size-m);
	font-weight: 700;
	color: var(--color-primary);
}

.standort-list {
	min-height: 0;
	flex: 1;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.standort-list-item {
	border-bottom: 1px solid var(--color-bg-soft);
}

.standort-list-item.is-hidden {
	display: none;
}

.standort-list-button {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0.9rem 1rem 0.9rem 2rem;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--color-text-body);
	font-family: inherit;
	font-size: var(--font-size-base);
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
}

.standort-list-button::before {
	position: absolute;
	top: 50%;
	left: 1rem;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--color-accent);
	content: "";
	transform: translateY(-50%);
}

.standort-list-button:hover, .standort-list-item.is-active .standort-list-button {
	background: var(--color-accent-light);
	color: var(--color-primary);
}

.standort-list-name {
	display: block;
	font-weight: 700;
}

/* =========================================================
   Kartenmarker
========================================================= */

.standort-marker-wrapper {
	display: block;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.standort-marker-wrapper.is-hidden {
	display: none;
}

.standort-marker {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
	border: 3px solid var(--color-text-light);
	border-radius: 50%;
	background: var(--color-accent);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
	pointer-events: none;
}

.standort-marker::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--color-primary);
	content: "";
	transform: translate(-50%, -50%);
}

.standort-marker-wrapper.is-active .standort-marker {
	box-shadow: 0 0 0 4px var(--color-accent-light), 0 3px 8px rgba(0, 0, 0, 0.22);
}

.standort-marker-wrapper:focus-visible {
	outline: 3px solid var(--color-primary);
	outline-offset: 3px;
}

/* =========================================================
   Popup
========================================================= */

.maplibregl-popup {
	max-width: 285px !important;
}

.maplibregl-popup-content {
	min-width: 220px;
	padding: var(--space-md);
	border-radius: var(--radius-md);
	font-family: inherit;
	color: var(--color-text-body);
	box-shadow: var(--shadow-contact);
}

.standort-popup h3 {
	margin: 0 25px var(--space-md) 0;
	font-size: var(--font-size-m);
	font-weight: 700;
	line-height: 1.2;
	color: var(--color-primary);
}

.standort-popup-phone {
	margin: 0 0 var(--space-sm);
}

.standort-popup-phone-label {
	display: block;
	font-size: var(--font-size-s);
	font-weight: 700;
	color: var(--color-text-soft);
}

.standort-popup-phone a, .standort-popup-detail a {
	font-weight: 700;
	color: var(--color-primary);
	text-decoration: none;
}

.standort-popup-phone a:hover, .standort-popup-detail a:hover {
	text-decoration: underline;
}

.standort-popup-detail {
	margin: var(--space-md) 0 0;
	padding-top: var(--space-sm);
	border-top: 1px solid var(--color-bg-soft);
}

.standort-popup-detail a::after {
	margin-left: 0.4rem;
	content: "→";
}

/* =========================================================
   Kartensteuerung
========================================================= */

.maplibregl-ctrl-top-right {
	top: 20px;
	right: 20px;
}

.maplibregl-ctrl-group {
	overflow: hidden;
	border: 0;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-card);
}

.maplibregl-ctrl-group button {
	margin: 0;
}

/* =========================================================
   Tablet
========================================================= */

@media screen and (min-width: 40em) and (max-width: 63.9375em) {
	.standort-map-overlay {
		width: 360px;
		margin: 20px;
		height: calc(100% - 40px);
	}

	.standort-map-header {
		padding: var(--space-md);
	}
}

/* =========================================================
   Smartphone
========================================================= */

@media screen and (max-width: 39.9375em) {
	.standort-map-module {
		display: flex;
		height: auto;
		min-height: 0;
		flex-direction: column;
		overflow: visible;
		background: transparent;
	}

	.standort-map-overlay {
		display: contents;
	}

	.standort-map-header {
		order: 1;
		width: auto;
		margin: var(--space-md);
		padding: 0;
		background: transparent;
		box-shadow: none;
	}

	.standort-map-header h1 {
		font-size: var(--font-size-xl);
	}

	.standort-map-panel {
		display: contents;
	}

	.standort-map-filter {
		order: 2;
		margin: 0 var(--space-md) var(--space-md);
		padding: 0;
		border: 0;
	}

	.standort-map-background {
		position: relative;
		order: 3;
		width: 100%;
		height: 400px;
	}

	#standort-map {
		position: relative;
		width: 100%;
		height: 100%;
	}

	.standort-map-sidebar {
		order: 4;
		margin: var(--space-md);
		overflow: hidden;
		border-radius: var(--radius-md);
		background: var(--color-bg-light);
		box-shadow: var(--shadow-card);
	}

	.standort-list {
		max-height: 300px;
		overflow-y: auto;
	}

	.maplibregl-ctrl-top-right {
		top: 10px;
		right: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.standort-filter, .standort-marker {
		transition: none;
	}
}