/*
 * Search results map browser.
 *
 * The map belongs to the marketplace plugin because its markers, result
 * roster and coordinate positioning are driven by property data.
 */

.srm-map-panel {
	min-width: 0;
}

.srm-map-browser {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 292px;
	gap: 16px;
	min-width: 0;
}

.srm-map-canvas {
	position: sticky;
	top: 96px;
	height: min(900px, calc(100vh - 100px));
	min-height: 640px;
	overflow: hidden;
	border: 1px solid rgba(29, 40, 51, .1);
	border-radius: 20px;
	background:
		linear-gradient(135deg, rgba(255, 255, 255, .48), rgba(255, 255, 255, .08)),
		#dce7e2;
	box-shadow: 0 18px 48px rgba(29, 40, 51, .12);
}

.srm-map-canvas::before {
	position: absolute;
	z-index: 1;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(29, 40, 51, .06));
	content: "";
}

.srm-map-base {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	filter: saturate(.78) contrast(.94);
	pointer-events: none;
}

.srm-map-label {
	top: 16px;
	left: 16px;
	z-index: 30;
	grid-template-columns: 38px minmax(0, 1fr) auto;
	align-items: center;
	gap: 2px 10px;
	max-width: calc(100% - 32px);
	padding: 12px 14px;
	border: 1px solid rgba(29, 40, 51, .08);
	border-radius: 14px;
	background: rgba(255, 255, 255, .96);
	box-shadow: 0 14px 34px rgba(29, 40, 51, .14);
	backdrop-filter: blur(12px);
}

.srm-map-label > span {
	display: grid;
	grid-row: 1 / 3;
	grid-column: 1;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: var(--srm-brand-soft);
	color: var(--srm-brand);
}

.srm-map-label > span .srm-icon {
	width: 18px;
	height: 18px;
}

.srm-map-label strong,
.srm-map-label small {
	grid-column: 2;
	min-width: 0;
}

.srm-map-label small {
	font-size: 11px;
	line-height: 1.4;
}

.srm-map-open {
	grid-row: 1 / 3;
	grid-column: 3;
	padding: 8px 10px;
	border: 1px solid var(--srm-line);
	border-radius: 10px;
	color: var(--srm-ink);
	font-size: 11px;
	font-weight: 750;
	text-decoration: none;
	white-space: nowrap;
}

.srm-map-open:hover,
.srm-map-open:focus-visible {
	border-color: var(--srm-brand);
	color: var(--srm-brand-dark);
}

.srm-map-markers {
	position: absolute;
	z-index: 10;
	inset: 0;
}

.srm-map-canvas .srm-map-marker {
	top: var(--srm-map-top);
	left: var(--srm-map-left);
	display: block;
	padding: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	transform: translate(-50%, -50%) translate(var(--srm-map-shift-x, 0), var(--srm-map-shift-y, 0));
}

.srm-map-marker-price {
	display: block;
	padding: 7px 10px;
	border: 1px solid rgba(29, 40, 51, .12);
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(29, 40, 51, .2);
	color: var(--srm-ink);
	font-size: 10px;
	font-weight: 850;
	line-height: 1;
	white-space: nowrap;
	transition: transform .18s ease, background .18s ease, color .18s ease;
}

.srm-map-canvas .srm-map-marker:hover,
.srm-map-canvas .srm-map-marker:focus-visible,
.srm-map-canvas .srm-map-marker.is-active {
	z-index: 40;
	background: transparent;
	outline: 0;
}

.srm-map-marker:hover .srm-map-marker-price,
.srm-map-marker:focus-visible .srm-map-marker-price,
.srm-map-marker.is-active .srm-map-marker-price {
	background: var(--srm-ink);
	color: #fff;
	transform: translateY(-2px);
}

.srm-map-marker-card {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	display: grid;
	grid-template-columns: 62px minmax(0, 1fr);
	width: 236px;
	min-height: 76px;
	overflow: hidden;
	border: 1px solid rgba(29, 40, 51, .1);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 44px rgba(29, 40, 51, .2);
	color: var(--srm-ink);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 8px);
	transition: opacity .18s ease, transform .18s ease;
}

.srm-map-marker:hover .srm-map-marker-card,
.srm-map-marker:focus-visible .srm-map-marker-card,
.srm-map-marker.is-active .srm-map-marker-card {
	opacity: 1;
	transform: translate(-50%, 0);
}

.srm-map-marker-media {
	display: block;
	min-height: 76px;
	background: linear-gradient(145deg, var(--srm-brand-soft), #eadfda);
}

.srm-map-marker-media img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 76px;
	object-fit: cover;
}

.srm-map-marker-copy {
	display: grid;
	align-content: center;
	gap: 3px;
	min-width: 0;
	padding: 9px 10px;
}

.srm-map-marker-copy strong,
.srm-map-marker-copy small,
.srm-map-marker-copy b {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.srm-map-marker-copy strong {
	font-size: 11px;
}

.srm-map-marker-copy small {
	color: var(--srm-ink-soft);
	font-size: 9px;
}

.srm-map-marker-copy b {
	color: var(--srm-brand-dark);
	font-size: 10px;
}

.srm-map-roster {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	min-width: 0;
	max-height: min(900px, calc(100vh - 100px));
	overflow: hidden;
	border: 1px solid var(--srm-line);
	border-radius: 20px;
	background: #fff;
	box-shadow: var(--srm-shadow-sm);
}

.srm-map-roster-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px;
	border-bottom: 1px solid var(--srm-line);
}

.srm-map-roster-header strong {
	font-size: 13px;
}

.srm-map-roster-header small {
	padding: 5px 8px;
	border-radius: 999px;
	background: var(--srm-brand-soft);
	color: var(--srm-brand-dark);
	font-size: 10px;
	font-weight: 750;
	white-space: nowrap;
}

.srm-map-roster-list {
	overflow: auto;
	padding: 8px;
	scrollbar-width: thin;
}

.srm-map-roster-item {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 9px 8px;
	border-radius: 12px;
	color: var(--srm-ink);
	text-decoration: none;
	transition: background .18s ease, transform .18s ease;
}

.srm-map-roster-item:hover,
.srm-map-roster-item:focus-visible,
.srm-map-roster-item.is-active {
	background: var(--srm-brand-soft);
	outline: 0;
	transform: translateX(2px);
}

.srm-map-roster-thumb {
	display: block;
	width: 44px;
	height: 44px;
	overflow: hidden;
	border-radius: 11px;
	background: #efe7e3;
}

.srm-map-roster-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.srm-map-roster-copy {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.srm-map-roster-copy strong,
.srm-map-roster-copy small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.srm-map-roster-copy strong {
	font-size: 11px;
}

.srm-map-roster-copy small {
	color: var(--srm-ink-soft);
	font-size: 9px;
}

.srm-map-roster-price {
	color: var(--srm-ink);
	font-size: 10px;
	font-weight: 800;
	white-space: nowrap;
}

.srm-map-empty {
	display: grid;
	place-items: center;
	height: 100%;
	padding: 32px;
	text-align: center;
}

@media (max-width: 1180px) {
	.srm-map-browser {
		grid-template-columns: 1fr;
	}

	.srm-map-canvas {
		position: relative;
		top: auto;
		height: 600px;
	}

	.srm-map-roster {
		max-height: none;
	}

	.srm-map-roster-list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-height: 360px;
	}
}

@media (max-width: 620px) {
	.srm-map-canvas {
		height: 520px;
		min-height: 520px;
		border-radius: 16px;
	}

	.srm-map-label {
		grid-template-columns: 34px minmax(0, 1fr);
	}

	.srm-map-label > span {
		width: 34px;
		height: 34px;
	}

	.srm-map-open {
		display: none;
	}

	.srm-map-marker-price {
		padding: 6px 8px;
		font-size: 9px;
	}

	.srm-map-marker-card {
		display: none;
	}

	.srm-map-roster-list {
		grid-template-columns: 1fr;
		max-height: 390px;
	}
}
