/* overwrite */
.mapboxgl-map {
	font-family: inherit;
}

.tourmap {
	--tm-ink-soft:    rgba(0, 0, 0, .6);
	--tm-line:        rgba(255, 255, 255, .2);
	--tm-shadow:      0 2px 8px rgba(9, 40, 54, .28);

	--tm-bar:         56px;
	--tm-radius:      2px;

	position: relative;
	height: clamp(460px, 75vh, 820px);
	/*overflow: hidden;*/
	background: #e8f1f4;
	font-family: inherit;
	color: var(--Colors-Gradient-Step-3);
	isolation: isolate;
	
	display: flex;
	flex-direction: column;
}

.tourmap--compact { height: 480px; }

.tourmap--full {
	height: 100vh;
	height: 100dvh;
}

.tourmap__sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.tm-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* --------------------------------------------------------------- Karte -- */

.tourmap__canvas {
	position: absolute;
	inset: 0;
	z-index: 500;
}

.tourmap__canvas .mapboxgl-map {
	font: inherit;
}

.tourmap__canvas .mapboxgl-ctrl-group {
	border-radius: 0;
	box-shadow: var(--tm-shadow);
}

.tourmap__canvas .mapboxgl-ctrl-group button {
	width: 34px;
	height: 34px;
	border-radius: 0;
}

.tourmap__canvas .mapboxgl-ctrl-attrib {
	background: rgba(255, 255, 255, .78);
	font-size: 10px;
}

.tourmap__canvas .mapboxgl-scroll-zoom-blocker,
.tourmap__canvas .mapboxgl-touch-pan-blocker {
	font: inherit;
	font-size: 15px;
	background: rgba(18, 57, 75, .68);
}

/* Fallback, wenn WebGL fehlt */
.tourmap__fallback {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 400;
	margin: 0;
	place-content: center;
	padding: 24px;
	background: #e8f1f4;
	color: var(--tm-ink-soft);
	text-align: center;
}

.tourmap__fallback.active {
	display: grid;
}

.tourmap--unsupported .tourmap__fallback { display: grid; }
.tourmap--unsupported .tourmap__filters,
.tourmap--unsupported .tourmap__search { display: none; }

/* ---------------------------------------------------------------- Pins -- */

.tm-marker {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.tm-pin {
	position: relative;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--Colors-Gradient-Step-1);
	color: var(--Colors-White);
	box-shadow: var(--tm-shadow);
	transition: background-color .15s ease, transform .15s ease;
}

.tm-pin::after {
	content: "";
	position: absolute;
	top: 31px;
	left: 50%;
	transform: translateX(-50%);
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 10px solid var(--Colors-Gradient-Step-1);
	transition: border-top-color .15s ease;
}

.tm-pin__count {
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .01em;
}

.tm-pin__icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
	stroke: currentColor;
}

.tm-marker:hover .tm-pin, .tm-marker:focus-visible .tm-pin, .tm-marker.is-selected .tm-pin {
	background: var(--Colors-Blue-Surface);
	transform: scale(1.08);
}

.tm-marker:hover .tm-pin::after, .tm-marker:focus-visible .tm-pin::after, .tm-marker.is-selected .tm-pin::after {
	border-top-color: var(--Colors-Blue-Surface);
}

.tm-marker:focus-visible {
	outline: 3px solid var(--Colors-White);
	outline-offset: 2px;
	border-radius: 50%;
}

.tm-pin--wide {
	width: auto;
	min-width: 36px;
	padding: 0 9px;
	border-radius: 999px;
}

/* ------------------------------------------------- Suche + Ortsauswahl -- */

.tourmap__search {
	left: 0;
	right: 0;
	max-width: none;
	flex-wrap: wrap;
	z-index: 501;
	display: flex;
	/*max-width: min(100%, 680px);*/
	background: var(--Colors-Blue-Surface);
	box-shadow: var(--tm-shadow);
	
	position: sticky;
	justify-content: end;
	margin-left: auto;
	width: 75%;
}

@media(min-width: 768px) {
	.tourmap__search {
		top: 0;
		right: 0;
		flex-wrap: nowrap;
	}
}

@media(min-width: 992px) {
	.tourmap__search {
		width: 50%;
	}
}

.tm-search {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
	padding: 0 10px;
	height: var(--tm-bar);
	
	width: calc(100% / 3 * 2);
}

.tm-search__icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	color: var(--Colors-White);
	position: absolute;
	left: 18px;
}

@media(min-width: 992px) {
	.tm-search__icon {
		left: 32px;
	}
}

.tm-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 15px;
	color: var(--Colors-White);
	padding: 0 18px 0 40px;
	height: calc(100% - 20px);
}

@media(min-width: 992px) {
	.tm-search__input {
		padding: 0 18px 0 55px;
	}
}

.tm-search__input::placeholder { color: var(--Colors-White); }
.tm-search__input:focus { outline: 0; }
.tm-search__input:focus-visible { outline: 2px solid var(--Colors-White); outline-offset: 8px; }
.tm-search__input::-webkit-search-cancel-button { cursor: pointer; }

.tm-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-left: 10px;
	background:
			linear-gradient(45deg, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 43%,#fff 45%,#fff 55%,rgba(0,0,0,0) 57%,rgba(0,0,0,0) 100%),
			linear-gradient(135deg, transparent 0%,transparent 43%,#fff 45%,#fff 55%,transparent 57%,transparent 100%);
}

.tm-places {
	position: relative;
	min-width: 240px;

	flex: 1 1 100%;
	border-left: 0;
	border-top: 1px solid var(--tm-line);
}

@media(min-width: 768px) {
	.tm-places {
		border-left: 1px solid var(--tm-line);
		border-top: none;
		flex: 1 1 auto;
	}
}

.tm-places__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 14px;
	height: var(--tm-bar);
	padding: 0 18px;
	border: 0;
	background: none;
	font: inherit;
	font-size: 15px;
	color: var(--Colors-White);
	cursor: pointer;
	white-space: nowrap;
}

.tm-places__chevron {
	transition: transform .18s ease;
}

.tm-places__toggle[aria-expanded="true"] .tm-places__chevron { transform: rotate(180deg); }

.tm-places__list {
	position: absolute;
	top: 100%;
	right: 0;
	width: 100%;
	max-height: 325px;
	overflow-y: auto;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--Colors-White);
	box-shadow: var(--tm-shadow);
	overscroll-behavior-y: contain;
}

@media(min-width: 992px) {
	.tm-places__list {
		/*max-width: 240px;*/
	}
}

.tm-places__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 9px 18px;
	border: 0;
	background: none;
	font: inherit;
	font-size: 14px;
	color: var(--Colors-Gradient-Step-3);
	text-align: left;
	cursor: pointer;
}

.tm-places__item:hover, .tm-places__item:focus-visible {
	background: rgba(45, 127, 150, .1);
	outline: 0;
}

.tm-places__name {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tm-places__aliases {
	font-size: 12px;
	line-height: 1.3;
	color: var(--tm-ink-soft);
}

.tm-places__count {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 600;
}

.tm-places__empty {
	padding: 12px 18px;
	font-size: 14px;
	color: var(--tm-ink-soft);
}

/* ------------------------------------------------------- Typ-Filter ---- */

.tourmap__filters {
	position: absolute;
	left: 0;
	bottom: 0;

	z-index: 501;
	display: flex;
	gap: 10px;
	max-width: calc(100% - 16px);
	padding: 10px;

	margin-top: auto;
	align-self: flex-start;
}

@media(min-width: 768px) {
	.tourmap__filters {
		position: sticky;
	}
}

.tm-filter {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 15px;
	width: 130px;
	min-width: 130px;
	min-height: 104px;
	padding: 15px 10px 20px;
	border: 0;
	background: var(--Colors-Blue-Surface);
	color: var(--Colors-White);
	font: inherit;
	font-size: 12px;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	/*box-shadow: var(--tm-shadow);*/
	transition: background-color .15s ease, opacity .15s ease;
}

.tm-filter__icon {
	width: 32px;
	height: 32px;
	fill: currentColor;
	stroke: currentColor;
	stroke-width: .6;
}

.tm-filter[aria-pressed="false"] {
	background: var(--Colors-Blue-Surface-muted);
	opacity: .7;
}

@media (hover: hover) {
	.tm-filter:hover {
		background: var(--Colors-Blue-Surface-hover);
	}

	.tm-filter[aria-pressed="false"]:hover {
		background: var(--Colors-Blue-Surface-muted);
		opacity: 1;
	}
}

.tm-filter:focus-visible {
	outline: 3px solid var(--Colors-Gradient-Step-3);
	outline-offset: -3px;
}

/* ------------------------------------------------------ Info-Overlay --- */

.tm-popup { 
	max-width: none !important;
}

.tm-popup .mapboxgl-popup-content {
	padding: 0;
	background: none;
	border-radius: 0;
	box-shadow: none;
}

.tm-popup .mapboxgl-popup-tip { display: none; }

.tm-info {
	position: relative;
	width: 90%;
	max-width: 535px;
	padding: 24px;
	background: var(--Colors-Gradient-Step-3);
	color: #fff;
	box-shadow: 0 10px 34px rgba(9, 32, 45, .34);
	text-align: left;
	margin: 0 auto;
	max-height: 325px;
	overflow: hidden;
	overflow-y: auto;
	overscroll-behavior-y: contain;
}

@media(min-width: 768px) {
	.tm-info {
		max-height: unset;
		padding: 32px;
	}
}

.tm-info[hidden] { display: none; }

.tm-info__title {
	margin-bottom: 12px;
	padding-right: 32px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.5;
	color: #fff;
}

.tm-info__title a {
	color: inherit;
	text-decoration: none;
}

/* Vollflächiger Klickbereich – der Link bleibt semantisch am Titel, aber die
   ganze Box reagiert. Der Schließen-Button liegt darüber. */
.tm-info__title a::after {
	/*content: "";*/
	/*position: absolute;*/
	/*inset: 0;*/
	/*z-index: 1;*/
}

/*.tm-info__title a:hover, .tm-info__title a:focus-visible { text-decoration: underline; }*/

.tm-info__text {
	margin-bottom: 10px;
	font-size: var(--font-size-small);
	line-height: 1.55;
}

.tm-info__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--font-size-small);
	color: rgba(255, 255, 255, .8);
}

.tm-info__actions {
	display: flex;
	justify-content: flex-end;
}

.tm-info__meta + .tm-info__actions {
	margin-top: 16px;
}

.tm-info__fact {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tm-info__fact[hidden] { display: none; }

.tm-info__icon {
	flex: 0 0 auto;
	width: 21px;
	height: 21px;
	color: #6fb2c6;
}

/* Der Preis steht rechts und ohne Icon – wie im Entwurf. */
.tm-info__fact--price {
	margin-left: auto;
	font-size: var(--font-size-small);
	font-weight: 700;
	margin-bottom: 15px;
	color: #fff;
}

.tm-info__close {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 0;
	background: none;
	color: rgba(255, 255, 255, .6);
	cursor: pointer;
	transition: all .3s;
}

.tm-info__close svg { width: 17px; height: 17px; }
.tm-info__close:hover { color: #fff; }

.tm-info__close:focus-visible {
	outline: 2px solid #6fb2c6;
	outline-offset: 2px;
}

/* ---------------------------------------------------------- Responsive - */

@media (max-width: 900px) {
	.tourmap { height: 700px; }

	.tm-places__toggle { width: 100%; justify-content: space-between; }
	.tm-places__list { width: 100%; }

	.tourmap__filters {
		max-width: 100%;
		width: 100%;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.tourmap__filters::-webkit-scrollbar { display: none; }

	/* Auf schmalen Schirmen rutscht der Preis in eine eigene Zeile,
	   sonst bricht die Meta-Zeile unschön mitten im Betrag. */
	.tm-info__fact--price {
		margin-left: 0;
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tm-pin,
	.tm-places__chevron,
	.tm-filter { transition: none; }
}


/* ==== Consent-Platzhalter (CCM19) ==== */

.tm-consent {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 2;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem;
	text-align: center;
	background: #eef5f8;
	border-radius: inherit;
}

.tourmap--blocked .tm-consent {
	display: flex;
}

.tourmap--blocked .tourmap__canvas,
.tourmap--blocked .tourmap__search,
.tourmap--blocked .tourmap__filters,
.tourmap--blocked .tourmap__fallback {
	visibility: hidden;
}

.tm-consent__icon {
	color: var(--Colors-Gradient-Step-1);
}

.tm-consent__text {
	max-width: 42ch;
	margin: 0;
}