/*
 * SPW AI Property Search: map slide-in property panel.
 * Only affects Bricks Map elements with the CSS class "spw-map-panel".
 */

/* Hide the marker's own info box. It still opens and loads by AJAX as normal;
   map-panel.js copies its content into the panel. Collapsing its height means
   Bricks' pan-on-open simply centres the clicked marker. */
.spw-map-panel .brx-infobox-popup,
.spw-map-panel .infoBox,
.spw-map-panel .gm-style-iw-a,
.spw-map-panel .gm-style-iw-t,
.spw-map-panel .gm-style-iw-c,
.spw-map-panel .gm-style-iw-d,
.spw-map-panel .gm-style-iw-chr,
.spw-map-panel .gm-style-iw-tc {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	height: 0 !important;
	min-height: 0 !important;
	overflow: hidden !important;
}

/* Sits exactly over the map (placed by map-panel.js) and clips the sheet. */
.spw-map-panel__frame {
	position: absolute;
	z-index: 10; /* above Google's map controls, below site headers and popups */
	overflow: hidden;
	pointer-events: none;
}

.spw-map-panel__sheet {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(400px, 100%);
	display: flex;
	flex-direction: column;
	background: var(--white);
	box-shadow: -0.25rem 0 1.5rem color-mix(in srgb, var(--black) 18%, transparent);
	transform: translateX(100%);
	visibility: hidden;
	transition: transform 300ms ease, visibility 0s linear 300ms;
	pointer-events: auto;
}

.spw-map-panel__frame.is-open .spw-map-panel__sheet {
	transform: translateX(0);
	visibility: visible;
	transition: transform 300ms ease, visibility 0s;
}

.spw-map-panel__bar {
	display: flex;
	justify-content: flex-end;
	flex: none;
	padding: var(--space-s) var(--space-s) 0;
	background: var(--white);
}

.spw-map-panel__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5em;
	height: 2.5em;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--white);
	color: var(--primary);
	font-size: inherit;
	line-height: 1;
	cursor: pointer;
}

.spw-map-panel__close svg {
	width: 1.5em;
	height: 1.5em;
}

.spw-map-panel__close:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* The card keeps its own spl- styling; it only fills the width and scrolls. */
.spw-map-panel__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: var(--space-s);
}

.spw-map-panel__body > * {
	width: 100%;
	max-width: 100%;
}

@media (max-width: 767px) {
	.spw-map-panel__sheet {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spw-map-panel__sheet,
	.spw-map-panel__frame.is-open .spw-map-panel__sheet {
		transition: none;
	}
}
