/* Unit booking page. Desktop: title, gallery and details on the left, booking card beside the title (sticky).
   Phones: title → booking card → gallery → details. Tokens in site.css. */

.sbx-unit > .sbx-container {
	padding: var(--sbx-space-5) 0 var(--sbx-section);
}

.sbx-unit__notices:empty {
	display: none;
}

.sbx-unit__crumbs {
	margin: 0 0 var(--sbx-space-4);
}

.sbx-site .sbx-unit__crumbs a {
	display: inline-flex;
	min-height: 36px;
	align-items: center;
	gap: 4px;
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
	font-weight: 600;
}

.sbx-site .sbx-unit__crumbs a:hover {
	color: var(--sbx-ink);
}

.sbx-unit__crumbs svg {
	width: 16px;
	height: 16px;
}

/* Title row */
.sbx-unit__head {
	min-width: 0;
	grid-area: head;
	margin-bottom: var(--sbx-space-6);
}

.sbx-unit__head-top {
	display: flex;
	margin-bottom: var(--sbx-space-3);
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sbx-space-3);
}

.sbx-unit__head-size {
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
	font-weight: 500;
}

.sbx-unit__title {
	margin: 0;
	color: var(--sbx-ink);
	font-size: var(--sbx-fs-h1);
	font-weight: 600;
	letter-spacing: var(--sbx-ls-display);
	line-height: 1.05;
}

.sbx-unit__location {
	display: flex;
	margin-top: var(--sbx-space-4);
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sbx-space-3) var(--sbx-space-5);
}

.sbx-unit__place {
	display: flex;
	margin: 0;
	align-items: flex-start;
	gap: 8px;
	color: var(--sbx-ink);
	font-size: var(--sbx-fs-md);
	font-weight: 600;
	line-height: 1.4;
}

.sbx-unit__place svg {
	width: 18px;
	height: 18px;
	margin-top: 3px; /* centers the pin on the first text line (16px × 1.4 line-height) */
	flex: 0 0 auto;
	color: var(--sbx-muted);
}

.sbx-unit__address {
	display: block;
	margin-top: 2px;
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
	font-weight: 400;
}

body.sbx-home-2-page .sbx-site .sbx-unit__map-button {
	display: inline-flex;
	min-height: 40px;
	padding: 0 var(--sbx-space-4);
	align-items: center;
	gap: var(--sbx-space-2);
	border: 1px solid var(--sbx-line-strong);
	border-radius: 999px;
	background: #fff;
	color: var(--sbx-ink);
	cursor: pointer;
	font-size: var(--sbx-fs-sm);
	font-weight: 600;
	transition: border-color 150ms ease, background 150ms ease;
}

body.sbx-home-2-page .sbx-site .sbx-unit__map-button:hover {
	border-color: var(--sbx-primary);
	background: var(--sbx-surface);
}

.sbx-unit__map-button svg {
	width: 18px;
	height: 18px;
}

/* Gallery */
.sbx-unit__gallery {
	display: grid;
	grid-area: gallery;
	margin-bottom: var(--sbx-space-8);
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: 8px;
	overflow: hidden;
	border-radius: var(--sbx-radius-xl);
}

.sbx-unit__gallery--1 {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: auto;
}

.sbx-unit__gallery--2 {
	grid-template-rows: auto;
}

.sbx-unit__photo {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: var(--sbx-surface-strong);
}

.sbx-unit__photo:first-child {
	grid-row: 1 / -1;
	aspect-ratio: 16 / 10;
}

.sbx-unit__gallery--1 .sbx-unit__photo:first-child {
	aspect-ratio: 21 / 9;
}

.sbx-unit__photo img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Two columns: everything on the left, the booking card on the right from the title down. */
.sbx-unit__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	grid-template-areas:
		"head aside"
		"gallery aside"
		"content aside";
	grid-template-rows: auto auto 1fr;
	align-items: start;
	column-gap: clamp(32px, 4vw, 64px);
}

.sbx-unit__content {
	min-width: 0;
	grid-area: content;
}

/* Highlights */
.sbx-unit__highlights {
	display: grid;
	margin: 0;
	padding: 0 0 var(--sbx-space-8);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--sbx-space-5) var(--sbx-space-6);
	border-bottom: 1px solid var(--sbx-line);
	list-style: none;
}

.sbx-unit__highlights li {
	display: flex;
	align-items: flex-start;
	gap: var(--sbx-space-3);
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
	line-height: 1.45;
}

.sbx-unit__highlights .sbx-icon-tile {
	flex: 0 0 auto;
}

.sbx-unit__highlights strong {
	display: block;
	margin-bottom: 2px;
	color: var(--sbx-ink);
	font-size: 15px;
	font-weight: 600;
}

/* Content sections */
.sbx-unit__section {
	padding: var(--sbx-space-8) 0;
	border-bottom: 1px solid var(--sbx-line);
	scroll-margin-top: calc(var(--sbx-home-2-header-height) + var(--sbx-space-4));
}

.sbx-unit__section:last-child {
	border-bottom: 0;
}

.sbx-unit__section h2 {
	margin: 0 0 var(--sbx-space-4);
	color: var(--sbx-ink);
	font-size: var(--sbx-fs-h2-sm);
	font-weight: 600;
	letter-spacing: var(--sbx-ls-display);
	line-height: 1.2;
}

.sbx-unit__description {
	color: var(--sbx-text);
	font-size: var(--sbx-fs-md);
	line-height: 1.7;
}

.sbx-unit__description p {
	margin: 0 0 14px;
}

.sbx-unit__description p:last-child {
	margin-bottom: 0;
}

.sbx-unit__specs {
	display: grid;
	margin: 0;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 var(--sbx-space-8);
}

.sbx-unit__specs > div {
	display: grid;
	padding: 12px 0;
	grid-template-columns: 120px minmax(0, 1fr);
	gap: 12px;
	border-bottom: 1px solid var(--sbx-line);
}

.sbx-unit__specs dt {
	color: var(--sbx-subtle);
	font-size: var(--sbx-fs-sm);
	font-weight: 500;
}

body.sbx-home-2-page .sbx-site .sbx-unit__spec-link {
	display: inline;
	margin-left: var(--sbx-space-2);
	padding: 0;
	border: 0;
	background: none;
	color: var(--sbx-blue);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}

body.sbx-home-2-page .sbx-site .sbx-unit__spec-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sbx-unit__specs dd {
	margin: 0;
	color: var(--sbx-ink);
	font-size: var(--sbx-fs-sm);
	font-weight: 600;
	line-height: 1.45;
}

.sbx-unit__steps {
	display: grid;
	margin: 0;
	padding: 0;
	gap: var(--sbx-space-5);
	list-style: none;
}

.sbx-unit__steps li {
	display: flex;
	align-items: flex-start;
	gap: var(--sbx-space-4);
}

.sbx-unit__step-number {
	display: inline-grid;
	width: 36px;
	height: 36px;
	flex: 0 0 auto;
	place-items: center;
	border-radius: 50%;
	background: var(--sbx-primary);
	color: #fff;
	font-size: var(--sbx-fs-sm);
	font-weight: 700;
}

.sbx-unit__steps h3,
.sbx-unit__policy h3 {
	margin: 0 0 4px;
}

.sbx-unit__steps p {
	margin: 0;
	color: var(--sbx-muted);
	font-size: 15px;
}

.sbx-unit__policy-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--sbx-space-6);
}

.sbx-unit__policy ul {
	display: grid;
	margin: 0;
	padding: 0;
	gap: 8px;
	list-style: none;
}

.sbx-unit__policy li {
	position: relative;
	padding-left: 16px;
	color: var(--sbx-muted);
	font-size: 15px;
	line-height: 1.5;
}

.sbx-unit__policy li::before {
	position: absolute;
	top: 0.65em;
	left: 0;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--sbx-line-strong);
	content: "";
}

.sbx-unit__about p {
	max-width: 560px;
	margin: 0 0 var(--sbx-space-5);
	color: var(--sbx-muted);
}

.sbx-unit__about-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sbx-space-3);
}

/* Booking card */
.sbx-unit__aside {
	position: sticky;
	top: calc(var(--sbx-home-2-header-height) + var(--sbx-space-5));
	display: grid;
	grid-area: aside;
	gap: var(--sbx-space-5);
}

.sbx-unit__panel {
	padding: var(--sbx-space-6);
	box-shadow: var(--sbx-shadow);
}

.sbx-unit__form,
.sbx-unit__booked {
	display: grid;
	gap: var(--sbx-space-4);
}

.sbx-unit__panel-title {
	margin: 0;
	color: var(--sbx-ink);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: var(--sbx-ls-display);
	line-height: 1.25;
}

/* Duration as a vertical list of rows */
.sbx-duration--list .sbx-duration__options {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
}

.sbx-duration--list .sbx-duration__card {
	min-height: 0;
	padding: 12px 16px;
	flex-direction: row;
	align-items: center;
	gap: 14px;
}

.sbx-duration__radio {
	display: block;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	border: 2px solid var(--sbx-line-strong);
	border-radius: 50%;
	background: #fff;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}

.sbx-duration__text {
	display: grid;
	min-width: 0;
	flex: 1 1 auto;
	gap: 2px;
}

.sbx-duration--list .sbx-duration__hint {
	margin: 0;
}

.sbx-duration--list .sbx-duration__price {
	font-size: 20px;
}

.sbx-duration--list .sbx-duration__option input:checked + .sbx-duration__card {
	border-color: var(--sbx-primary);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--sbx-primary);
}

.sbx-duration--list .sbx-duration__option input:checked + .sbx-duration__card .sbx-duration__name,
.sbx-duration--list .sbx-duration__option input:checked + .sbx-duration__card .sbx-duration__price {
	color: var(--sbx-ink);
}

.sbx-duration--list .sbx-duration__option input:checked + .sbx-duration__card .sbx-duration__hint {
	color: var(--sbx-muted);
}

.sbx-duration--list .sbx-duration__option input:checked + .sbx-duration__card .sbx-duration__radio {
	border-color: var(--sbx-primary);
	box-shadow: inset 0 0 0 5px var(--sbx-primary);
}

.sbx-unit__summary {
	display: grid;
	padding-top: var(--sbx-space-4);
	gap: 6px;
	border-top: 1px solid var(--sbx-line);
}

.sbx-unit__summary p {
	margin: 0;
}

.sbx-unit__summary-line {
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
}

.sbx-unit__summary-line strong {
	color: var(--sbx-ink);
	font-weight: 600;
}

.sbx-unit__summary-total {
	color: var(--sbx-muted);
	font-size: 15px;
	line-height: 1.5;
}

.sbx-unit__summary-total strong {
	color: var(--sbx-ink);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.03em;
}

/* Start and end of the rental, right under the button. */
.sbx-unit__summary-ends {
	margin: calc(var(--sbx-space-1) * -1) 0 0;
	color: var(--sbx-muted);
	font-size: 13px;
	line-height: 1.45;
	text-align: center;
}

.sbx-unit__summary-ends strong {
	color: var(--sbx-ink);
	font-weight: 600;
}

.sbx-site a.sbx-unit__details-link {
	display: inline-flex;
	margin-top: calc(var(--sbx-space-1) * -1);
	align-items: center;
	justify-self: center;
	gap: 6px;
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
	font-weight: 600;
	text-decoration: none;
}

.sbx-site a.sbx-unit__details-link:hover {
	color: var(--sbx-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sbx-unit__details-link svg {
	width: 16px;
	height: 16px;
}

body.sbx-home-2-page .sbx-site .sbx-unit__submit.is-loading {
	opacity: 0.8;
	pointer-events: none;
}

.sbx-unit__booked p {
	margin: -10px 0 0;
	color: var(--sbx-muted);
	font-size: 15px;
}

.sbx-unit__price-list {
	display: grid;
	margin: 0;
	padding: 0;
	gap: 8px;
	list-style: none;
}

.sbx-unit__price-list li {
	display: flex;
	padding: 10px 14px;
	align-items: baseline;
	justify-content: space-between;
	border: 1px solid var(--sbx-line);
	border-radius: var(--sbx-radius);
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
}

.sbx-unit__price-list strong {
	color: var(--sbx-ink);
	font-size: var(--sbx-fs-md);
}

.sbx-unit__assurance {
	display: grid;
	margin: 0;
	padding: 0 var(--sbx-space-2);
	gap: 10px;
	list-style: none;
}

.sbx-unit__assurance li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
	line-height: 1.45;
}

.sbx-unit__assurance i {
	flex: 0 0 auto;
	color: var(--sbx-success);
	font-size: 18px;
	line-height: 1.2;
}

/* Map dialog ("View map"): the unit's pin, directions and the address. */
.sbx-map-dialog {
	width: min(760px, calc(100% - 32px));
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: var(--sbx-radius-lg);
	background: #fff;
	box-shadow: var(--sbx-shadow-lg);
	color: var(--sbx-text);
}

.sbx-map-dialog[open] {
	display: flex;
	flex-direction: column;
	animation: sbx-map-dialog-in 200ms ease-out both;
}

.sbx-map-dialog::backdrop {
	background: rgba(10, 29, 53, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.sbx-map-dialog__head {
	display: flex;
	padding: var(--sbx-space-5) var(--sbx-space-5) var(--sbx-space-4) var(--sbx-card-pad);
	align-items: center;
	gap: var(--sbx-space-4);
}

.sbx-map-dialog__copy {
	min-width: 0;
	flex: 1 1 auto;
}

.sbx-home-2 .sbx-map-dialog__title {
	margin: 0;
	color: var(--sbx-ink);
	font-size: var(--sbx-fs-h3);
	font-weight: 600;
	line-height: 1.3;
}

.sbx-map-dialog__address {
	margin: 2px 0 0;
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
}

body.sbx-home-2-page .sbx-site .sbx-map-dialog__close {
	display: grid;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	padding: 0;
	place-items: center;
	border: 1px solid var(--sbx-line);
	border-radius: 50%;
	background: #fff;
	color: var(--sbx-ink);
	cursor: pointer;
}

body.sbx-home-2-page .sbx-site .sbx-map-dialog__close:hover {
	background: var(--sbx-surface);
}

.sbx-map-dialog__close svg {
	width: 18px;
	height: 18px;
}

.sbx-map-dialog__map {
	position: relative;
	z-index: 0;
	isolation: isolate;
	height: clamp(280px, 52vh, 440px);
	flex: 0 0 auto;
	background: var(--sbx-surface-strong);
}

.sbx-map-dialog__map .leaflet-tile-pane {
	filter: saturate(0.35) brightness(1.04) contrast(0.92);
}

.sbx-map-dialog__loading {
	position: absolute;
	inset: 0;
	display: grid;
	margin: 0;
	place-items: center;
	color: var(--sbx-muted);
	font-size: var(--sbx-fs-sm);
}

.sbx-map-dialog__actions {
	display: flex;
	padding: var(--sbx-space-4) var(--sbx-card-pad) var(--sbx-space-5);
	flex-wrap: wrap;
	gap: var(--sbx-space-3);
}

@keyframes sbx-map-dialog-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Mobile sticky booking bar */
.sbx-unit__sticky {
	position: fixed;
	right: var(--sbx-space-3);
	bottom: var(--sbx-space-3);
	left: var(--sbx-space-3);
	z-index: 90;
	display: flex;
	padding: 10px 10px 10px var(--sbx-space-4);
	align-items: center;
	justify-content: space-between;
	gap: var(--sbx-space-3);
	border: 1px solid var(--sbx-line);
	border-radius: var(--sbx-radius-lg);
	background: rgba(255, 255, 255, 0.97);
	box-shadow: var(--sbx-shadow-lg);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	animation: sbx-unit-sticky-in 180ms ease-out both;
}

.sbx-unit__sticky[hidden] {
	display: none !important;
}

.sbx-unit__sticky-copy {
	display: grid;
	min-width: 0;
	gap: 2px;
}

.sbx-unit__sticky-copy strong {
	color: var(--sbx-ink);
	font-size: 15px;
}

.sbx-unit__sticky-copy span {
	overflow: hidden;
	color: var(--sbx-muted);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.sbx-home-2-page .sbx-site .sbx-unit__sticky .sbx-btn {
	min-height: 46px;
	padding: 0 var(--sbx-space-5);
	flex: 0 0 auto;
}

@keyframes sbx-unit-sticky-in {
	from {
		transform: translateY(16px);
		opacity: 0;
	}
	to {
		transform: none;
		opacity: 1;
	}
}

@media (max-width: 1180px) {
	.sbx-unit__specs {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 1024px) {
	.sbx-unit__layout {
		grid-template-columns: minmax(0, 1fr) 360px;
	}

	.sbx-unit__policy-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 900px) {
	/* Title, then the booking card, then photos and details. */
	.sbx-unit__layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"head"
			"aside"
			"gallery"
			"content";
		grid-template-rows: none;
	}

	.sbx-unit__head {
		margin-bottom: var(--sbx-space-5);
	}

	.sbx-unit__aside {
		position: static;
	}

	.sbx-unit__gallery {
		margin: var(--sbx-space-8) 0 var(--sbx-space-6);
	}
}

@media (max-width: 768px) {
	.sbx-unit > .sbx-container {
		padding-top: var(--sbx-space-3);
	}

	.sbx-unit__location {
		margin-top: var(--sbx-space-3);
	}

	/* Four durations in a 2 × 2 grid so "Book this unit" stays on the first screen. */
	.sbx-duration--list .sbx-duration__options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sbx-duration--list .sbx-duration__card {
		display: grid;
		padding: 12px;
		grid-template-columns: 20px minmax(0, 1fr);
		grid-template-areas:
			"radio text"
			"radio price";
		align-items: start;
		gap: 4px 10px;
	}

	.sbx-duration--list .sbx-duration__radio {
		grid-area: radio;
		margin-top: 1px;
	}

	.sbx-duration--list .sbx-duration__text {
		grid-area: text;
	}

	.sbx-duration--list .sbx-duration__price {
		grid-area: price;
		font-size: 18px;
	}

	.sbx-duration--list .sbx-duration__hint {
		display: none;
	}

	.sbx-map-dialog {
		width: 100%;
		max-width: none;
		max-height: 92dvh;
		margin: auto 0 0;
		border-radius: var(--sbx-radius-lg) var(--sbx-radius-lg) 0 0;
	}

	.sbx-map-dialog__map {
		height: 46dvh;
	}

	body.sbx-home-2-page .sbx-site .sbx-map-dialog__actions .sbx-btn {
		flex: 1 1 100%;
	}

	.sbx-unit__gallery {
		display: flex;
		margin-right: calc(var(--sbx-gutter) * -1);
		margin-left: calc(var(--sbx-gutter) * -1);
		padding: 0 var(--sbx-gutter);
		overflow-x: auto;
		gap: 8px;
		border-radius: 0;
		scroll-padding: 0 var(--sbx-gutter);
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.sbx-unit__gallery::-webkit-scrollbar {
		display: none;
	}

	.sbx-unit__photo,
	.sbx-unit__photo:first-child,
	.sbx-unit__gallery--1 .sbx-unit__photo:first-child {
		flex: 0 0 86%;
		aspect-ratio: 16 / 11;
		border-radius: var(--sbx-radius-lg);
		scroll-snap-align: start;
	}

	.sbx-unit__highlights {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--sbx-space-4);
	}

	.sbx-unit__section {
		padding: var(--sbx-space-6) 0;
	}

	.sbx-unit__specs {
		grid-template-columns: minmax(0, 1fr);
	}

	.sbx-unit__specs > div {
		grid-template-columns: 108px minmax(0, 1fr);
	}

	.sbx-unit__panel {
		padding: var(--sbx-space-5);
	}

	.sbx-unit__about-actions {
		display: grid;
	}

	/* Keep the last section clear of the sticky bar. */
	.sbx-unit > .sbx-container {
		padding-bottom: calc(var(--sbx-section) + 72px);
	}
}

@media (min-width: 769px) {
	.sbx-unit__sticky {
		display: none !important;
	}
}
