/* ==========================================================================
   Booking bar (homepage hero) + popovers (portal in <body>)
   ========================================================================== */

.hts-bk {
	--bk-ease: cubic-bezier(.2, .8, .2, 1);
	position: relative;
	display: flex;
	align-items: center;
	width: min(860px, calc(100vw - 48px));
	margin-inline: auto;
	padding: 8px 8px 8px 0;
	background: var(--color-white);
	border-radius: var(--radius-pill);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .22), 0 1px 2px rgba(0, 0, 0, .08);
	text-align: left;
	transition: background-color .25s var(--bk-ease), box-shadow .25s var(--bk-ease);
}
.hts-bk.is-active { background: #ebebeb; }

.hts-bk__seg {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 28px;
	border: 0;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--color-dark);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background-color .2s var(--bk-ease), box-shadow .25s var(--bk-ease);
}
.hts-bk__seg--where { flex-grow: 1.25; }
.hts-bk__seg:hover { background: rgba(29, 29, 27, .06); }
.hts-bk.is-active .hts-bk__seg:hover { background: #dddddd; }
.hts-bk__seg.is-current,
.hts-bk.is-active .hts-bk__seg.is-current:hover {
	background: var(--color-white);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}
.hts-bk__seg:focus-visible,
.hts-bk__go:focus-visible { outline: 2px solid var(--color-dark); outline-offset: 2px; }

.hts-bk__label {
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .01em;
	color: var(--color-dark);
}
.hts-bk__value {
	font-family: var(--font-body);
	font-size: 15px;
	color: var(--color-gray-500);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hts-bk__value.is-filled { color: var(--color-dark); font-weight: 600; }
.hts-bk__value.is-pop { animation: hts-bk-pop .35s var(--bk-ease); }

.hts-bk__sep {
	flex: none;
	width: 1px;
	height: 32px;
	background: var(--color-border);
	transition: opacity .2s;
}
.hts-bk.is-active .hts-bk__sep { opacity: 0; }

.hts-bk__go {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 52px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-accent-a11y);
	color: var(--color-white);
	font: 600 16px/1 var(--font-body);
	cursor: pointer;
	transition: background-color .2s, padding .3s var(--bk-ease), transform .15s;
}
.hts-bk__go-text {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	transition: max-width .35s var(--bk-ease);
}
.hts-bk__go:hover,
.hts-bk.is-active .hts-bk__go { background: #c25f00; }
.hts-bk.is-active .hts-bk__go,
.hts-bk__go:hover { padding: 0 22px 0 18px; }
.hts-bk.is-active .hts-bk__go-text,
.hts-bk__go:hover .hts-bk__go-text { max-width: 220px; }
.hts-bk__go:active { transform: scale(.97); }

.hts-hero__explore:has(.hts-bk) { width: 100%; }

/* Stacked variant: apartment page sidebar (same layout as the phone bar) */
.hts-bk--stack {
	width: 100%;
	flex-direction: column;
	align-items: stretch;
	padding: 8px;
	border-radius: 18px;
	box-shadow: 0 0 0 1px var(--color-border);
}
.hts-bk--stack.is-active { background: var(--color-white); }
.hts-detail__cal:has(.hts-bk--stack) { min-height: 0; height: auto; } /* drop the space reserved for the old Google iframe */
.hts-bk--stack .hts-bk__seg {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 12px;
}
.hts-bk--stack .hts-bk__label { flex: none; }
.hts-bk--stack .hts-bk__value { text-align: right; }
.hts-bk--stack .hts-bk__sep { width: auto; height: 1px; margin: 0 14px; }
.hts-bk--stack .hts-bk__go { justify-content: center; margin-top: 6px; height: 50px; padding: 0 18px; }
.hts-bk--stack .hts-bk__go-text { max-width: none; }

/* ── Popover ── */
.hts-bk-scrim {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .22s;
}
.hts-bk-scrim.is-in { opacity: 1; }

.hts-bk-pop {
	position: absolute;
	z-index: 9999;
	padding: 24px;
	background: var(--color-white);
	color: var(--color-dark);
	border-radius: 28px;
	box-shadow: 0 16px 56px rgba(0, 0, 0, .22);
	font-family: var(--font-body);
	opacity: 0;
	transform: translateY(-8px) scale(.98);
	transform-origin: top center;
	transition: opacity .2s var(--bk-ease), transform .25s var(--bk-ease);
}
.hts-bk-pop.is-in { opacity: 1; transform: none; }
.hts-bk-pop[hidden],
.hts-bk-pop [hidden] { display: none !important; }

.hts-bk-pop--modal {
	position: fixed;
	top: 50%;
	left: 50%;
	width: min(480px, calc(100vw - 32px));
	max-height: calc(100svh - 32px);
	overflow: auto;
	transform: translate(-50%, -46%) scale(.98);
}
.hts-bk-pop--modal.is-in { transform: translate(-50%, -50%); }

.hts-bk-pop__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.hts-bk-pop__title { font: 600 20px/1.2 var(--font-heading); }
.hts-bk-pop__x {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: -8px -8px -8px 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--color-dark);
	cursor: pointer;
}
.hts-bk-pop__x:hover { background: var(--color-gray-bg); }

/* Buttons */
.hts-bk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-dark);
	color: var(--color-white);
	font: 600 15px/1 var(--font-body);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, transform .15s;
}
.hts-bk-btn:hover { background: #000; }
.hts-bk-btn:active { transform: scale(.98); }
.hts-bk-btn:disabled { opacity: .5; cursor: default; }
.hts-bk-btn--wide { width: 100%; margin-top: 16px; }
.hts-bk-btn--ghost { background: transparent; color: var(--color-dark); box-shadow: inset 0 0 0 1.5px var(--color-dark); }
.hts-bk-btn--ghost:hover { background: var(--color-gray-bg); }
.hts-bk-btn--wa { background: #128C4B; }
.hts-bk-btn--wa:hover { background: #0e7a40; }
.hts-bk-btn:focus-visible,
.hts-bk-link:focus-visible,
.hts-bk-apt:focus-visible,
.hts-bk-day:focus-visible,
.hts-bk-step__b:focus-visible,
.hts-bk-cal__arrow:focus-visible { outline: 2px solid var(--color-accent-a11y); outline-offset: 2px; }

.hts-bk-link {
	margin-left: auto;
	padding: 10px 6px;
	border: 0;
	background: none;
	color: var(--color-dark);
	font: 600 14px/1 var(--font-body);
	text-decoration: underline;
	cursor: pointer;
}
.hts-bk-link:disabled { opacity: .35; cursor: default; }

/* ── Where ── */
.hts-bk-apts { display: grid; gap: 4px; }
.hts-bk-apt {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 10px;
	border: 0;
	border-radius: 16px;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	animation: hts-bk-rise .35s var(--bk-ease) both;
	animation-delay: calc(var(--i) * 50ms);
	transition: background-color .2s;
}
.hts-bk-apt:hover,
.hts-bk-apt.is-selected { background: var(--color-gray-bg); }
.hts-bk-apt__img { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.hts-bk-apt__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hts-bk-apt__loc { font-size: 15px; font-weight: 600; }
.hts-bk-apt__name { font-size: 13px; color: var(--color-gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hts-bk-apt__meta { font-size: 12px; color: var(--color-gold-a11y); font-weight: 600; }

/* ── Calendar ── */
.hts-bk-cal { position: relative; }
.hts-bk-cal__info {
	margin: 0 0 8px;
	min-height: 20px;
	font-size: 14px;
	color: var(--color-gray-500);
	text-align: center;
}
.hts-bk-cal > .hts-bk-btn { display: flex; margin: 12px auto 0; }
.hts-bk-cal__nav {
	position: absolute;
	top: 30px;
	left: -6px;
	right: -6px;
	display: flex;
	justify-content: space-between;
	pointer-events: none;
}
.hts-bk-cal__arrow {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--color-dark);
	cursor: pointer;
	pointer-events: auto;
	transition: background-color .2s;
}
.hts-bk-cal__arrow:hover:not(:disabled) { background: var(--color-gray-bg); }
.hts-bk-cal__arrow:disabled { opacity: .25; cursor: default; }

.hts-bk-cal__months {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px;
	animation: hts-bk-fade .3s var(--bk-ease);
}
.hts-bk-month__title {
	height: 40px;
	margin-bottom: 8px;
	font-size: 16px;
	font-weight: 600;
	line-height: 40px;
	text-align: center;
}
.hts-bk-month__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	row-gap: 2px;
}
.hts-bk-wd {
	padding-bottom: 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--color-gray-500);
	text-align: center;
}
.hts-bk-day {
	position: relative;
	aspect-ratio: 1;
	min-height: 40px;
	border: 0;
	background: transparent;
	color: var(--color-dark);
	font: 600 14px/1 var(--font-body);
	cursor: pointer;
	isolation: isolate;
}
.hts-bk-day::before {
	content: "";
	position: absolute;
	inset: 2px;
	z-index: -1;
	border-radius: 50%;
	transition: background-color .15s, box-shadow .15s, transform .2s var(--bk-ease);
}
.hts-bk-day:not(:disabled):hover::before { box-shadow: inset 0 0 0 1.5px var(--color-dark); }
.hts-bk-day.is-empty { pointer-events: none; }
.hts-bk-day.is-past,
.hts-bk-day:disabled { color: #b9b9b9; cursor: default; font-weight: 400; }
.hts-bk-day.is-busy { text-decoration: line-through; color: #a8a8a8; }
.hts-bk-day.is-busy::after {
	content: "";
	position: absolute;
	inset: 6px;
	z-index: -2;
	border-radius: 50%;
	background: repeating-linear-gradient(-45deg, #f1f1f1 0 3px, transparent 3px 6px);
}
.hts-bk-day.is-today:not(.is-start):not(.is-end)::before { box-shadow: inset 0 0 0 1px var(--color-gray-light); }
.hts-bk-day.is-range { background: var(--color-cream-soft); }
.hts-bk-day.is-start,
.hts-bk-day.is-end { color: var(--color-white); }
.hts-bk-day.is-start::before,
.hts-bk-day.is-end::before { background: var(--color-dark); transform: scale(1); animation: hts-bk-dot .25s var(--bk-ease); }
.hts-bk-day.is-start.has-end { background: linear-gradient(90deg, transparent 50%, var(--color-cream-soft) 50%); }
.hts-bk-day.is-end { background: linear-gradient(90deg, var(--color-cream-soft) 50%, transparent 50%); }

.hts-bk-cal__foot {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--color-border);
}
.hts-bk-cal__legend { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-gray-500); }
.hts-bk-cal__legend .is-busy-dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: repeating-linear-gradient(-45deg, #dcdcdc 0 3px, #f6f6f6 3px 6px);
}

/* ── Who ── */
.hts-bk-who { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hts-bk-who__txt { display: flex; flex-direction: column; gap: 2px; }
.hts-bk-who__txt strong { font-size: 16px; }
.hts-bk-who__txt span { font-size: 13px; color: var(--color-gray-500); }
.hts-bk-step { display: flex; align-items: center; gap: 14px; }
.hts-bk-step__b {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid #b0b0b0;
	border-radius: 50%;
	background: var(--color-white);
	color: var(--color-dark);
	cursor: pointer;
	transition: border-color .2s, transform .15s;
}
.hts-bk-step__b:hover:not(:disabled) { border-color: var(--color-dark); }
.hts-bk-step__b:active:not(:disabled) { transform: scale(.92); }
.hts-bk-step__b:disabled { opacity: .3; cursor: default; }
.hts-bk-step__n { min-width: 20px; font-size: 17px; font-weight: 600; text-align: center; }
.hts-bk-step__n.is-bump { animation: hts-bk-pop .3s var(--bk-ease); }

/* ── Summary ── */
.hts-bk-sum {
	display: flex;
	gap: 16px;
	padding: 16px;
	border-radius: 18px;
	background: var(--color-gray-bg);
}
.hts-bk-sum__img { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.hts-bk-sum__list { display: grid; gap: 8px; margin: 0; min-width: 0; }
.hts-bk-sum__list div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 14px; }
.hts-bk-sum__list dt { color: var(--color-gray-500); }
.hts-bk-sum__list dd { margin: 0; font-weight: 600; }
.hts-bk-sum__note { margin: 16px 0; font-size: 14px; line-height: 1.5; color: var(--color-gray-500); }
.hts-bk-sum__actions { display: grid; gap: 10px; }

.hts-bk-mail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.hts-bk-mail.is-in { animation: hts-bk-rise .3s var(--bk-ease); }
.hts-bk-mail[hidden] { display: none; }
.hts-bk-mail label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.hts-bk-mail label[hidden] { display: none; }
.hts-bk-mail__wide,
.hts-bk-mail__msg,
.hts-bk-mail .hts-bk-btn { grid-column: 1 / -1; }
.hts-bk-mail input,
.hts-bk-mail textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #b0b0b0;
	border-radius: 12px;
	background: var(--color-white);
	color: var(--color-dark);
	font: 400 16px/1.3 var(--font-body);
}
.hts-bk-mail input:focus,
.hts-bk-mail textarea:focus { outline: 2px solid var(--color-dark); outline-offset: 0; border-color: transparent; }
.hts-bk-mail .hts-bk-btn { margin-top: 0; }
.hts-bk-mail .hts-bk-btn[hidden] { display: none; }
.hts-bk-mail__msg { margin: 0; font-size: 14px; }
.hts-bk-mail__msg:empty { display: none; }
.hts-bk-mail__msg.is-error { color: var(--color-error-dark); }
.hts-bk-mail__msg.is-ok { padding: 14px; border-radius: 12px; background: var(--color-success-bg); color: var(--color-success-text); font-weight: 600; }
.hts-bk-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Motion ── */
@keyframes hts-bk-pop { 0% { transform: scale(.92); opacity: .4; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }
@keyframes hts-bk-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes hts-bk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hts-bk-dot { from { transform: scale(.6); } to { transform: scale(1); } }

/* ── Mobile: stacked card + bottom sheets ── */
@media (max-width: 767px) {
	.hts-bk {
		flex-direction: column;
		align-items: stretch;
		padding: 8px;
		border-radius: 24px;
	}
	.hts-bk.is-active { background: var(--color-white); }
	.hts-bk__seg {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 12px 14px;
		border-radius: 14px;
	}
	.hts-bk__label { flex: none; }
	.hts-bk__value { text-align: right; }
	.hts-bk__sep { width: auto; height: 1px; margin: 0 14px; }
	.hts-bk__go { justify-content: center; margin-top: 6px; height: 50px; padding: 0 18px; }
	.hts-bk__go-text { max-width: none; }

	.hts-bk-pop,
	.hts-bk-pop--modal {
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: auto;
		max-height: 88svh;
		overflow: auto;
		padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
		border-radius: 24px 24px 0 0;
		transform: translateY(24px);
	}
	.hts-bk-pop.is-in,
	.hts-bk-pop--modal.is-in { transform: none; }
	.hts-bk-cal__months { grid-template-columns: 1fr; }
	.hts-bk-cal__nav { top: 28px; }
	.hts-bk-cal__foot { flex-wrap: wrap; }
	.hts-bk-cal__foot .hts-bk-btn { flex: 1 1 100%; }
	.hts-bk-mail { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.hts-bk *,
	.hts-bk-pop,
	.hts-bk-pop *,
	.hts-bk-scrim { animation: none !important; transition: none !important; }
}
