/* Mapa sanatoriow - styl spojny z motywem sanatorium.net.pl */
.sim-map-page #breadcrumbs { display: none; }
.sim-map-page.separate-containers .site-main { margin: 0; }
.sim-map-page .site-content { display: block; padding: 0; }

.sim-app, .sim-app * { box-sizing: border-box; }
.sim-app {
	--g: #0f4d2e;
	--gd: #123b29;
	--gs: #eef4ee;
	--ink: #1f2a24;
	--muted: #5b6660;
	--line: #e3e8e3;
	--c-s: #0f4d2e;
	--c-sh: #2f7f5f;
	--c-h: #1f5f8b;
	--c-k: #b9862b;
	display: grid;
	grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
	height: calc(100vh - 115px);
	min-height: 620px;
	overflow: hidden;
	position: relative;
	background: #f3f7f3;
	border-top: 1px solid var(--line);
	/* na pelna szerokosc ekranu, poza kontenerem motywu */
	width: 100vw;
	max-width: 100vw;
	left: 50%;
	margin-left: -50vw;
}
.sim-map-page .site.grid-container,
.sim-map-page .site-content,
.sim-map-page .content-area,
.sim-map-page .site-main { max-width: none; padding: 0; margin: 0; }

.sim-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #fff;
	border-right: 1px solid var(--line);
	z-index: 1001;
}
.sim-panel__header { padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.sim-eyebrow { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.sim-eyebrow span { font-weight: 700; color: var(--g); }
.sim-panel__header h1 {
	margin: 0;
	font-family: Merriweather, Georgia, serif;
	font-size: clamp(24px, 2vw, 30px);
	font-weight: 700;
	line-height: 1.15;
	color: var(--gd);
}
.sim-panel__header p:last-child { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }

.sim-search {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr) 30px;
	align-items: center;
	padding: 6px 20px;
	border-bottom: 1px solid var(--line);
}
.sim-search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.sim-search input[type="search"] {
	height: 42px;
	min-width: 0;
	padding: 0 10px;
	background: transparent;
	border: 0;
	box-shadow: none;
	outline: 0;
	font: inherit;
	font-size: 15px;
	color: var(--ink);
}
.sim-search:focus-within { box-shadow: inset 3px 0 0 var(--g); }
.sim-search__clear { width: 30px; height: 30px; padding: 0; background: transparent; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }

.sim-types { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.sim-type {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 11px;
	background: #fff;
	border: 1px solid #cfd8d0;
	border-radius: 999px;
	color: var(--ink);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}
.sim-type:hover { background: var(--gs); border-color: #9fbfa4; }
.sim-type.is-on { background: var(--g); border-color: var(--g); color: #fff; }
.sim-type.is-on .sim-dot { box-shadow: 0 0 0 2px #fff; }

.sim-dot { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.sim-dot--s { background: var(--c-s); }
.sim-dot--sh { background: var(--c-sh); }
.sim-dot--h { background: var(--c-h); }
.sim-dot--k { background: var(--c-k); }

.sim-controls {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	gap: 8px;
	align-items: end;
	padding: 12px 20px;
	border-bottom: 1px solid var(--line);
}
.sim-field { display: grid; gap: 4px; }
.sim-field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.sim-field select {
	width: 100%;
	height: 38px;
	min-width: 0;
	padding: 0 8px;
	background: #fff;
	border: 1px solid #cfd8d0;
	border-radius: 7px;
	font: inherit;
	font-size: 13px;
	color: var(--ink);
}
.sim-nearest {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 11px;
	background: var(--gs);
	border: 1px solid #b9d0bc;
	border-radius: 7px;
	color: var(--gd);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}
.sim-nearest:hover, .sim-nearest.is-active { background: var(--g); border-color: var(--g); color: #fff; }
.sim-nearest:disabled { opacity: .6; cursor: wait; }
.sim-nearest svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.sim-results-heading { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.sim-results-heading div { display: flex; align-items: baseline; gap: 6px; }
.sim-results-heading strong { font-size: 18px; color: var(--gd); }
.sim-results-heading span { font-size: 13px; color: var(--muted); }
.sim-reset { padding: 6px 0 6px 8px; background: transparent; border: 0; color: var(--g); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

.sim-results { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.sim-results__list { margin: 0; padding: 0; list-style: none; }
.sim-result { margin: 0; border-bottom: 1px solid var(--line); }
.sim-result__button {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	padding: 12px 20px;
	background: #fff;
	border: 0;
	color: var(--ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.sim-result__button:hover, .sim-result__button:focus-visible, .sim-result.is-active .sim-result__button { background: var(--gs); box-shadow: inset 3px 0 0 var(--g); outline: 0; }
.sim-result.is-nearest .sim-result__button { box-shadow: inset 3px 0 0 #176b87; }
.sim-result__heading { display: flex; justify-content: space-between; gap: 10px; width: 100%; }
.sim-result__heading strong { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--gd); }
.sim-result__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sim-result__address { font-size: 12px; line-height: 1.4; color: var(--muted); }
.sim-distance { flex: 0 0 auto; padding: 3px 7px; background: #edf4f7; border-radius: 999px; color: #176b87; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sim-results__empty { margin: 0; padding: 30px 22px; font-size: 14px; color: var(--muted); text-align: center; }

.sim-stage, .sim-map { width: 100%; height: 100%; min-height: 0; }
.sim-stage { position: relative; background: #dfe9de; }
.sim-map { z-index: 1; }
.sim-map .leaflet-tile-pane { filter: saturate(.8); }
.sim-map .leaflet-popup-content-wrapper { border-radius: 8px; }
.sim-map .leaflet-popup-content { margin: 14px 16px; font-family: inherit; }

.sim-div-icon { background: transparent; border: 0; }
.sim-marker {
	display: block;
	width: 24px;
	height: 24px;
	border: 3px solid #fff;
	border-radius: 50% 50% 50% 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
	transform: rotate(-45deg);
}
.sim-marker--s { background: var(--c-s); }
.sim-marker--sh { background: var(--c-sh); }
.sim-marker--h { background: var(--c-h); }
.sim-marker--k { background: var(--c-k); }
.sim-cluster { background: transparent; border: 0; }
.sim-cluster span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: rgba(15, 77, 46, .94);
	border: 4px solid rgba(255, 255, 255, .92);
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.sim-popup { color: var(--ink); }
.sim-popup__meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sim-popup__type { font-size: 12px; font-weight: 600; color: var(--g); }
.sim-popup__title { display: block; margin-bottom: 6px; font-size: 15px; line-height: 1.3; color: var(--gd); }
.sim-map .sim-popup p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.sim-popup__fin { color: var(--muted); }
.sim-map .sim-popup__phone { display: inline-block; margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--gd); text-decoration: none; }
.sim-popup__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sim-map .sim-popup__actions a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 6px;
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--ink);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}
.sim-map .sim-popup__actions .sim-popup__primary { background: var(--g); border-color: var(--g); color: #fff; }

.sim-error, .sim-status, .sim-noscript {
	position: absolute;
	top: 16px;
	left: 50%;
	z-index: 1000;
	margin: 0;
	padding: 10px 14px;
	transform: translateX(-50%);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
	font-size: 13px;
	color: var(--ink);
}
.sim-error[hidden], .sim-status[hidden] { display: none; }
.sim-error, .sim-status.is-error { color: #8b2f2a; border-color: #ecc9c6; }

.sim-map-actions { position: absolute; top: 88px; right: 10px; z-index: 999; display: grid; gap: 8px; }
.sim-map-actions button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 6px;
	color: var(--gd);
	cursor: pointer;
}
.sim-map-actions button:hover { background: var(--g); color: #fff; }
.sim-map-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.sim-legend {
	position: absolute;
	left: 12px;
	bottom: 14px;
	z-index: 999;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	padding: 8px 11px;
	background: rgba(255, 255, 255, .95);
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 7px;
	font-size: 12px;
	color: var(--ink);
}
.sim-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sim-mobile-toggle { display: none; }

@media (max-width: 800px) {
	.sim-app { display: block; height: calc(100svh - 70px); min-height: 540px; }
	.sim-stage { position: absolute; inset: 0; }
	.sim-panel {
		position: absolute;
		left: 8px;
		right: 8px;
		bottom: 70px;
		max-height: calc(100% - 86px);
		overflow: hidden;
		border: 1px solid var(--line);
		border-radius: 12px;
		box-shadow: 0 16px 44px rgba(0, 0, 0, .2);
		transform: translateY(calc(100% + 90px));
		transition: transform .25s ease;
		z-index: 1200;
	}
	.sim-app.is-panel-open .sim-panel { transform: translateY(0); }
	.sim-panel__header { padding: 16px 16px 12px; }
	.sim-panel__header h1 { font-size: 22px; }
	.sim-panel__header p:last-child { display: none; }
	.sim-search, .sim-types, .sim-controls, .sim-results-heading { padding-left: 14px; padding-right: 14px; }
	.sim-controls { grid-template-columns: 1fr 1fr; }
	.sim-nearest { grid-column: 1 / -1; justify-content: center; }
	.sim-mobile-toggle {
		position: absolute;
		left: 50%;
		bottom: 16px;
		z-index: 1300;
		display: block;
		min-height: 44px;
		padding: 0 20px;
		transform: translateX(-50%);
		background: var(--gd);
		border: 0;
		border-radius: 999px;
		box-shadow: 0 5px 16px rgba(0, 0, 0, .28);
		color: #fff;
		font: inherit;
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
	}
	.sim-legend { bottom: 70px; left: 8px; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
	.sim-panel { transition: none; }
}
