/* ============================================================
   Clinic Locator
   Palette pulled from the mockup:
     ink   #2F3E46   teal  #527C91   cream #F5F5F0
   ============================================================ */

.clinic-locator {
	--cl-ink: #2f3e46;
	--cl-muted: #5f6b70;
	--cl-teal: #527c91;
	--cl-cream: #f5f5f0;
	--cl-border: #e2e2dd;
	--cl-radius: 16px;

	position: relative;
	height: var(--cl-height, 600px);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow: hidden;
	border-radius: var(--cl-radius);
	font-family: inherit;
	color: var(--cl-ink);
}

/* This theme wraps page content in a fixed-width .container (max-width: 960px)
   with no breakout CSS of its own — when this block's alignment is set to
   "full width" in the editor, break out of that container to the viewport edges. */
.clinic-locator.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* ---------- Map ---------- */
.clinic-locator__map {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: #e8ecec;
}
.clinic-locator__map .gm-style {
	font-family: inherit;
}
/* Google's default InfoWindow chrome is unused — we render a custom popup. */
.clinic-locator__map .gm-style-iw,
.clinic-locator__map .gm-style-iw-tc {
	display: none;
}

/* ---------- Floating panel ---------- */
.clinic-locator__panel {
	position: absolute;
	top: 50%;
	left: 5%;
	transform: translateY(-50%);
	z-index: 1000;
	display: flex;
	flex-direction: column;
	width: 420px;
	max-width: calc(100% - 48px);
	height: 78.66%;
	padding: 26px 26px 20px;
	background: #fff;
	border-radius: var(--cl-radius);
	box-shadow: 0 18px 45px rgba(21, 33, 40, 0.18);
	box-sizing: border-box;
}

.clinic-locator__heading {
	margin: 0 0 18px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cl-ink);
}

/* ---------- Controls ---------- */
.clinic-locator__controls {
	display: flex;
	gap: 12px;
	margin-bottom: 14px;
}
.clinic-locator__field {
	position: relative;
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid #d9d9d2;
	border-radius: 999px;
}
.clinic-locator__field--location {
	flex: 1 1 auto;
}
.clinic-locator__field--radius {
	flex: 0 0 auto;
}
.clinic-locator__field input[type="text"], .clinic-locator__field input[type="search"], 
.clinic-locator__field select {
	width: 100%;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 15px;
	color: var(--cl-ink);
	padding: 13px 16px;
	border-radius: 999px;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}
.clinic-locator__field input::placeholder {
	color: #9aa2a6;
}
.clinic-locator__field:focus-within {
	border-color: var(--cl-teal);
	box-shadow: 0 0 0 3px rgba(82, 124, 145, 0.14);
}

/* location input keeps room for the GPS button */
.clinic-locator__field--location input {
	padding-right: 46px;
}
.clinic-locator__locate {
	position: absolute;
	right: 8px;
	display: grid;
	padding: 1px 6px;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cl-muted);
	cursor: pointer;
	transition: color 0.15s, background 0.15s;
}
.clinic-locator__locate:hover {
	color: var(--cl-teal);
	background: rgba(82, 124, 145, 0.1);
}
.clinic-locator__locate.is-loading {
	color: var(--cl-teal);
	animation: cl-spin 0.9s linear infinite;
}
@keyframes cl-spin {
	to {
		transform: rotate(360deg);
	}
}

/* radius select + caret */
.clinic-locator__field--radius {
	padding-right: 30px;
}
.clinic-locator__field--radius::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--cl-muted);
	border-bottom: 2px solid var(--cl-muted);
	transform: translateY(-65%) rotate(45deg);
	pointer-events: none;
}
.clinic-locator__field--radius select {
	padding-right: 10px;
	cursor: pointer;
}

/* search */
.clinic-locator__field--search {
	margin-bottom: 18px;
}
.clinic-locator__field--search input {
	padding-right: 46px;
}
.clinic-locator__search-icon {
	position: absolute;
	right: 16px;
	display: grid;
	place-items: center;
	color: var(--cl-muted);
	pointer-events: none;
}

/* ---------- List ---------- */
.clinic-locator__list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	background: var(--cl-cream);
	border-radius: 12px;
	scrollbar-width: thin;
	scrollbar-color: var(--cl-teal) transparent;
}
.clinic-locator__list::-webkit-scrollbar {
	width: 8px;
}
.clinic-locator__list::-webkit-scrollbar-thumb {
	background: var(--cl-teal);
	border-radius: 999px;
}
.clinic-locator__list::-webkit-scrollbar-track {
	background: transparent;
}

.clinic-locator__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 22px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid var(--cl-border);
	transition: background 0.15s;
}
.clinic-locator__item:last-child {
	border-bottom: 0;
}
.clinic-locator__item:hover {
	background: rgba(47, 62, 70, 0.04);
}
.clinic-locator__item[hidden] {
	display: none;
}
.clinic-locator__item-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.clinic-locator__title {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cl-ink);
}
.clinic-locator__addr,
.clinic-locator__phone {
	font-size: 14px;
	color: var(--cl-muted);
	line-height: 1.4;
}
.clinic-locator__dist {
	margin-top: 6px;
	font-size: 14px;
	font-weight: 700;
	color: var(--cl-ink);
}
.clinic-locator__dist[hidden] {
	display: none;
}
.clinic-locator__chev {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	color: #aab2b5;
}

.clinic-locator__empty {
	margin: 12px 4px 0;
	font-size: 14px;
	color: var(--cl-muted);
	text-align: center;
}
.clinic-locator__empty[hidden] {
	display: none;
}

.clinic-locator__notice {
	position: absolute;
	inset: auto 24px 24px;
	z-index: 1000;
	padding: 12px 16px;
	background: #fff8e5;
	border: 1px solid #f0e2b0;
	border-radius: 10px;
	font-size: 13px;
	color: #7a5c00;
}

/* ============================================================
   Map + custom detail popup (Google Maps OverlayView)
   The pin marker itself is a data-URI SVG icon set in JS, so it
   needs no CSS. This styles the popup box that floats above it.
   ============================================================ */
.clinic-locator__maperr {
	display: grid;
	place-items: center;
	height: 100%;
	color: var(--cl-muted);
	font-size: 15px;
}

/* Positioning wrapper placed in Google's floatPane; anchored above the pin. */
.cl-gpopup {
	position: absolute;
	transform: translate(-50%, calc(-100% - 50px));
	z-index: 5;
	cursor: default;
}

/* Themed teal box with a downward tail. */
.cl-popup {
	position: relative;
	min-width: 220px;
	max-width: 290px;
	padding: 18px 20px;
	background: var(--cl-teal, #527c91);
	color: #fff;
	border-radius: 14px;
	box-shadow: 0 14px 32px rgba(21, 33, 40, 0.3);
}
.cl-popup::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -9px;
	transform: translateX(-50%);
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 10px solid var(--cl-teal, #527c91);
}
.cl-popup h3 {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}
.cl-popup p {
	margin: 0 0 4px;
	font-size: 14px;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.9);
}
.cl-popup__btn {
	display: inline-block;
	margin-top: 14px;
	padding: 9px 22px;
	background: #fff;
	color: var(--cl-ink, #2f3e46);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 999px;
	transition: background 0.15s;
}
.cl-popup__btn:hover {
	background: #eef1f1;
}

/* ============================================================
   Responsive — stack map on top, panel below
   ============================================================ */
@media (max-width: 768px) {
	.clinic-locator {
		height: auto;
		overflow: visible;
		border-radius: 0;
	}
	.clinic-locator__map {
		position: relative;
		inset: auto;
		height: 360px;
		border-radius: 0;
	}
	.clinic-locator__panel {
		position: static;
		width: auto;
		max-width: none;
		height: auto;
		max-height: none;
		transform: none;
		box-shadow: none;
		padding: 22px 16px;
		border-radius: 0;
	}
	.clinic-locator__list {
		max-height: 60vh;
	}
	.clinic-locator__notice {
		position: static;
		margin: 16px;
	}
}
