/* Property Modals — base chrome */

.re-property-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	z-index: 100000;
}

.re-property-modal.is-open {
	display: flex !important;
}

.re-property-modal[hidden]:not(.is-open) {
	display: none !important;
}

.re-property-modal--fade {
	opacity: 0;
	transition: opacity var(--re-pm-fade-ms, 250ms) ease;
}

.re-property-modal--fade.is-open {
	opacity: 0;
}

.re-property-modal--fade.is-open.is-faded-in {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.re-property-modal--fade {
		transition: none;
	}
}

.re-property-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	cursor: pointer;
}

.re-property-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	padding: 3rem 1.5rem;
	box-sizing: border-box;
	pointer-events: none;
}

.re-property-modal__stage {
	position: relative;
	pointer-events: auto;
	width: 100%;
	max-width: var(--re-pm-content-max-width, 1100px);
	max-height: 100%;
}

.re-property-modal__content {
	width: 100%;
	max-width: none;
	max-height: 100%;
	overflow: auto;
	box-sizing: border-box;
}

.re-property-modal__close {
	position: absolute;
	z-index: 3;
	top: 1rem;
	right: 1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	pointer-events: auto;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.re-property-modal__close span {
	display: block;
	line-height: 1;
	pointer-events: none;
}

.re-property-modal--close-top-left .re-property-modal__close {
	right: auto;
	left: 1rem;
}

.re-property-modal__epc {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: center;
	gap: var(--re-pm-epc-gap, 40px);
}

.re-property-modal__epc-col {
	flex: 1 1 280px;
	max-width: 480px;
}

.re-property-modal__floorplan-grid {
	display: grid;
	grid-template-columns: repeat(var(--re-pm-fp-cols, 2), minmax(0, 1fr));
	gap: var(--re-pm-fp-gap, 20px);
	width: 100%;
	align-items: start;
}

.re-property-modal__stage:has(.re-property-modal__floorplan-grid--single) {
	width: fit-content;
	max-width: 100%;
}

.re-property-modal__floorplan-grid--single {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: none;
	min-height: 80vh;
}

.re-property-modal__floorplan-grid--single .re-property-modal__floorplan-item {
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
}

.re-property-modal__floorplan-grid--single .re-property-modal__floorplan-link {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	line-height: 0;
}

.re-property-modal__floorplan-grid--single img {
	width: auto;
	height: 80vh;
	max-width: 95vw;
	max-height: 80vh;
	object-fit: contain;
}

.re-property-modal__floorplan-item {
	margin: 0;
}

.re-property-modal__floorplan-item img {
	display: block;
	width: 100%;
	height: auto;
}

.re-property-modal__floorplan-link {
	display: block;
	line-height: 0;
}

.re-property-modal__map {
	width: 80vw;
	height: 80vh;
	min-height: 240px;
	background: #e8e8e8;
}

.re-property-modal--map .re-property-modal__stage,
.re-property-modal--map .re-property-modal__content,
.re-property-modal--local .re-property-modal__stage,
.re-property-modal--local .re-property-modal__content {
	width: auto !important;
	max-width: none !important;
	overflow: visible !important;
}

.re-property-modal--local .re-locrating,
.re-property-modal--local .re-locrating__map {
	width: 80vw !important;
	height: 80vh !important;
	max-width: 80vw;
	max-height: 80vh;
	min-height: 240px;
}

.re-property-modal--local .re-locrating__map iframe {
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

.re-property-modal__notice,
.re-property-modal__builder-placeholder {
	padding: 1rem 1.25rem;
	background: #f5f5f5;
	color: #333;
	text-align: center;
}

.re-property-modal__builder-placeholder {
	border: 2px dashed #999;
	background: #fafafa;
	font-size: 14px;
	line-height: 1.4;
}

.re-property-modal__builder-placeholder strong {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 15px;
}

.re-property-modal__builder-placeholder p {
	margin: 0 0 0.5rem;
}

.re-property-modal__builder-list {
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
	display: inline-block;
}

.re-property-modal__builder-list li {
	margin: 0.15rem 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
}

body.re-property-modal-open,
html.re-property-modal-open {
	overflow: hidden !important;
	overscroll-behavior: none;
	height: auto !important;
}

/* Do not use position:fixed on body — it reparents fixed modal chrome. */

.re-property-modal--brochure.re-property-modal .re-property-modal__dialog {
	padding: 3.5rem 1.5rem 1.5rem;
	overflow: hidden;
}

.re-property-modal--brochure.re-property-modal .re-property-modal__stage,
.re-property-modal--brochure.re-property-modal .re-property-modal__content {
	width: auto !important;
	max-width: none !important;
	max-height: none !important;
	overflow: visible !important;
}

.re-property-modal--brochure .re-brochure-iframe-wrap {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: auto !important;
	min-height: 0 !important;
	height: auto !important;
	padding: 0 !important;
}

.re-property-modal--brochure iframe.re-brochure-iframe {
	display: block !important;
	border: 0 !important;
	background: #fff;
	/* A4 landscape — JS refines to fit viewport; CSS keeps ratio if JS lags */
	width: min(95vw, calc(80vh * 297 / 210)) !important;
	height: min(80vh, calc(95vw * 210 / 297)) !important;
	max-width: 95vw !important;
	max-height: 80vh !important;
	aspect-ratio: 297 / 210;
}

.re-property-modal--video .re-video__outer-wrap {
	max-width: 100%;
}

.re-property-modal--book_viewing .re-gf-content {
	background: #fff;
	padding: 1.5rem;
}

@media (max-width: 768px) {
	.re-property-modal__dialog {
		padding: 3.5rem 0.75rem 1rem;
	}

	.re-property-modal__epc {
		flex-direction: column;
		align-items: center;
	}

	.re-property-modal__floorplan-grid {
		grid-template-columns: repeat(var(--re-pm-fp-cols-medium, var(--re-pm-fp-cols, 1)), minmax(0, 1fr));
	}
}
