/**
 * HouseList SaaS — map styles.
 * Shared by the single-listing map and the Discover map view, and by both
 * providers (Leaflet and Google Maps).
 */

/* ── Containers ─────────────────────────────────────────────────────────── */

.houselist-map {
	height: 320px;
	border-radius: var(--hl-radius-lg, 12px);
	overflow: hidden;
	border: 1px solid var(--hl-gray-200, #e5e7eb);
	background: var(--hl-gray-100, #f3f4f6);
}

.houselist-map__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 1.5rem;
	text-align: center;
	color: var(--hl-gray-500, #6b7280);
	font-size: 0.9rem;
}

/* Discover map view: taller, and sticky so it stays put while the page scrolls. */
.houselist-results-map {
	display: none;
	height: min(72vh, 680px);
	margin-bottom: 1.25rem;
}

.houselist-results-map.is-active {
	display: block;
}

/* When the map view is on, the card grid is hidden. */
.houselist-listings-grid[data-view="map"] {
	display: none;
}

.houselist-map-note {
	margin: 0.5rem 0 0;
	font-size: 0.8rem;
	color: var(--hl-gray-500, #6b7280);
}

/* ── Marker pin (Leaflet divIcon) ───────────────────────────────────────── */

.houselist-map-pin {
	background: none;
	border: 0;
}

.houselist-map-pin svg {
	display: block;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

/* ── Popup card ─────────────────────────────────────────────────────────── */

.houselist-map-pop {
	width: 210px;
	font-family: var(--hl-font, 'Plus Jakarta Sans', sans-serif);
}

.houselist-map-pop__media {
	display: block;
	line-height: 0;
}

.houselist-map-pop__media img {
	width: 100%;
	height: 110px;
	object-fit: cover;
	border-radius: 8px;
}

.houselist-map-pop__body {
	padding: 8px 2px 2px;
}

.houselist-map-pop__type {
	display: inline-block;
	margin-bottom: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--hl-primary-soft, rgba(15, 118, 110, 0.1));
	color: var(--hl-primary, #0f766e);
	font-size: 0.68rem;
	font-weight: 600;
}

.houselist-map-pop__title {
	display: block;
	margin-bottom: 2px;
	color: var(--hl-gray-900, #111827);
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.houselist-map-pop__title:hover {
	color: var(--hl-primary, #0f766e);
}

.houselist-map-pop__price {
	color: var(--hl-primary, #0f766e);
	font-size: 0.95rem;
	font-weight: 700;
}

.houselist-map-pop__meta {
	margin-top: 2px;
	color: var(--hl-gray-500, #6b7280);
	font-size: 0.75rem;
}

.houselist-map-pop__link {
	display: inline-block;
	margin-top: 6px;
	color: var(--hl-primary, #0f766e);
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
}

.houselist-map-pop__link:hover {
	text-decoration: underline;
}

/* Leaflet's default popup chrome, trimmed to match the card. */
.leaflet-popup-content-wrapper {
	border-radius: 12px;
	padding: 6px;
}

.leaflet-popup-content {
	margin: 6px;
}

/* Google's InfoWindow already supplies padding; drop ours to avoid doubling. */
.gm-style .houselist-map-pop {
	width: 200px;
}

@media (max-width: 782px) {
	.houselist-results-map {
		height: min(60vh, 460px);
	}
}
