/*
 * POS Area Map. Every colour/size is a CSS variable with a fallback here, so
 * Elementor's Style controls (which set the variables on the widget) and the
 * shortcode's height="" attribute (set on a parent) both work.
 */

/*
 * Site design tokens (2.3): Elementor's global colours and fonts from Site
 * Settings, so the maps and switcher follow the website. The hex values are
 * this site's own globals, used only if Elementor's variables are missing.
 * Any colour picked in a widget's Style tab still wins over these.
 */
.pos-area-map,
.pos-view-switcher,
.e-loop-item.pos-card-active {
	--pam-c-primary: var(--e-global-color-primary, #4668ed);
	--pam-c-dark: var(--e-global-color-28a4d7e, #06164c);
	--pam-c-text: var(--e-global-color-text, #17191c);
	--pam-c-muted: var(--e-global-color-660f7ec, #727d8d);
	--pam-c-border: var(--e-global-color-0bb25a7, #dfe1e8);
	--pam-c-soft: var(--e-global-color-2691857, #f5f9ff);
	--pam-w-strong: var(--e-global-typography-primary-font-weight, 600);
	--pam-w-medium: var(--e-global-typography-accent-font-weight, 500);
	--pam-w-normal: var(--e-global-typography-text-font-weight, 400);
}

/* Leaflet sets Helvetica on the map; use the site's font instead. */
.pos-area-map .leaflet-container {
	font-family: inherit;
	font-size: 13px;
}

.pos-area-map {
	font-family: inherit;
}

.pos-area-map__bar {
	display: flex;
	justify-content: var(--pam-button-align, flex-end);
	margin-bottom: 10px;
}

.pos-area-map__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 0;
	border-radius: 6px;
	background: var(--pam-button-bg, var(--pam-c-primary));
	color: var(--pam-button-text, #fff);
	font: inherit;
	font-size: 14px;
	font-weight: var(--pam-w-medium);
	line-height: 1.2;
	cursor: pointer;
}

.pos-area-map__toggle::before {
	content: "";
	width: 14px;
	height: 14px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4 9 2 3 4v18l6-2 6 2 6-2V2l-6 2Zm0 15.8-6-2V4.2l6 2v13.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4 9 2 3 4v18l6-2 6 2 6-2V2l-6 2Zm0 15.8-6-2V4.2l6 2v13.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pos-area-map__toggle:focus-visible {
	outline: 2px solid var(--pam-button-bg, var(--pam-c-primary));
	outline-offset: 2px;
}

.pos-area-map__canvas {
	position: relative;
	z-index: 0; /* keeps Leaflet's own z-indexes below sticky headers and menus */
	width: 100%;
	height: var(--pam-height, 480px);
	border-radius: var(--pam-radius, 10px);
	overflow: hidden;
	background: var(--pam-c-soft, #f5f9ff);
}

.pos-area-map--listing .pos-area-map__canvas {
	height: var(--pam-height, 360px);
}

.pos-area-map__canvas[hidden] {
	display: none;
}

.pos-area-map__note {
	margin: 8px 0 0;
	font-size: 13px;
	opacity: 0.75;
	font-weight: var(--pam-w-normal);
}

.pos-area-map__empty {
	display: grid;
	place-items: center;
	height: 100%;
	margin: 0;
	padding: 16px;
	text-align: center;
	opacity: 0.75;
}

.pos-area-map--placeholder {
	padding: 24px;
	border: 1px dashed var(--pam-c-border, #dfe1e8);
	border-radius: 8px;
	text-align: center;
	font-size: 14px;
}

/* Area circles: Leaflet sets stroke/fill as SVG attributes; CSS wins over those. */
.pos-area-map .pos-area-map__circle {
	stroke: var(--pam-circle, var(--pam-c-primary));
	fill: var(--pam-circle, var(--pam-c-primary));
	fill-opacity: var(--pam-circle-opacity, 0.15);
	stroke-width: 1.5px;
}

.pos-area-map .pos-area-map__cluster {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border: 3px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	background: var(--pam-cluster-bg, var(--pam-c-dark));
	color: var(--pam-cluster-text, #fff);
	font-weight: var(--pam-w-strong);
	font-size: 14px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.pos-area-map .pos-area-map__tag {
	display: inline-block;
	transform: translate(-50%, -50%);
	padding: 4px 8px;
	border-radius: 999px;
	background: var(--pam-tag-bg, #fff);
	color: var(--pam-tag-text, var(--pam-c-dark));
	border: 1px solid currentColor;
	font-weight: var(--pam-w-strong);
	font-size: 12px;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.pos-area-map__notice {
	position: absolute;
	z-index: 1000; /* above Leaflet's panes, inside the map's own stacking context */
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	max-width: calc(100% - 24px);
	padding: 8px 14px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	font-size: 14px;
	text-align: center;
	pointer-events: none;
	font-weight: var(--pam-w-normal);
}

.pos-area-map__notice[hidden] {
	display: none;
}

.pos-area-map.is-loading .pos-area-map__canvas {
	opacity: 0.6;
	transition: opacity 0.15s ease;
}

/* ===========================================================================
 * Highlighting: hovering a listing card lights up its area on the map, and
 * clicking an area on the map lights up its card.
 * ======================================================================== */

.pos-area-map .is-active .pos-area-map__tag {
	background: var(--pam-active, var(--pam-c-primary));
	border-color: var(--pam-active, var(--pam-c-primary));
	color: #fff;
	transform: translate(-50%, -50%) scale(1.15);
}

.pos-area-map .is-active .pos-area-map__cluster {
	background: var(--pam-active, var(--pam-c-primary));
}

.pos-area-map .pos-area-map__circle.is-active {
	stroke: var(--pam-c-dark);
	fill: var(--pam-active, var(--pam-c-primary));
	fill-opacity: 0.35;
	stroke-width: 2.5px;
}

.e-loop-item.pos-card-active {
	outline: 3px solid var(--pam-active, var(--pam-c-primary));
	outline-offset: 4px;
	border-radius: 8px;
}

/* ===========================================================================
 * View switcher buttons
 * ======================================================================== */

.pos-view-switcher {
	display: inline-flex;
	flex-wrap: wrap;
	max-width: 100%;
	padding: 3px;
	border: 1px solid var(--pam-c-border);
	border-radius: 8px;
	background: var(--pvs-bg, var(--pam-c-soft));
	gap: 2px;
}

.pos-view-switcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--pvs-text, var(--pam-c-text));
	font: inherit;
	font-size: 14px;
	font-weight: var(--pam-w-medium);
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
}

.pos-view-switcher__btn[aria-pressed="true"] {
	background: var(--pvs-active-bg, var(--pam-c-primary));
	color: var(--pvs-active-text, #fff);
}

.pos-view-switcher__btn:focus-visible {
	outline: 2px solid var(--pvs-active-bg, var(--pam-c-primary));
	outline-offset: 2px;
}

.pos-view-switcher__icon {
	width: 14px;
	height: 14px;
	background: currentColor;
	-webkit-mask: var(--pvs-icon) center / contain no-repeat;
	mask: var(--pvs-icon) center / contain no-repeat;
}

.pos-view-switcher__btn--split { --pvs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h8v16H3zM13 4h8v4h-8zm0 6h8v4h-8zm0 6h8v4h-8z'/%3E%3C/svg%3E"); }
.pos-view-switcher__btn--list { --pvs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h8v7H3zm10 0h8v7h-8zM3 13h8v7H3zm10 0h8v7h-8z'/%3E%3C/svg%3E"); }
.pos-view-switcher__btn--map { --pvs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4 9 2 3 4v18l6-2 6 2 6-2V2l-6 2Zm0 15.8-6-2V4.2l6 2v13.6Z'/%3E%3C/svg%3E"); }

/* No side-by-side on phones and tablets: List | Map only. */
@media (max-width: 1024px) {
	.pos-view-switcher__btn--split {
		display: none;
	}
}

/* ===========================================================================
 * Split layout. Built in Elementor: a container .pos-split with two columns,
 * .pos-split__map and .pos-split__list. The switcher sets data-pos-view on
 * .pos-split. !important is needed to win over Elementor's per-container
 * width/flex settings. A boxed Elementor container puts its children in an
 * .e-con-inner wrapper, so every rule covers both shapes.
 * ======================================================================== */

/* The map widget's own Show/Hide button is replaced by the switcher. */
.pos-split .pos-area-map__bar {
	display: none;
}

.pos-split .pos-area-map {
	--pam-height: calc(100vh - var(--pos-split-top, 16px) - 16px);
}

.pos-split[data-pos-view],
.pos-split[data-pos-view] > .e-con-inner {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: flex-start !important;
	gap: var(--pos-split-gap, 24px) !important;
}

.pos-split > .e-con-inner {
	width: 100%;
}

/* Desktop: Map + List side by side (also the look before the script runs). */
@media (min-width: 1025px) {
	.pos-split:not([data-pos-view]),
	.pos-split:not([data-pos-view]) > .e-con-inner,
	.pos-split[data-pos-view="split"],
	.pos-split[data-pos-view="split"] > .e-con-inner {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: flex-start !important;
		gap: var(--pos-split-gap, 24px) !important;
	}

	.pos-split:not([data-pos-view]) .pos-split__map,
	.pos-split[data-pos-view="split"] .pos-split__map {
		position: sticky !important;
		top: var(--pos-split-top, 16px);
		align-self: flex-start !important;
		flex: 0 0 calc(var(--pos-split-map, 50%) - var(--pos-split-gap, 24px) / 2) !important;
		width: calc(var(--pos-split-map, 50%) - var(--pos-split-gap, 24px) / 2) !important;
		max-width: none !important;
		z-index: 1;
	}

	.pos-split:not([data-pos-view]) .pos-split__list,
	.pos-split[data-pos-view="split"] .pos-split__list {
		flex: 1 1 0 !important;
		width: auto !important;
		min-width: 0 !important;
		max-width: none !important;
	}

	/* Listings in 2 columns next to the map (3 again in List view). */
	.pos-split:not([data-pos-view]) .pos-split__list .elementor-grid,
	.pos-split[data-pos-view="split"] .pos-split__list .elementor-grid {
		grid-template-columns: repeat(var(--pos-split-list-columns, 2), minmax(0, 1fr)) !important;
	}
}

/* Phones and tablets: one column; List until the visitor picks Map. */
@media (max-width: 1024px) {
	.pos-split,
	.pos-split > .e-con-inner {
		flex-direction: column !important;
	}

	.pos-split:not([data-pos-view]) .pos-split__map,
	.pos-split[data-pos-view="split"] .pos-split__map {
		display: none !important;
	}

	.pos-split .pos-area-map {
		--pam-height: calc(100vh - var(--pos-split-top, 16px) - 32px);
	}
}

/* List only */
.pos-split[data-pos-view="list"] .pos-split__map {
	display: none !important;
}

/* Map only */
.pos-split[data-pos-view="map"] .pos-split__list {
	display: none !important;
}

.pos-split[data-pos-view="list"] .pos-split__list,
.pos-split[data-pos-view="map"] .pos-split__map,
.pos-split[data-pos-view="split"] .pos-split__list {
	min-width: 0 !important;
}

.pos-split[data-pos-view="list"] .pos-split__list,
.pos-split[data-pos-view="map"] .pos-split__map {
	flex: 1 1 100% !important;
	width: 100% !important;
	max-width: none !important;
	position: static !important;
}

/* ===========================================================================
 * Theme-proofing (2.2.1): Hello Elementor styles every button
 * ([type=button], button { border; border-radius; :hover background }) with
 * the same specificity as a single class, and loads after this file. Two
 * classes here so the plugin's buttons keep their own look.
 * ======================================================================== */

.pos-view-switcher .pos-view-switcher__btn,
.pos-area-map .pos-area-map__toggle {
	border: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
}

.pos-view-switcher .pos-view-switcher__btn {
	border-radius: 6px;
	background: transparent;
	color: var(--pvs-text, var(--pam-c-text));
}

.pos-view-switcher .pos-view-switcher__btn:hover,
.pos-view-switcher .pos-view-switcher__btn:focus {
	background: rgba(70, 104, 237, 0.1);
	background: color-mix(in srgb, var(--pvs-active-bg, var(--pam-c-primary)) 10%, transparent);
	color: var(--pvs-active-bg, var(--pam-c-primary));
}

.pos-view-switcher .pos-view-switcher__btn[aria-pressed="true"],
.pos-view-switcher .pos-view-switcher__btn[aria-pressed="true"]:hover,
.pos-view-switcher .pos-view-switcher__btn[aria-pressed="true"]:focus {
	background: var(--pvs-active-bg, var(--pam-c-primary));
	color: var(--pvs-active-text, #fff);
}

.pos-area-map .pos-area-map__toggle {
	border-radius: 6px;
	background: var(--pam-button-bg, var(--pam-c-primary));
	color: var(--pam-button-text, #fff);
	font-weight: var(--pam-w-medium);
}

.pos-area-map .pos-area-map__toggle:hover,
.pos-area-map .pos-area-map__toggle:focus {
	background: var(--pam-button-hover-bg, var(--pam-c-dark));
	color: var(--pam-button-text, #fff);
}

/* ===========================================================================
 * Listing card in the map popup (2.4). Matches the grid cards: photo on top,
 * price, "Type in City", icon facts, and a primary "View details" button.
 * Two-class selectors so the theme's link/button styles don't leak in.
 * ======================================================================== */

.pos-area-map .pam-popup .leaflet-popup-content-wrapper {
	padding: 0;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	color: var(--pam-c-text);
	box-shadow: 0 12px 32px rgba(6, 22, 76, 0.18), 0 2px 6px rgba(6, 22, 76, 0.08);
}

.pos-area-map .pam-popup .leaflet-popup-content {
	width: 260px !important;
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
}

.pos-area-map .pam-popup .leaflet-popup-tip {
	box-shadow: 0 6px 14px rgba(6, 22, 76, 0.12);
}

/* Close: a white circle over the photo instead of Leaflet's bare "x". */
.pos-area-map .pam-popup a.leaflet-popup-close-button {
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 30px;
	height: 30px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 2px 8px rgba(6, 22, 76, 0.2);
	color: var(--pam-c-text);
	font-size: 0;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.pos-area-map .pam-popup a.leaflet-popup-close-button span {
	display: none;
}

.pos-area-map .pam-popup a.leaflet-popup-close-button::before {
	content: "";
	position: absolute;
	inset: 8px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.4 5 12 10.6 17.6 5 19 6.4 13.4 12 19 17.6 17.6 19 12 13.4 6.4 19 5 17.6 10.6 12 5 6.4 6.4 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.4 5 12 10.6 17.6 5 19 6.4 13.4 12 19 17.6 17.6 19 12 13.4 6.4 19 5 17.6 10.6 12 5 6.4 6.4 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pos-area-map .pam-popup a.leaflet-popup-close-button:hover,
.pos-area-map .pam-popup a.leaflet-popup-close-button:focus-visible {
	background: var(--pam-c-primary);
	color: #fff;
}

.pos-area-map .pam-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--pam-c-soft);
	overflow: hidden;
}

.pos-area-map .pam-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.pos-area-map .pam-card__media:hover img {
	transform: scale(1.04);
}

.pos-area-map .pam-card__noimg {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 44px;
	height: 44px;
	background: var(--pam-c-border);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 11h3v9h5v-6h4v6h5v-9h3L12 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 11h3v9h5v-6h4v6h5v-9h3L12 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pos-area-map .pam-card__badge {
	position: absolute;
	left: 10px;
	bottom: 10px;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(6, 22, 76, 0.78);
	color: #fff;
	font-size: 11px;
	font-weight: var(--pam-w-medium);
	letter-spacing: 0.02em;
}

.pos-area-map .pam-card__body {
	padding: 14px 16px 16px;
}

.pos-area-map .pam-card__price {
	color: var(--pam-c-text);
	font-size: 20px;
	font-weight: var(--pam-w-strong);
	line-height: 1.2;
}

.pos-area-map .pam-card__title {
	margin-top: 4px;
	color: var(--pam-c-muted);
	font-size: 14px;
	font-weight: var(--pam-w-normal);
}

.pos-area-map .pam-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 12px 0 0;
	padding: 12px 0 0;
	border-top: 1px solid var(--pam-c-border);
	list-style: none;
}

.pos-area-map .pam-card__fact {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: var(--pam-c-text);
	font-size: 13px;
	font-weight: var(--pam-w-medium);
}

.pos-area-map .pam-card__icon {
	width: 16px;
	height: 16px;
	flex: none;
	background: var(--pam-c-primary);
	-webkit-mask: var(--pam-icon) center / contain no-repeat;
	mask: var(--pam-icon) center / contain no-repeat;
}

.pos-area-map .pam-card__fact--bed { --pam-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a1 1 0 0 1 2 0v6h6V8a1 1 0 0 1 1-1h7a3 3 0 0 1 3 3v8a1 1 0 0 1-2 0v-2H5v2a1 1 0 0 1-2 0V6Zm4 1.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z'/%3E%3C/svg%3E"); }
.pos-area-map .pam-card__fact--bath { --pam-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4a3 3 0 0 1 3 3h-2a1 1 0 0 0-2 0v5h16v2a6 6 0 0 1-3 5.2V21h-2v-1.1a6 6 0 0 1-1 .1H8a6 6 0 0 1-1-.1V21H5v-1.8A6 6 0 0 1 2 14v-2h2V7a3 3 0 0 1 3-3Z'/%3E%3C/svg%3E"); }
.pos-area-map .pam-card__fact--area { --pam-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h7v2H6.4l4.3 4.3-1.4 1.4L5 6.4V10H3V3Zm18 0v7h-2V6.4l-4.3 4.3-1.4-1.4L17.6 5H14V3h7ZM3 21v-7h2v3.6l4.3-4.3 1.4 1.4L6.4 19H10v2H3Zm18 0h-7v-2h3.6l-4.3-4.3 1.4-1.4 4.3 4.3V14h2v7Z'/%3E%3C/svg%3E"); }

.pos-area-map a.pam-card__cta {
	display: block;
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: 8px;
	background: var(--pam-c-primary);
	color: #fff;
	font-size: 14px;
	font-weight: var(--pam-w-medium);
	text-align: center;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.pos-area-map a.pam-card__cta:hover,
.pos-area-map a.pam-card__cta:focus-visible {
	background: var(--pam-c-dark);
	color: #fff;
}

/* ===========================================================================
 * Toolbar row (2.4.1): the "Showing 1-15 of 37 listings" count and the view
 * switcher side by side. Elementor gives every widget but the last in a
 * container a bottom margin (widget spacing), which pushed the count above
 * the switcher's centre line. Remove it in the switcher's row only, centre
 * everything, and keep the switcher at the filter fields' height.
 * ======================================================================== */

.e-con:has(> .elementor-widget-pos_view_switcher),
.e-con-inner:has(> .elementor-widget-pos_view_switcher) {
	align-items: center !important;
	column-gap: 24px;
	row-gap: 12px;
}

.e-con:has(> .elementor-widget-pos_view_switcher) > .elementor-widget,
.e-con-inner:has(> .elementor-widget-pos_view_switcher) > .elementor-widget {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.e-con:has(> .elementor-widget-pos_view_switcher) .elementor-heading-title,
.e-con-inner:has(> .elementor-widget-pos_view_switcher) .elementor-heading-title {
	margin: 0;
	line-height: 1.4;
}

.elementor-widget-pos_view_switcher {
	margin-left: auto;
}

.pos-view-switcher {
	align-items: center;
	padding: 4px;
	border-radius: 10px;
}

.pos-view-switcher .pos-view-switcher__btn {
	min-height: 36px;
	padding: 6px 14px;
	border-radius: 7px;
	font-size: 15px;
	line-height: 1;
}

@media (max-width: 767px) {
	.pos-view-switcher .pos-view-switcher__btn {
		padding: 6px 12px;
		font-size: 14px;
	}
}
