/* Preserve Lot Map */

/* Match the site branding (schillingdevelopment.com): Poppins type + the
   blue->navy .fl-button used across the theme. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

.plm-map-wrap {
	position: relative;
	background: #fff;
	border-radius: 8px;
	/* Brand tokens — buttons/links inside the map (popups + legend) inherit these. */
	--plm-brand: #1971b5;       /* primary button blue */
	--plm-brand-dark: #1b335c;  /* navy (button hover) */
	--plm-accent: #a01231;      /* crimson accent */
	--plm-ink: #414042;         /* body/heading ink */
	--plm-font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.plm-map {
	width: 100%;
	background: #fff;
	border-radius: 8px;
	z-index: 0;
}

/* ---------------- Loading spinner ---------------- */

.plm-loading {
	position: absolute;
	inset: 0;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(233, 239, 228, 0.6);
	border-radius: 8px;
	transition: opacity 0.3s;
	pointer-events: none;
}

.plm-loading--done {
	opacity: 0;
	visibility: hidden;
}

.plm-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid rgba(46, 125, 50, 0.25);
	border-top-color: #2e7d32;
	border-radius: 50%;
	animation: plm-spin 0.8s linear infinite;
}

@keyframes plm-spin {
	to { transform: rotate(360deg); }
}

/* ---------------- Pins ---------------- */

.plm-pin-anchor {
	background: none;
	border: none;
}

.plm-pin {
	--plm-size: 30px;
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
	width: var(--plm-size);
	height: var(--plm-size);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font: 700 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #fff;
	border: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	box-sizing: border-box;
	transition: width 0.15s, height 0.15s;
	cursor: pointer;
}

.plm-pin--open      { background: #2e7d32; }
.plm-pin--schilling { background: #1971b5; }
.plm-pin--builder   { background: #7fb8e0; }
.plm-pin--pending   { background: #f2b705; color: #3d3000; }
.plm-pin--sold      { background: #9aa0a6; }
.plm-pin--none      { background: #9aa0a6; }

.plm-pin--open:hover { background: #1b5e20; }

/* Zoom bands: dots when far out, numbered badges up close */
.plm-map[data-plm-band="far"] .plm-pin {
	--plm-size: 10px;
	border-width: 1px;
}

.plm-map[data-plm-band="far"] .plm-pin span {
	display: none;
}

.plm-map[data-plm-band="mid"] .plm-pin {
	--plm-size: 18px;
	font-size: 8px;
}

.plm-map[data-plm-band="near"] .plm-pin {
	--plm-size: 32px;
}

/* ---------------- Lot parcels (GIS-style fill overlay) ---------------- */

/* Fill / stroke / opacity / weight ALL come from JS as SVG presentation
   attributes (Leaflet setStyle). Deliberately NO CSS transition here: when a
   transition is declared on a property whose value comes from a presentation
   attribute, Chrome stops reflecting later setAttribute changes into the
   rendered value — which silently broke hover and the filter's grey-muting.
   Transition-free = every setStyle update applies. */

.plm-lot--open,
.plm-lot--pending {
	cursor: pointer;
}

/* Sold / unlisted parcels open no listing (tooltip only), so override
   Leaflet's default interactive pointer cursor — only available inventory
   reads as clickable. */
.plm-lot--sold,
.plm-lot--none {
	cursor: default;
}

/* Flat lot-number label centered on the parcel; clicks fall through. */
.plm-lot-label {
	background: none;
	border: none;
	pointer-events: none;
}

.plm-lot-label span {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
	white-space: nowrap;
	font: 700 12px/1 Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #fff;
	text-shadow: 0 0 2px rgba(0, 0, 0, 0.85), 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Match the pin zoom bands: hide numbers when far out, scale up close. */
.plm-map[data-plm-band="far"] .plm-lot-label {
	display: none;
}

.plm-map[data-plm-band="mid"] .plm-lot-label span {
	font-size: 9px;
}

.plm-map[data-plm-band="near"] .plm-lot-label span {
	font-size: 13px;
}

/* ---------------- Site-plan basemap ---------------- */

/* The vector "Site plan" base is the default. Its land/road/water/common fills
   come from JS; here we only set the neutral page behind them so the area
   OUTSIDE the development reads as blank canvas (not white tiles). When a tile
   base (Aerial/Streets) is selected, the class is removed and the tiles cover
   the canvas again. */
.plm-map.plm-base-siteplan,
.plm-map.plm-base-siteplan .leaflet-container {
	background: #f6f7f4;
}

/* Rotated street-name label sitting on the road ribbons. Dark ink (roads are
   light), centered + rotated via the inline transform set in JS. */
.plm-street-label {
	background: none;
	border: none;
	pointer-events: none;
}

.plm-street-label span {
	position: absolute;
	left: 0;
	top: 0;
	white-space: nowrap;
	font: 600 11px/1 Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: 0.04em;
	color: #5b6b50;
	text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}

/* Match the lot-number zoom bands: hide street names when far out. */
.plm-map[data-plm-band="far"] .plm-street-label {
	display: none;
}

.plm-map[data-plm-band="mid"] .plm-street-label span {
	font-size: 9px;
}

/* ---------------- Popup card ---------------- */

.plm-popup .leaflet-popup-content {
	margin: 0;
	width: 250px !important;
}

.plm-popup .leaflet-popup-content-wrapper {
	padding: 0;
	overflow: hidden;
	border-radius: 10px;
}

.plm-card-thumb img {
	display: block;
	width: 100%;
	height: 130px;
	object-fit: cover;
}

.plm-card-body {
	padding: 12px 14px 14px;
	font-family: var(--plm-font);
	color: var(--plm-ink);
}

.plm-card-title {
	font-family: var(--plm-font);
	font-size: 18px;
	font-weight: 700;
	color: var(--plm-brand-dark);
	margin-bottom: 4px;
}

/* List price (Schilling / non-builder lots). */
.plm-card-price {
	font-size: 20px;
	font-weight: 700;
	color: var(--plm-brand-dark);
	margin: 8px 0 2px;
}

/* "Contact Builder for Pricing" / "Contact Schilling Development" — shown in place
   of a price for builder lots (and Schilling lots with no price entered). */
.plm-card-contact {
	font-size: 14px;
	font-weight: 600;
	color: var(--plm-brand);
	margin: 8px 0 2px;
}

.plm-card-features {
	font-size: 12px;
	color: #6b6b6d;
	margin: 6px 0 2px;
}

.plm-card-btn {
	display: block;
	margin-top: 10px;
	padding: 10px 12px;
	background: var(--plm-brand);
	color: #fff !important;
	text-align: center;
	border-radius: 4px;
	font-family: var(--plm-font);
	font-weight: 700;
	font-size: 15px;
	text-transform: capitalize;
	text-decoration: none !important;
	transition: background 0.15s;
}

.plm-card-btn:hover {
	background: var(--plm-brand-dark);
}

/* ---------------- Chips / legend ---------------- */

.plm-chip {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* The popup status badge (e.g. "Contact Developer" / "Contact Builder" /
   "Spec House") uses the site's brand blue, white text — not the green
   availability color. */
.plm-chip-open    { background: var(--plm-brand); }
.plm-chip-pending { background: #f2b705; color: #3d3000; }
.plm-chip-sold    { background: #c62828; }

.plm-legend {
	background: rgba(255, 255, 255, 0.94);
	border-radius: 8px;
	padding: 7px 12px;
	font-family: var(--plm-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	color: var(--plm-ink);
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	align-items: center;
}

/* The For Sale / Pending / Sold color key, left of the Export Map button. */
.plm-legend-key {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 12px;
}

.plm-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.plm-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	display: inline-block;
}

/* Styled to match the site's .fl-button (Poppins 700, blue -> navy on hover). */
.plm-legend-link {
	display: inline-block;
	margin-left: 2px;
	padding: 5px 12px;
	background: var(--plm-brand);
	color: #fff !important;
	font-family: var(--plm-font);
	font-weight: 700;
	font-size: 11px;
	line-height: 1.4;
	text-transform: capitalize;
	text-decoration: none !important;
	border-radius: 4px;
	transition: background 0.15s;
}

.plm-legend-link:hover {
	background: var(--plm-brand-dark);
	color: #fff !important;
}

/* "Show:" prefix so it's clear the chips are filter controls. */
.plm-legend-label {
	font-family: var(--plm-font);
	font-size: 12px;
	font-weight: 700;
	color: var(--plm-ink);
	margin-right: 1px;
}

/* Filter rows: a checkbox + color dot + status label. */
.plm-filter {
	margin: 0;
	padding: 3px 4px;
	display: flex;
	align-items: center;
	gap: 7px;
	font-family: var(--plm-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--plm-ink);
	cursor: pointer;
}

.plm-filter:hover { color: var(--plm-brand); }

.plm-filter-cb {
	margin: 0;
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
	accent-color: var(--plm-brand);
	cursor: pointer;
}

/* The per-type count, e.g. "Schilling Development Lot (96)" — muted/lighter. */
.plm-filter-count {
	color: #6b7178;
	font-weight: 600;
}

/* ---- Top-right Filter dropdown ---- */
.plm-filterbox {
	position: relative;
	font-family: var(--plm-font);
}

.plm-filter-toggle {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	background: rgba(255, 255, 255, 0.95);
	border: 0;
	border-radius: 8px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
	font-family: var(--plm-font);
	font-size: 13px;
	font-weight: 700;
	color: var(--plm-ink);
	cursor: pointer;
}

.plm-filter-toggle:hover { color: var(--plm-brand); }
.plm-filterbox.is-open .plm-caret { transform: rotate(180deg); }
.plm-caret { display: inline-block; transition: transform 0.15s; font-size: 10px; }

/* The panel drops down below the button, right-aligned. */
.plm-filter-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 168px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px;
	background: rgba(255, 255, 255, 0.98);
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.plm-filter-panel[hidden] { display: none; }

.plm-filter-panel-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7178;
	margin-bottom: 2px;
}

/* Stack the status toggles full-width inside the panel. */
.plm-filter-panel .plm-filter {
	width: 100%;
	justify-content: flex-start;
	border-radius: 6px;
}

/* "Export PDF" reuses the blue button look; it's a <button>, so clear chrome. */
.plm-export {
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	cursor: pointer;
}

.plm-export[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* "All Listings" as a lighter outline button so the primary Export stands out. */
.plm-legend-link--ghost {
	background: #fff;
	color: var(--plm-brand) !important;
	border: 1px solid var(--plm-brand);
}

.plm-legend-link--ghost:hover {
	background: #eef4fa;
	color: var(--plm-brand-dark) !important;
}

/* Per-property-status filters: toggling a status OFF greys out its parcels (kept
   visible as context) and makes them inert. The grey recolor + muted opacity/
   weight are applied in JS (muteFilteredParcels via Leaflet setStyle); JS also
   adds the slug-agnostic .plm-lot--muted class, which CSS uses to drop pointer
   events (so the greyed lot can't be clicked/hovered). pointer-events isn't a
   presentation attribute, so this override is reliable. Lot-number labels are
   NOT hidden — every lot keeps its number. Sold + unlisted have no toggle. */
.plm-lot--muted {
	pointer-events: none !important;
	cursor: default !important;
}

/* Transient message (export errors / not-ready), centered over the map. */
.plm-toast {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translate(-50%, 8px);
	z-index: 1200;
	max-width: 80%;
	background: rgba(27, 51, 92, 0.95);
	color: #fff;
	font-family: var(--plm-font);
	font-size: 13px;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
}

.plm-toast--show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------------- Admin editor ---------------- */

.plm-editor {
	display: flex;
	gap: 16px;
	align-items: stretch;
	margin-top: 10px;
}

.plm-admin-map {
	flex: 1;
	min-width: 0;
	height: 750px;
	border: 1px solid #c3c4c7;
}

.plm-editor-side {
	width: 290px;
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: 750px;
	overflow-y: auto;
}

.plm-side-box {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 10px 12px;
}

.plm-side-row {
	display: flex;
	gap: 6px;
	margin-top: 6px;
}

.plm-side-row input {
	flex: 1;
}

.plm-queue {
	margin: 8px 0 0;
	max-height: 200px;
	overflow-y: auto;
	border-top: 1px solid #eee;
}

.plm-queue li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 4px 6px;
	margin: 0;
	border-bottom: 1px solid #f0f0f1;
	cursor: pointer;
	font-size: 13px;
}

.plm-queue li:hover {
	background: #f0f6fc;
}

.plm-queue li.plm-selected {
	background: #2271b1;
	color: #fff;
}

.plm-armed {
	margin-top: 8px;
	padding: 7px 10px;
	background: #fff8e5;
	border: 1px solid #dba617;
	border-radius: 4px;
	font-weight: 600;
}

.plm-save-status {
	margin-left: 8px;
	font-weight: 600;
}

.plm-save-status.ok    { color: #00a32a; }
.plm-save-status.err   { color: #d63638; }
.plm-save-status.dirty { color: #996800; }

@media (max-width: 1100px) {
	.plm-editor {
		flex-direction: column;
	}

	.plm-editor-side {
		width: auto;
		max-height: none;
	}
}
