/* ============================================================
   Kidszone Camp-Karte – Stylesheet
   ============================================================ */

/* ── Full-viewport layout: flex chain through theme wrappers ── */
.page-template-kzcm-page-karte .site-container {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.page-template-kzcm-page-karte .site-content {
	flex: 1 1 0%;
	min-height: 0;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
}

.page-template-kzcm-page-karte .site-content > .container {
	flex: 1;
	min-height: 0;
	width: 100% !important;
	max-width: none !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
}

/* Page wrapper */
#kzcm-map-page {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	position: relative;
	font-family: inherit;
}

/* ── Search Bar ──────────────────────────────────────────── */
#kzcm-search-bar {
	background: #faf6c5;
	border-bottom: 1px solid #e5d990;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	z-index: 11;
}

.kzcm-search-input-wrap {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
}

.kzcm-search-icon {
	position: absolute;
	left: 12px;
	color: #6b7280;
	pointer-events: none;
}

#kzcm-search-input {
	width: 100%;
	padding: 9px 36px 9px 36px;
	border: 1px solid #e5d990;
	border-radius: 8px;
	font-size: 14px;
	color: #111827;
	background: #f5f4d7;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	outline: none;
	box-sizing: border-box;
	font-family: inherit;
}

#kzcm-search-input:focus {
	border-color: #3b82f6;
	background: #f5f4d7;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#kzcm-search-input::-webkit-search-cancel-button { display: none; }

#kzcm-search-clear {
	position: absolute;
	right: 6px;
	width: 24px;
	height: 24px;
	border: none;
	background: transparent;
	color: #6b7280;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
}
#kzcm-search-clear:hover {
	background: #f5f4d7;
	color: #111;
}
#kzcm-search-clear[hidden] { display: none; }

/* AI sparkle toggle button */
#kzcm-ai-toggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 12px;
	border: 1px solid #e5d990;
	border-radius: 8px;
	background: #f5f4d7;
	color: #6b7280;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
	font-family: inherit;
}
#kzcm-ai-toggle:hover {
	color: #7c3aed;
	border-color: #c4b5fd;
}
#kzcm-ai-toggle.active {
	background: linear-gradient(135deg, #8b5cf6, #6366f1);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 1px 4px rgba(139, 92, 246, 0.4);
}
#kzcm-ai-toggle.active svg { animation: kzcm-sparkle 2s ease-in-out infinite; }

@keyframes kzcm-sparkle {
	0%, 100% { transform: rotate(0); }
	50%      { transform: rotate(15deg) scale(1.08); }
}

/* AI result list */
#kzcm-ai-results-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0 8px;
}
.kzcm-ai-result {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	width: 100%;
	transition: background 0.15s, border-color 0.15s;
}
.kzcm-ai-result:hover {
	background: #f5f4d7;
	border-color: #e5d990;
}
.kzcm-ai-result-img {
	width: 50px;
	height: 50px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f5f4d7;
}
.kzcm-ai-result-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.kzcm-ai-result-text strong {
	font-size: 12px;
	font-weight: 600;
	color: #111827;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: block;
}
.kzcm-ai-result-text span {
	font-size: 11px;
	color: #6b7280;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: block;
}
.kzcm-ai-result-score {
	font-size: 11px;
	font-weight: 700;
	color: #7c3aed;
	background: #ede9fe;
	padding: 2px 6px;
	border-radius: 10px;
	flex-shrink: 0;
}

.kzcm-ai-count {
	font-size: 12px;
	color: #6b7280;
	font-weight: 400;
	margin-left: 4px;
}
.kzcm-ai-loading,
.kzcm-ai-empty,
.kzcm-ai-error {
	padding: 20px 14px;
	text-align: center;
	font-size: 13px;
	color: #6b7280;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.kzcm-ai-error { color: #b91c1c; }

.kzcm-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #e5e7eb;
	border-top-color: #7c3aed;
	border-radius: 50%;
	animation: kzcm-spin 0.8s linear infinite;
}
@keyframes kzcm-spin {
	to { transform: rotate(360deg); }
}

/* ── Filter Bar ──────────────────────────────────────────── */
#kzcm-filter-bar {
	background: #faf6c5;
	border-bottom: 1px solid #e5d990;
	padding: 8px 16px;
	display: flex;
	align-items: center;
	gap: 0;
	flex-shrink: 0;
	z-index: 10;
	overflow: hidden;
}

.kzcm-filter-inner {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.kzcm-filter-inner::-webkit-scrollbar { display: none; }

/* Location button section – fixed right side of filter bar */
.kzcm-loc-section {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	padding-left: 10px;
	margin-left: 8px;
	border-left: 1px solid #e5d990;
}

#kzcm-loc-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

#kzcm-loc-btn.active {
	background: #b45309;
	border-color: #b45309;
	color: #fff;
}

#kzcm-loc-btn.kzcm-loc-loading {
	opacity: 0.6;
	cursor: wait;
}

.kzcm-filter-label {
	font-size: 13px;
	font-weight: 600;
	color: #6b7280;
	white-space: nowrap;
	flex-shrink: 0;
}

.kzcm-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 20px;
	border: 2px solid transparent;
	background: #f5f4d7;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.kzcm-filter-btn .kzcm-color-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.kzcm-filter-btn.active,
.kzcm-filter-btn:hover {
	background: #1e293b;
	color: #fff;
}

.kzcm-filter-all.active {
	background: #1e293b;
	color: #fff;
}

/* ── Radius bar ──────────────────────────────────────────── */
#kzcm-radius-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 16px;
	background: #f5f4d7;
	border-bottom: 1px solid #e5d990;
	flex-shrink: 0;
}

#kzcm-radius-bar[hidden] { display: none; }

.kzcm-radius-pin { flex-shrink: 0; }

.kzcm-radius-label {
	font-size: 12px;
	font-weight: 600;
	color: #92400e;
	white-space: nowrap;
	flex-shrink: 0;
}

#kzcm-radius-slider {
	flex: 1;
	max-width: 220px;
	accent-color: #b45309;
	cursor: pointer;
}

#kzcm-radius-value {
	font-size: 12px;
	font-weight: 700;
	color: #92400e;
	min-width: 46px;
}

#kzcm-radius-clear {
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 0 2px;
	flex-shrink: 0;
}
#kzcm-radius-clear:hover { color: #111; }

/* ── Camp pin markers (HTML elements) ────────────────────── */
/* Outer wrapper holds MapLibre's transform — no transitions here, otherwise
   every panning frame would queue an animation and the markers would lag. */
.kzcm-pin {
	width: 18px;
	height: 18px;
	cursor: pointer;
	will-change: transform;
}

/* Inner dot handles all visual styling and animations. */
.kzcm-pin-dot {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	box-sizing: border-box;
	transition: transform 0.15s ease, opacity 0.2s ease;
}

.kzcm-pin:hover .kzcm-pin-dot {
	transform: scale(1.35);
}

.kzcm-pin.kzcm-pin-out .kzcm-pin-dot {
	opacity: 0.25;
	transform: scale(0.7);
	border-width: 1.5px;
}

/* Active (selected) marker — highlight via scale + glow on the dot */
.kzcm-pin.kzcm-pin-active {
	z-index: 20;
}

.kzcm-pin.kzcm-pin-active .kzcm-pin-dot {
	transform: scale(1.4);
	border-width: 3px;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 4px 14px rgba(0, 0, 0, 0.45);
	opacity: 1 !important;
	animation: kzcm-pin-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes kzcm-pin-pop {
	0%   { transform: scale(1); }
	60%  { transform: scale(1.55); }
	100% { transform: scale(1.4); }
}

/* ── Pulsing location marker ─────────────────────────────── */
.kzcm-loc-marker {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #b45309;
	border: 3px solid #fff;
	box-shadow: 0 0 0 0 rgba(180, 83, 9, 0.5);
	animation: kzcm-pulse 2s infinite;
}

@keyframes kzcm-pulse {
	0%   { box-shadow: 0 0 0 0   rgba(180, 83, 9, 0.5); }
	70%  { box-shadow: 0 0 0 10px rgba(180, 83, 9, 0);   }
	100% { box-shadow: 0 0 0 0   rgba(180, 83, 9, 0);   }
}

/* ── Map Wrapper ──────────────────────────────────────────── */
#kzcm-map-wrap {
	display: flex;
	flex: 1;
	min-height: 0;
	position: relative;
}

/* ── Side panel (filter / ai-results) — absolute overlay ── */
#kzcm-side-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 280px;
	background: #faf6c5;
	border-right: 1px solid #e5d990;
	overflow-y: auto;
	z-index: 50;
	box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
	transform: translateX(0);
	transition: transform 0.25s ease;
	display: flex;
	flex-direction: column;
}

#kzcm-side-panel[data-state="closed"] {
	transform: translateX(-100%);
	pointer-events: none;
	box-shadow: none;
}

.kzcm-panel-section {
	padding: 14px 0;
}
.kzcm-panel-section[hidden] { display: none; }

.kzcm-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 14px 10px;
	border-bottom: 1px solid #f3f4f6;
	margin-bottom: 12px;
}
.kzcm-panel-title {
	font-size: 14px;
	font-weight: 700;
	color: #111827;
}
.kzcm-panel-close {
	background: none;
	border: none;
	font-size: 22px;
	color: #6b7280;
	cursor: pointer;
	line-height: 1;
	padding: 0 4px;
}
.kzcm-panel-close:hover { color: #111; }

/* Filter form */
.kzcm-filter-form {
	padding: 0 14px;
}
.kzcm-filter-loading {
	color: #6b7280;
	font-size: 13px;
	text-align: center;
	padding: 20px 0;
}
.kzcm-filter-group {
	margin-bottom: 16px;
}
.kzcm-filter-label-text {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}
.kzcm-filter-label-text strong {
	font-weight: 700;
	color: #1d4ed8;
}
#kzcm-price-slider { width: 100%; accent-color: #3b82f6; cursor: pointer; }
.kzcm-range-row {
	display: flex;
	align-items: center;
	gap: 6px;
}
.kzcm-range-row input {
	width: 70px;
	padding: 5px 8px;
	border: 1px solid #e5d990;
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	background: #f5f4d7;
}
.kzcm-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}
.kzcm-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 9px;
	background: #f5f4d7;
	border: 1px solid transparent;
	border-radius: 16px;
	font-size: 12px;
	color: #374151;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.kzcm-pill:hover { background: #ece8b6; }
.kzcm-pill.active {
	background: #3b82f6;
	color: #fff;
	border-color: #3b82f6;
}
.kzcm-pill-count {
	font-size: 10px;
	opacity: 0.7;
}
.kzcm-pill.active .kzcm-pill-count { opacity: 0.9; }

.kzcm-filter-actions {
	padding: 12px 14px 0;
	border-top: 1px solid #f3f4f6;
	margin-top: 16px;
}
.kzcm-filter-reset {
	background: #f5f4d7;
	border: 1px solid #e5d990;
	color: #374151;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 12px;
	cursor: pointer;
	font-family: inherit;
}
.kzcm-filter-reset:hover { background: #ece8b6; }

/* Filter button + badge */
#kzcm-filter-toggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
	margin-left: 6px;
}
.kzcm-filter-badge {
	background: #3b82f6;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 10px;
	margin-left: 2px;
}

/* Active filter chips bar */
#kzcm-active-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 6px 16px;
	background: #faf6c5;
	border-bottom: 1px solid #e5d990;
	flex-shrink: 0;
}
#kzcm-active-chips[hidden] { display: none; }
.kzcm-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	background: #f5f4d7;
	border: 1px solid #e5d990;
	border-radius: 12px;
	font-size: 11px;
	color: #374151;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.12s;
}
.kzcm-chip:hover { background: #ece8b6; color: #111; }
.kzcm-chip span {
	font-size: 14px;
	line-height: 1;
	color: #6b7280;
}

/* ── Map Canvas ──────────────────────────────────────────── */
#kzcm-map {
	flex: 1;
	min-width: 0;
}

/* ── Fullscreen toggle button ────────────────────────────── */
.kzcm-fullscreen-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	z-index: 10;
	box-shadow: 0 1px 4px rgba(0,0,0,0.12);
	transition: background 0.15s, box-shadow 0.15s;
	line-height: 1;
}
.kzcm-fullscreen-btn:hover {
	background: #fff;
	box-shadow: 0 2px 8px rgba(0,0,0,0.16);
}

/* ── Popup ──────────────────────────────────────────────── */
#kzcm-popup {
	position: absolute;
	bottom: 24px;
	right: 24px;
	width: 280px;
	background: #f5f4d7;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.18);
	z-index: 100;
	overflow: hidden;
}

#kzcm-popup[hidden] { display: none; }

.kzcm-popup-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	background: rgba(245, 244, 215, 0.95);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 50%;
	font-size: 18px;
	font-weight: 400;
	color: #374151;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	transition: background 0.15s, color 0.15s, transform 0.15s;
	z-index: 10;
}

.kzcm-popup-close:hover {
	background: #f5f4d7;
	color: #111;
	transform: scale(1.08);
}

.kzcm-popup-content { padding: 16px; }

.kzcm-popup-thumbnail {
	width: 100%;
	height: 140px;
	object-fit: cover;
	display: block;
}

.kzcm-popup-category {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
}

.kzcm-popup-cat-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.kzcm-popup-title {
	font-size: 15px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 4px;
	line-height: 1.3;
}

.kzcm-popup-location {
	font-size: 12px;
	color: #6b7280;
	margin: 0 0 6px;
}

.kzcm-popup-travel {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px;
	margin: 0 0 10px;
	background: #eff6ff;
	border-radius: 6px;
	font-size: 12px;
	color: #1e40af;
	font-weight: 500;
}
.kzcm-popup-travel-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #1e40af;
	text-decoration: none;
	padding: 2px 6px;
	border-radius: 4px;
	transition: background 0.15s, color 0.15s;
}
.kzcm-popup-travel-item:hover {
	background: #dbeafe;
	color: #1e3a8a;
	text-decoration: none;
}
.kzcm-popup-travel-item svg { flex-shrink: 0; }
.kzcm-popup-travel-distance {
	margin-left: auto;
	color: #6b7280;
	font-weight: 600;
}

.kzcm-popup-excerpt {
	font-size: 13px;
	color: #4b5563;
	margin: 0 0 12px;
	padding-top: 10px;
	line-height: 1.6;
	border-top: 1px solid #f3f4f6;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.kzcm-popup-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.kzcm-popup-price {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
}

.kzcm-popup-link {
	display: inline-block;
	padding: 6px 14px;
	background: #f59e0b;
	color: #fff;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s;
}

.kzcm-popup-link:hover { background: #d97706; color: #fff; }

/* ── Loading overlay ─────────────────────────────────────── */
#kzcm-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(250, 246, 197, 0.85);
	z-index: 200;
	font-size: 15px;
	color: #374151;
}

#kzcm-loading.hidden { display: none; }

/* ── Region hover tooltip ────────────────────────────────── */
.kzcm-region-tooltip {
	position: absolute;
	background: rgba(0,0,0,0.75);
	color: #fff;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 13px;
	pointer-events: none;
	white-space: nowrap;
	z-index: 50;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
	/* Filter panel becomes full-width drawer on mobile */
	#kzcm-side-panel { width: 100%; right: 0; border-right: none; }

	#kzcm-popup {
		bottom: 0;
		right: 0;
		left: 0;
		width: 100%;
		border-radius: 16px 16px 0 0;
	}

	#kzcm-filter-bar { padding: 8px 12px; }

	/* Mobile: search bar collapses to icon-only by default, expands on focus */
	#kzcm-search-bar { padding: 8px 12px; }
	.kzcm-search-input-wrap {
		max-width: 44px;
		transition: max-width 0.25s ease;
	}
	#kzcm-search-input {
		padding-right: 12px;
		cursor: pointer;
	}
	#kzcm-search-input::placeholder { color: transparent; }
	.kzcm-search-input-wrap:focus-within,
	.kzcm-search-input-wrap:has(input:not(:placeholder-shown)) {
		max-width: 100%;
	}
	.kzcm-search-input-wrap:focus-within #kzcm-search-input,
	.kzcm-search-input-wrap:has(input:not(:placeholder-shown)) #kzcm-search-input {
		padding-right: 36px;
		cursor: text;
	}
	.kzcm-search-input-wrap:focus-within #kzcm-search-input::placeholder,
	.kzcm-search-input-wrap:has(input:not(:placeholder-shown)) #kzcm-search-input::placeholder {
		color: #9ca3af;
	}
}
