.mfs-rlm-hero-gallery {
	width: 100%;
	font-family: var(--mfs-rlm-font-body, Montserrat), sans-serif;
}

.mfs-rlm-hero-gallery:focus {
	outline: 2px solid var(--mfs-rlm-color-accent, #BA7517);
	outline-offset: 2px;
}

.mfs-rlm-hero-gallery__hero {
	position: relative;
	width: 100%;
	aspect-ratio: 21 / 9;
	overflow: hidden;
	margin-bottom: 8px;
}

.mfs-rlm-hero-gallery__hero-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.mfs-rlm-hero-gallery__badges {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.mfs-rlm-hero-gallery__badge {
	background: var(--mfs-rlm-badge-sold, #444441);
	color: var(--mfs-rlm-color-on-dark, #fff);
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	padding: 6px 10px;
	text-transform: uppercase;
	border-radius: 2px;
	line-height: 1.2;
}

.mfs-rlm-hero-gallery__badge--new,
.mfs-rlm-hero-gallery__badge--available {
	background: var(--mfs-rlm-color-text-alt, #2d3436);
}

.mfs-rlm-hero-gallery__badge--new-price {
	background: var(--mfs-rlm-badge-new-price, #993c1d);
}

.mfs-rlm-hero-gallery__badge--contract,
.mfs-rlm-hero-gallery__badge--sold {
	background: var(--mfs-rlm-badge-sold, #444441);
}

.mfs-rlm-hero-gallery__badge--open-house {
	background: var(--mfs-rlm-badge-open-house, #d48806);
	white-space: nowrap;
}

.mfs-rlm-hero-gallery__controls {
	display: flex;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}

.mfs-rlm-hero-gallery__nav {
	flex: 0 0 36px;
	width: 36px;
	border: 1px solid var(--mfs-rlm-color-border, #e5e3dc);
	background: var(--mfs-rlm-color-primary, #152228);
	color: var(--mfs-rlm-color-on-dark, #fff);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0;
}

.mfs-rlm-hero-gallery__nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.mfs-rlm-hero-gallery__nav:not(:disabled):hover {
	background: var(--mfs-rlm-color-secondary, #496170);
}

.mfs-rlm-hero-gallery__thumbs {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	flex: 1 1 auto;
	min-width: 0;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.mfs-rlm-hero-gallery__thumbs::-webkit-scrollbar {
	height: 6px;
}

.mfs-rlm-hero-gallery__thumbs::-webkit-scrollbar-thumb {
	background: var(--mfs-rlm-color-muted, #9aa6ae);
	border-radius: 3px;
}

.mfs-rlm-hero-gallery__thumb {
	flex: 0 0 88px;
	width: 88px;
	height: 88px;
	padding: 0;
	border: 2px solid transparent;
	background: none;
	cursor: pointer;
	overflow: hidden;
	border-radius: 10px;
}

.mfs-rlm-hero-gallery__thumb.is-active {
	border-color: var(--mfs-rlm-color-accent, #BA7517);
}

.mfs-rlm-hero-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 8px;
}

@media (max-width: 768px) {
	.mfs-rlm-hero-gallery__hero {
		aspect-ratio: 16 / 9;
	}

	.mfs-rlm-hero-gallery__thumb {
		flex: 0 0 72px;
		width: 72px;
		height: 72px;
	}
}

.mfs-rlm-hero-gallery--grid .mfs-rlm-hero-gallery__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 8px;
	width: 100%;
	min-height: 420px;
}

.mfs-rlm-hero-gallery__grid-main,
.mfs-rlm-hero-gallery__grid-cell {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 0;
	border: 0;
	background: #ddd;
	overflow: hidden;
	cursor: pointer;
	border-radius: 12px;
}

.mfs-rlm-hero-gallery__grid-main {
	min-height: 420px;
}

.mfs-rlm-hero-gallery__grid-main img,
.mfs-rlm-hero-gallery__grid-cell img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mfs-rlm-hero-gallery__grid-side {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: 8px;
	min-height: 420px;
}

.mfs-rlm-hero-gallery__grid-cell--all::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(21, 34, 40, 0.35);
}

.mfs-rlm-hero-gallery__show-all {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 999px;
	background: #fff;
	color: var(--mfs-rlm-color-primary, #152228);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	box-shadow: 0 4px 16px rgba(21, 34, 40, 0.18);
	pointer-events: none;
}

.mfs-rlm-hero-gallery__show-all-icon {
	font-size: 1rem;
	line-height: 1;
}

.mfs-rlm-hero-gallery__lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.mfs-rlm-hero-gallery__lightbox[hidden] {
	display: none !important;
}

.mfs-rlm-hero-gallery__lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
}

.mfs-rlm-hero-gallery__lightbox-dialog {
	position: absolute;
	inset: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mfs-rlm-hero-gallery__lightbox-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.mfs-rlm-hero-gallery__lightbox-close,
.mfs-rlm-hero-gallery__lightbox-nav {
	position: absolute;
	box-sizing: border-box;
	border: 0;
	background: rgba(255, 255, 255, 0.92);
	color: var(--mfs-rlm-color-primary, #152228);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-family: inherit;
	line-height: 1;
}

.mfs-rlm-hero-gallery__lightbox-icon {
	display: block;
	flex: 0 0 auto;
}

.mfs-rlm-hero-gallery__lightbox-close {
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border-radius: 999px;
}

.mfs-rlm-hero-gallery__lightbox-nav {
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 999px;
}

.mfs-rlm-hero-gallery__lightbox-nav--prev {
	left: 16px;
}

.mfs-rlm-hero-gallery__lightbox-nav--next {
	right: 16px;
}

.mfs-rlm-hero-gallery__lightbox-nav:disabled,
.mfs-rlm-hero-gallery__lightbox-close:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

body.mfs-rlm-hero-gallery-lightbox-open {
	overflow: hidden;
}

@media (max-width: 900px) {
	.mfs-rlm-hero-gallery--grid .mfs-rlm-hero-gallery__grid {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.mfs-rlm-hero-gallery__grid-main,
	.mfs-rlm-hero-gallery__grid-side {
		min-height: 240px;
	}
}
