/* Mapa PSZOK - styl spojny z motywem pszok.info (uklad jak mapa sanatoriow) */
.pim-map-page .site-content { display: block; padding: 0; }
.pim-map-page.separate-containers .site-main { margin: 0; }

.pim-app, .pim-app * { box-sizing: border-box; }
.pim-app {
	--g: #1f6b2d;
	--gd: #1b4d24;
	--gs: #eef5ea;
	--ink: #1e2a20;
	--muted: #5b675d;
	--line: #e3e9e0;
	--red: #c62828;
	display: grid;
	grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
	height: calc(100vh - 90px);
	min-height: 620px;
	overflow: hidden;
	position: relative;
	background: #f4f8f2;
	width: 100vw;
	max-width: 100vw;
	left: 50%;
	margin-left: -50vw;
}
.pim-map-page .site.grid-container,
.pim-map-page .site-content,
.pim-map-page .content-area,
.pim-map-page .site-main { max-width: none; padding: 0; margin: 0; }

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

.pim-search {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr) 30px;
	align-items: center;
	padding: 6px 20px;
	border-bottom: 1px solid var(--line);
}
.pim-search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.pim-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);
}
.pim-search:focus-within { box-shadow: inset 3px 0 0 var(--g); }
.pim-search__clear { width: 30px; height: 30px; padding: 0; background: transparent; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.pim-search__clear:hover, .pim-search__clear:focus { background: transparent; color: var(--ink); }

.pim-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);
}
.pim-field { display: grid; gap: 4px; }
.pim-field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.pim-field select {
	width: 100%;
	height: 38px;
	min-width: 0;
	padding: 0 8px;
	background: #fff;
	border: 1px solid #cfdacb;
	border-radius: 7px;
	font: inherit;
	font-size: 13px;
	color: var(--ink);
}
.pim-nearest {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 11px;
	background: var(--gs);
	border: 1px solid #bcd3b4;
	border-radius: 7px;
	color: var(--gd);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}
.pim-nearest:hover, .pim-nearest:focus, .pim-nearest.is-active { background: var(--g); border-color: var(--g); color: #fff; }
.pim-nearest:disabled { opacity: .6; cursor: wait; }
.pim-nearest svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

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

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

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

.pim-div-icon { background: transparent; border: 0; }
.pim-marker {
	display: block;
	width: 24px;
	height: 24px;
	background: var(--g);
	border: 3px solid #fff;
	border-radius: 50% 50% 50% 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
	transform: rotate(-45deg);
}
.pim-cluster { background: transparent; border: 0; }
.pim-cluster span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: rgba(31, 107, 45, .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;
}

.pim-popup { color: var(--ink); }
.pim-popup__meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pim-popup__type { font-size: 12px; font-weight: 600; color: var(--g); }
.pim-popup__title { display: block; margin-bottom: 6px; font-size: 15px; line-height: 1.3; color: var(--gd); }
.pim-map .pim-popup p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.pim-map .pim-popup .pim-popup__muted { color: var(--muted); }
.pim-map .pim-popup .pim-popup__hours { font-weight: 600; color: var(--g); }
.pim-map .pim-popup .pim-popup__hours.is-closed { color: var(--red); }
.pim-map .pim-popup__phone { display: inline-block; margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--gd); text-decoration: none; }
.pim-popup__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pim-map .pim-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;
}
.pim-map .pim-popup__actions .pim-popup__primary { background: var(--g); border-color: var(--g); color: #fff; }

.pim-error, .pim-status, .pim-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);
}
.pim-error[hidden], .pim-status[hidden] { display: none; }
.pim-error, .pim-status.is-error { color: #8b2f2a; border-color: #ecc9c6; }

.pim-map-actions { position: absolute; top: 88px; right: 10px; z-index: 999; display: grid; gap: 8px; }
.pim-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;
}
.pim-map-actions button:hover, .pim-map-actions button:focus { background: var(--g); color: #fff; }
.pim-map-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pim-mobile-toggle { display: none; }

@media (max-width: 800px) {
	.pim-app { display: block; height: calc(100svh - 64px); min-height: 540px; }
	.pim-stage { position: absolute; inset: 0; }
	.pim-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;
	}
	.pim-app.is-panel-open .pim-panel { transform: translateY(0); }
	.pim-panel__header { padding: 16px 16px 12px; }
	.pim-panel__header h1 { font-size: 22px; }
	.pim-panel__header p:last-child { display: none; }
	.pim-search, .pim-controls, .pim-results-heading { padding-left: 14px; padding-right: 14px; }
	.pim-result__button { padding-left: 14px; padding-right: 14px; }
	.pim-controls { grid-template-columns: 1fr 1fr; }
	.pim-nearest { grid-column: 1 / -1; justify-content: center; }
	.pim-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;
	}
}
@media (prefers-reduced-motion: reduce) {
	.pim-panel { transition: none; }
}
