/* ── Marktdaten Übersicht - Design Tokens ──────────── */
.md-overview {
	--md-navy: #0B1129;
	--md-accent: #0080C6;
	--md-accent-light: #339ADE;
	--md-accent-tint: rgba(0, 128, 198, 0.1);
	--md-navy-2: #273059;
	--md-text-muted: #5A5B6A;
	--md-surface: #F5F8FC;
	--md-pos: #22C55E;
	--md-neg: #EF4444;
	--md-white: #FFFFFF;
	--md-border: #E2E8F0;
	--md-radius: 12px;
	--md-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
	--md-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
	--md-ease-snap: cubic-bezier(0.2, 0, 0, 1);

	max-width: 1264px;
	margin: 0 auto;
	padding: 0 32px;
	color: var(--md-navy);
	font-family: "Nunito Sans", sans-serif;
	font-optical-sizing: auto;
}

/* ── Dark Mode Token Overrides ─────────────────────── */
.md-overview--dark {
	--md-navy: #EBECF2;
	--md-text-muted: rgba(235, 236, 242, 0.6);
	--md-white: rgba(255, 255, 255, 0.06);
	--md-border: rgba(255, 255, 255, 0.12);
	--md-surface: rgba(255, 255, 255, 0.04);
	--md-card-shadow: none;
	--md-accent: #5BA8D9;
	--md-accent-light: #82C0E8;

	color: #EBECF2;
}

.md-overview--dark .md-kpi__value {
	color: #FFFFFF;
}

.md-overview--dark .md-ov-summary strong {
	color: #FFFFFF;
}

.md-overview--dark .md-ov-extreme__value {
	color: #FFFFFF;
}

.md-overview--dark .md-ov-extreme__detail {
	color: var(--md-accent);
}

.md-overview--dark .md-disclaimer p:first-child {
	color: rgba(235, 236, 242, 0.8);
}

.md-overview--dark .md-disclaimer__text {
	color: rgba(235, 236, 242, 0.45);
}

/* ── Region KPIs ───────────────────────────────────── */
.md-ov-kpis {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 20px;
}

.md-overview .md-kpi {
	background: var(--md-white);
	border: 1px solid var(--md-border);
	border-radius: var(--md-radius);
	box-shadow: var(--md-card-shadow);
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.md-overview .md-kpi__label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--md-text-muted);
	order: -1;
}

.md-overview .md-kpi__value {
	display: block;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 32px;
	font-weight: 700;
	color: var(--md-navy);
	line-height: 1.1;
}

.md-overview .md-kpi__context {
	display: block;
	font-size: 13px;
}

/* ── Extremes ──────────────────────────────────────── */
.md-ov-extremes {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 32px;
}

.md-ov-extreme {
	background: var(--md-surface);
	border-radius: var(--md-radius);
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.md-ov-extreme__label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--md-text-muted);
}

.md-ov-extreme__value {
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--md-navy);
}

.md-ov-extreme__detail {
	font-size: 13px;
	color: var(--md-accent);
	font-weight: 600;
}

/* ── Karte+Liste Fragment ──────────────────────────── */
.md-ov-karte-liste {
	margin-bottom: 20px;
}

/* ── Map ───────────────────────────────────────────── */
.md-overview .md-map {
	width: 100%;
	height: 460px;
	border-radius: 8px;
	background: var(--md-surface);
	overflow: hidden;
	position: relative;
	z-index: 1;
	margin-bottom: 24px;
}

/* ── Fließtext (Summary) ───────────────────────────── */
.md-ov-summary {
	font-size: 16px;
	line-height: 1.7;
	color: var(--md-text-muted);
	margin: 0 0 24px;
}

.md-ov-summary strong {
	color: var(--md-navy);
}

/* ── Overview Table ────────────────────────────────── */
.md-overview .md-table-wrap {
	overflow-x: auto;
}

.md-overview-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.md-overview-table thead th {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--md-text-muted);
	text-align: left;
	padding: 12px 20px;
	border-bottom: 2px solid var(--md-border);
	white-space: nowrap;
}

.md-overview-table td {
	padding: 12px 20px;
	border-bottom: 1px solid var(--md-border);
	color: var(--md-navy);
}

.md-overview-table tbody tr:last-child td {
	border-bottom: none;
}

.md-overview-table tbody tr:hover {
	background: var(--md-surface);
}

.md-ov-table__thin {
	opacity: 0.6;
}

.md-ov-thin-hint {
	color: var(--md-text-muted);
	font-size: 11px;
	font-style: normal;
}

.md-ov-table-link {
	font-size: 13px;
	font-weight: 700;
	color: var(--md-accent);
	text-decoration: none;
	white-space: nowrap;
}

.md-ov-table-link:hover {
	text-decoration: underline;
}

/* ── Search/Sort Bar (JS-enhanced) ─────────────────── */
.md-ov-toolbar {
	display: flex;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
	align-items: center;
}

.md-ov-search {
	flex: 1;
	min-width: 200px;
	padding: 8px 14px;
	border: 1.5px solid var(--md-border);
	border-radius: 100px;
	font-family: "Nunito Sans", sans-serif;
	font-size: 14px;
	color: var(--md-navy);
	background: var(--md-white);
	transition: border-color 0.2s var(--md-ease);
}

.md-ov-search:focus {
	outline: none;
	border-color: var(--md-accent);
}

.md-ov-sort {
	padding: 8px 16px;
	border: 1.5px solid var(--md-border);
	border-radius: 100px;
	font-family: "Nunito Sans", sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: var(--md-navy);
	background: var(--md-white);
	cursor: pointer;
}

/* ── Standort Loop Grid ────────────────────────────── */
.md-ov-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
}

.md-ov-card {
	background: var(--md-white);
	border: 1px solid var(--md-border);
	border-radius: var(--md-radius);
	box-shadow: var(--md-card-shadow);
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: box-shadow 0.2s var(--md-ease), transform 0.1s var(--md-ease-snap);
}

.md-ov-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.md-ov-card:active {
	transform: scale(0.98);
}

.md-ov-card--thin {
	opacity: 0.75;
}

.md-ov-card__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
}

.md-ov-card__title {
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 20px;
	font-weight: 700;
	color: var(--md-navy);
	margin: 0;
}

.md-ov-card__lkr {
	font-size: 12px;
	font-weight: 600;
	color: var(--md-text-muted);
	background: var(--md-surface);
	padding: 2px 10px;
	border-radius: 100px;
	white-space: nowrap;
}

/* Card KPIs */
.md-ov-card__kpis {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.md-ov-card__kpi {
	display: flex;
	flex-direction: column;
}

.md-ov-card__kpi-val {
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--md-navy);
}

.md-ov-card__kpi-lbl {
	font-size: 11px;
	color: var(--md-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.md-ov-card__text {
	font-size: 14px;
	color: var(--md-text-muted);
	line-height: 1.5;
	margin: 0;
}

.md-ov-card__thin-note {
	font-size: 12px;
	color: var(--md-text-muted);
	font-style: italic;
	margin: 0;
}

.md-ov-card__link {
	display: inline-block;
	font-size: 14px;
	font-weight: 700;
	color: var(--md-accent);
	text-decoration: none;
	margin-top: auto;
}

.md-ov-card__link:hover {
	text-decoration: underline;
}

/* ── Ampel Badges ─────────────────────────────────── */
.md-ov-card__ampel {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 100px;
}

.md-ov-card__ampel--gruen {
	background: rgba(34, 197, 94, 0.1);
	color: var(--md-pos);
}

.md-ov-card__ampel--gelb {
	background: rgba(245, 158, 11, 0.1);
	color: #D97706;
}

.md-ov-card__ampel--rot {
	background: rgba(239, 68, 68, 0.1);
	color: var(--md-neg);
}

.md-ampel-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	display: inline-block;
}

.md-ampel-dot--gruen { background: var(--md-pos); }
.md-ampel-dot--gelb { background: #F59E0B; }
.md-ampel-dot--rot { background: var(--md-neg); }

/* ── Delta (shared) ────────────────────────────────── */
.md-overview .md-delta {
	display: inline-block;
	font-weight: 700;
	font-size: 13px;
	white-space: nowrap;
}

.md-overview .md-delta--pos { color: var(--md-pos); }
.md-overview .md-delta--neg { color: var(--md-neg); }

/* ── Disclaimer ────────────────────────────────────── */
.md-overview .md-disclaimer {
	padding-top: 20px;
}

.md-overview .md-disclaimer p:first-child {
	font-size: 14px;
	font-weight: 600;
	color: var(--md-navy);
	margin: 0 0 8px;
}

.md-overview .md-disclaimer__text {
	font-size: 12px;
	color: var(--md-text-muted);
	line-height: 1.6;
	margin: 0;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
	.md-ov-kpis {
		grid-template-columns: repeat(2, 1fr);
	}

	.md-ov-extremes {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.md-overview {
		padding: 0 16px;
	}

	.md-ov-kpis {
		grid-template-columns: 1fr 1fr;
	}

	.md-overview .md-kpi__value {
		font-size: 26px;
	}

	.md-overview .md-map {
		height: 300px;
	}

	.md-ov-grid {
		grid-template-columns: 1fr;
	}

}

@media (max-width: 480px) {
	.md-ov-kpis {
		grid-template-columns: 1fr;
	}
}

/* ── Leaflet Popup ─────────────────────────────────── */
.md-overview .md-popup {
	font-family: "Nunito Sans", sans-serif;
	font-size: 13px;
	line-height: 1.5;
}

.md-overview .md-popup strong {
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 15px;
	color: #0B1129;
}

.md-overview .md-popup__price {
	color: #0080C6;
	font-weight: 700;
}

/* ── Stadtteil-Finder (CTA Card) ──────────────────── */
.md-finder-card {
	position: relative;
	background: linear-gradient(135deg, #0B1129 0%, #1a2248 50%, #273059 100%);
	border-radius: 28px;
	padding: clamp(44px, 6vw, 72px) clamp(28px, 5vw, 64px);
	overflow: hidden;
	font-family: "Nunito Sans", sans-serif;
}

/* Accent glows */
.md-finder-card::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -15%;
	width: 520px;
	height: 520px;
	background: radial-gradient(circle, rgba(0, 128, 198, 0.2) 0%, transparent 65%);
	border-radius: 50%;
	pointer-events: none;
}

.md-finder-card::after {
	content: '';
	position: absolute;
	bottom: -35%;
	left: -8%;
	width: 380px;
	height: 380px;
	background: radial-gradient(circle, rgba(51, 154, 222, 0.12) 0%, transparent 65%);
	border-radius: 50%;
	pointer-events: none;
}

.md-finder {
	position: relative;
	z-index: 1;
	text-align: center;
	max-width: 720px;
	margin: 0 auto;
}

/* Eyebrow pill */
.md-finder__eyebrow {
	display: inline-block;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-size: 0.8125rem;
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	padding: 6px 18px;
	border-radius: 100px;
	margin-bottom: 1.25rem;
}

/* Headline */
.md-finder__headline {
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: clamp(28px, 4vw, 42px);
	font-weight: 800;
	color: #fff;
	margin: 0 0 10px;
	line-height: 1.15;
	text-wrap: balance;
}

/* Subline */
.md-finder__subline {
	font-size: 1.0625rem;
	color: #c7cedc;
	margin: 0 0 32px;
	line-height: 1.6;
	max-width: 48ch;
	margin-left: auto;
	margin-right: auto;
}

/* ── Mini KPI Tiles (glass) ───────────────────────── */
.md-finder__kpis {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 32px;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

.md-finder__kpi {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	padding: 18px 14px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	backdrop-filter: blur(4px);
}

.md-finder__kpi-value {
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: clamp(18px, 2.2vw, 24px);
	font-weight: 700;
	color: #fff;
	line-height: 1.1;
	white-space: nowrap;
}

.md-finder__kpi-value small {
	font-size: 0.65em;
	font-weight: 600;
	opacity: 0.7;
}

.md-finder__kpi-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: rgba(255, 255, 255, 0.45);
	line-height: 1.3;
}

.md-finder__kpi-trend {
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	margin-top: 2px;
}

.md-finder__kpi-trend--pos {
	color: #34D399;
}

.md-finder__kpi-trend--neg {
	color: #F87171;
}

/* Search field */
.md-finder__search {
	position: relative;
	max-width: 460px;
	margin: 0 auto 24px;
}

.md-finder__icon {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	color: rgba(255, 255, 255, 0.4);
	pointer-events: none;
	z-index: 2;
}

.md-finder-card .md-finder__input {
	width: 100%;
	padding: 16px 24px 16px 52px;
	border: 2px solid rgba(255, 255, 255, 0.12);
	border-radius: 100px;
	font-family: "Nunito Sans", sans-serif;
	font-size: 16px;
	color: #fff;
	background: rgba(255, 255, 255, 0.07);
	backdrop-filter: blur(8px);
	transition: border-color 0.2s var(--md-ease), box-shadow 0.2s var(--md-ease), background 0.2s var(--md-ease);
	box-sizing: border-box;
}

.md-finder-card .md-finder__input:focus {
	outline: none;
	border-color: #5BA8D9;
	background: rgba(255, 255, 255, 0.12);
	box-shadow: 0 0 0 4px rgba(91, 168, 217, 0.15);
}

.md-finder-card .md-finder__input::placeholder {
	color: rgba(255, 255, 255, 0.4);
}

/* Autocomplete dropdown */
.md-finder__results {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
	max-height: 280px;
	overflow-y: auto;
	z-index: 100;
	list-style: none;
	margin: 0;
	padding: 6px;
	text-align: left;
}

.md-finder__results[data-visible="true"] {
	display: block;
}

.md-finder__results li {
	margin: 0;
}

.md-finder__results a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 16px;
	text-decoration: none;
	color: #0B1129;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	transition: background 0.12s var(--md-ease);
}

.md-finder__results a:hover,
.md-finder__results a[data-active="true"] {
	background: #F5F8FC;
	color: #0B1129;
}

.md-finder__results .md-finder__result-plz {
	font-size: 13px;
	color: #5A5B6A;
	font-weight: 400;
	margin-left: auto;
}

.md-finder__no-results {
	padding: 14px 16px;
	color: #5A5B6A;
	font-size: 14px;
}

/* Popular links */
.md-finder__popular {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	gap: 5px 4px;
	margin-bottom: 28px;
	font-size: 15px;
	line-height: 1.9;
}

.md-finder__popular-label {
	font-weight: 700;
	color: rgba(255, 255, 255, 0.45);
	font-size: 14px;
}

.md-finder__popular-link {
	color: #5BA8D9;
	text-decoration: none;
	font-weight: 600;
	transition: color 0.15s var(--md-ease);
}

.md-finder__popular-link:hover {
	color: #fff;
	text-decoration: underline;
}

.md-finder__popular-link:not(:last-child)::after {
	content: "\00b7";
	margin-left: 4px;
	color: rgba(255, 255, 255, 0.2);
	font-weight: 400;
}

/* CTA button */
.md-finder__cta {
	display: inline-block;
	background: #0080C6;
	color: #fff;
	padding: 16px 36px;
	border-radius: 100px;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 2px;
	text-decoration: none;
	transition: background 0.2s var(--md-ease), box-shadow 0.2s var(--md-ease), transform 0.1s var(--md-ease-snap);
	box-shadow: 0 4px 16px rgba(0, 128, 198, 0.3);
}

.md-finder__cta:hover {
	background: #339ADE;
	color: #fff;
	box-shadow: 0 6px 24px rgba(0, 128, 198, 0.4);
}

.md-finder__cta:active {
	transform: scale(0.97);
	box-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
	.md-finder-card {
		border-radius: 20px;
	}

	.md-finder__kpis {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.md-finder__popular {
		font-size: 14px;
	}

	.md-finder__cta {
		padding: 14px 28px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.md-finder__kpis {
		grid-template-columns: 1fr 1fr;
	}

	.md-finder__kpi {
		padding: 14px 12px;
	}

	.md-finder__kpi-value {
		font-size: 18px;
	}
}
