/**
 * Consulta de PDM — mapa nacional (ver inc/pdm-explorer.php e
 * assets/js/pdm-explorer.js). Ficheiro próprio desta página (não é
 * partilhado), separado do <style> inline de page-pdm.php só para não
 * enterrar a lógica de layout do mapa/Leaflet no meio dos tokens/reset
 * repetidos em todas as páginas de serviço — mesmo critério usado em
 * booking-widget.css.
 *
 * Usa os tokens de design (--c-blue, --c-ink, --radius-*, --fs-*, etc.)
 * definidos no :root de page-pdm.php, com fallbacks.
 */

/* =========================================================
   Pesquisa (barra no hero)
   ========================================================= */
.pdm-search {
	position: relative;
	width: 100%;
	max-width: 522px;
}

.pdm-search__form {
	display: flex;
	align-items: center;
	gap: 7.2px;
	width: 100%;
	padding: 7.2px 7.2px 7.2px 16.2px;
	background: var(--c-white, #fff);
	border: 1px solid var(--c-svc-input-border, rgba(10, 45, 77, 0.13));
	border-radius: var(--radius-md, 9px);
	box-shadow: var(--sh-header, 0 7px 27px rgba(10, 45, 77, 0.07));
}

.pdm-search__input {
	flex: 1 1 0;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font-family: inherit;
	font-size: var(--fs-15, 14px);
	color: var(--c-ink, #0a2d4d);
}

.pdm-search__input::placeholder { color: var(--c-svc-input-placeholder, #6f7b87); }

.pdm-search__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 37.8px;
	height: 37.8px;
	flex-shrink: 0;
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm, 6px);
	background: var(--c-blue, #008bbd);
	color: var(--c-white, #fff);
	cursor: pointer;
}

.pdm-search__results {
	position: absolute;
	top: calc(100% + 7.2px);
	left: 0;
	right: 0;
	z-index: 20;
	max-height: 306px;
	overflow-y: auto;
	background: var(--c-white, #fff);
	border: 1px solid var(--c-svc-input-border, rgba(10, 45, 77, 0.13));
	border-radius: var(--radius-md, 9px);
	box-shadow: 0 18px 36px rgba(10, 45, 77, 0.16);
}

.pdm-search__results:empty { display: none; }

.pdm-search__result {
	display: block;
	width: 100%;
	padding: 12.6px 16.2px;
	border: 0;
	border-bottom: 1px solid var(--c-hairline, #e5e7eb);
	background: none;
	text-align: left;
	font-size: var(--fs-14, 13px);
	line-height: 18.9px;
	color: var(--c-ink, #0a2d4d);
	cursor: pointer;
}

.pdm-search__result:last-child { border-bottom: 0; }
.pdm-search__result:hover { background: var(--c-blue-soft, #e6f4fa); }

/* =========================================================
   Secção da ferramenta (sidebar + mapa + resultados)
   ========================================================= */
.pdm-tool { background: var(--c-white, #fff); padding-block: 52.2px; }

.pdm-tool__grid {
	display: flex;
	align-items: flex-start;
	gap: 28.8px;
}

/* Sidebar ------------------------------------------------- */
.pdm-sidebar {
	display: flex;
	flex-direction: column;
	gap: 21.6px;
	flex: 0 0 283.5px;
	width: 283.5px;
	padding: 22.5px;
	border: 1px solid var(--c-svc-card-border, #d7ecf5);
	border-radius: var(--radius-lg, 12.6px);
	background: var(--c-svc-card-bg, #f4f9fc);
}

.pdm-sidebar__title {
	font-size: 15.3px;
	font-weight: 700;
	line-height: 19.8px;
	color: var(--c-ink, #0a2d4d);
}

.pdm-field { display: flex; flex-direction: column; gap: 7.2px; width: 100%; }

.pdm-field__label {
	font-size: var(--fs-13, 12px);
	font-weight: 600;
	color: var(--c-ink, #0a2d4d);
}

.pdm-select-wrap { position: relative; width: 100%; }

.pdm-select {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	padding: 12.6px 34px 12.6px 12.6px;
	border: 1px solid var(--c-svc-input-border, rgba(10, 45, 77, 0.13));
	border-radius: var(--radius-sm, 6px);
	background: var(--c-svc-input-bg, #fbfdfe);
	font-family: inherit;
	font-size: var(--fs-14, 13px);
	color: var(--c-ink, #0a2d4d);
	cursor: pointer;
}

.pdm-select:disabled { cursor: not-allowed; opacity: 0.55; }

.pdm-select-wrap svg {
	position: absolute;
	top: 50%;
	right: 12.6px;
	transform: translateY(-50%);
	width: 14.4px;
	height: 14.4px;
	pointer-events: none;
	color: var(--c-body, #536373);
}

.pdm-sidebar__button {
	width: 100%;
	justify-content: center;
}

.pdm-sidebar__button:disabled { opacity: 0.45; cursor: not-allowed; }

.pdm-sidebar__divider {
	height: 1px;
	background: var(--c-svc-list-divider, rgba(10, 45, 77, 0.12));
}

.pdm-sidebar__hint {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 11.7px;
	line-height: 17.55px;
	color: var(--c-body, #536373);
}

.pdm-sidebar__hint svg { flex-shrink: 0; margin-top: 1.8px; color: var(--c-blue, #008bbd); }

.pdm-layer-toggle {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: var(--fs-13, 12px);
	font-weight: 600;
	color: var(--c-ink, #0a2d4d);
	cursor: pointer;
}

.pdm-layer-toggle input { width: 15.3px; height: 15.3px; accent-color: var(--c-blue, #008bbd); cursor: pointer; }

.pdm-legend {
	display: flex;
	flex-direction: column;
	gap: 6.3px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pdm-legend li {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 11.7px;
	color: var(--c-body, #536373);
}

.pdm-legend__swatch {
	width: 14.4px;
	height: 14.4px;
	border-radius: 3.6px;
	border: 1px solid rgba(10, 45, 77, 0.12);
	flex-shrink: 0;
}

/* Mapa + resultados ---------------------------------------- */
.pdm-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 21.6px; }

.pdm-map-wrap {
	position: relative;
	width: 100%;
	border-radius: var(--radius-lg, 12.6px);
	overflow: hidden;
	border: 1px solid var(--c-svc-card-border, #d7ecf5);
	box-shadow: var(--sh-svc-form, 0 20px 47px rgba(10, 45, 77, 0.1));
}

.pdm-map {
	width: 100%;
	height: 549px;
	background: var(--c-band, #eef5f9);
}

.pdm-map-wrap__status {
	position: absolute;
	top: 12.6px;
	left: 12.6px;
	z-index: 400;
	padding: 7.2px 12.6px;
	border-radius: var(--radius-sm, 6px);
	background: var(--c-white-96, rgba(255, 255, 255, 0.96));
	box-shadow: 0 7px 18px rgba(10, 45, 77, 0.12);
	font-size: 11.7px;
	font-weight: 600;
	color: var(--c-ink, #0a2d4d);
}

.pdm-results {
	display: flex;
	flex-direction: column;
	gap: 12.6px;
	padding: 22.5px;
	border: 1px solid var(--c-svc-card-border, #d7ecf5);
	border-radius: var(--radius-lg, 12.6px);
	background: var(--c-svc-card-bg, #f4f9fc);
	min-height: 90px;
}

.pdm-results__title {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--c-ink, #0a2d4d);
}

.pdm-results__placeholder,
.pdm-results__loading,
.pdm-results__error {
	font-size: var(--fs-14, 13px);
	line-height: 20.7px;
	color: var(--c-body, #536373);
}

.pdm-results__location {
	font-size: var(--fs-13, 12px);
	color: var(--c-slate, #465b6e);
}

.pdm-result-card {
	display: flex;
	flex-direction: column;
	gap: 5.4px;
	padding: 14.4px 16.2px;
	border-left: 3px solid var(--c-blue, #008bbd);
	border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
	background: var(--c-white, #fff);
}

.pdm-result-card__classe {
	font-size: 14.4px;
	font-weight: 700;
	color: var(--c-ink, #0a2d4d);
}

.pdm-result-card__categoria { font-size: var(--fs-14, 13px); color: var(--c-svc-row-alt, #405669); }

.pdm-result-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 5.4px 14.4px;
	font-size: 11.25px;
	color: var(--c-muted-2, #6b7785);
}

.pdm-results__disclaimer {
	padding-top: 9px;
	border-top: 1px solid var(--c-svc-list-divider, rgba(10, 45, 77, 0.12));
	font-size: 11.25px;
	line-height: 17.55px;
	color: var(--c-muted-2, #6b7785);
}

.pdm-results__disclaimer a { color: var(--c-blue, #008bbd); font-weight: 600; }

/* Leaflet — pequenos ajustes para caber na estética do site --------- */
.pdm-map .leaflet-control-zoom a {
	color: var(--c-ink, #0a2d4d);
	border-radius: var(--radius-sm, 6px) !important;
}

.pdm-map .leaflet-popup-content-wrapper { border-radius: var(--radius-md, 9px); }

.pdm-tooltip {
	border: 0 !important;
	border-radius: var(--radius-sm, 6px) !important;
	box-shadow: 0 7px 18px rgba(10, 45, 77, 0.18) !important;
	font-family: var(--font-base, inherit);
	font-size: 11.7px !important;
	line-height: 16.2px;
	color: var(--c-ink, #0a2d4d);
	padding: 7.2px 9.9px !important;
}

.pdm-tooltip::before { display: none !important; }

@media (max-width: 1024px) {
	.pdm-tool__grid { flex-direction: column; }
	.pdm-sidebar { width: 100%; flex: none; }
	.pdm-map { height: 468px; }
}

@media (max-width: 640px) {
	.pdm-map { height: 396px; }
	.pdm-search__form { flex-wrap: wrap; }
}
