/*
 * Floating room-booking bar — compact full-width sticky strip pinned
 * to the bottom of the viewport.
 *
 * Layout:
 *  - Open  → full-width strip with intro · arrival · departure · CTA group.
 *            A small subtle "tab" toggle protrudes above the right side.
 *  - Closed → only a small pill flush with the bottom of the screen,
 *             centered horizontally.
 *
 * Open ↔ closed transitions are smoothly animated:
 *   - Strip slides DOWN out of view (translateY) and fades.
 *   - Toggle slides FROM the right edge TO the centre (right + transform).
 */

/* ------------------------------------------------------------------ shell */

.tdom-booking-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 90;          /* below chat widgets (~9999) but above page content */
	pointer-events: none;  /* let clicks fall through the empty area; opt-in below */
	font-family: var(--sans, system-ui, sans-serif);
	color: var(--ink, #292b2c);
}

/* Until the JS module hooks up flatpickr + adds `is-ready`, suppress all
 * transitions on the bar's children. Initial render then matches the
 * persisted state instantly — no slide-down flash on first paint when
 * the visitor's saved state was "closed". */
.tdom-booking-bar:not(.is-ready) .tdom-bb__strip,
.tdom-booking-bar:not(.is-ready) .tdom-bb__toggle,
.tdom-booking-bar:not(.is-ready) .tdom-bb__toggle-chevron {
	transition: none !important;
}

.tdom-bb__toggle,
.tdom-bb__strip {
	pointer-events: auto;
}

/* ------------------------------------------------------------------ toggle (tab handle) */

.tdom-bb__toggle {
	position: absolute;
	bottom: 100%;             /* sit on top of the strip */
	right: clamp(16px, 4vw, 40px);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px 9px;
	background: rgba(41, 43, 44, 0.92);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: rgba(255, 255, 255, 0.92);
	border: 0;
	border-radius: 8px 8px 0 0;
	cursor: pointer;
	font-family: var(--mono, ui-monospace, monospace);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	transition:
		right 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		padding 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		border-radius 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		background 0.2s ease,
		color 0.2s ease,
		box-shadow 0.3s ease;
}

.tdom-bb__toggle:hover {
	background: var(--ink, #292b2c);
	color: #fff;
}

.tdom-bb__toggle-chevron {
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
	opacity: 0.85;
}

/* ----- Closed state — toggle slides RIGHT → CENTRE, BOTTOM 100% → 0,
 * so it ends up flush with the bottom edge of the screen, horizontally
 * centred. The strip slides down + fades out simultaneously. */
.tdom-booking-bar[data-state="closed"] .tdom-bb__toggle {
	right: 50%;
	transform: translateX(50%);
	bottom: 0;                /* flush with the bottom edge */
	padding: 9px 24px;
	border-radius: 12px 12px 0 0;
	background: var(--ink, #292b2c);
	color: #fff;
	box-shadow:
		0 -10px 30px rgba(0, 0, 0, 0.18),
		0 -2px 8px   rgba(0, 0, 0, 0.10);
}

.tdom-booking-bar[data-state="closed"] .tdom-bb__toggle-chevron {
	transform: rotate(180deg);
}

/* ------------------------------------------------------------------ strip */

.tdom-bb__strip {
	width: 100%;
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-top: 1px solid rgba(41, 43, 44, 0.08);
	box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.10);
	transform: translateY(0);
	opacity: 1;
	transition:
		transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.30s ease;
	will-change: transform;
}

.tdom-booking-bar[data-state="closed"] .tdom-bb__strip {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}

/* ------------------------------------------------------------------ form */

.tdom-bb__form {
	max-width: 1240px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px clamp(20px, 4vw, 36px);
}

.tdom-bb__intro {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding-right: 22px;
	border-right: 1px solid rgba(41, 43, 44, 0.10);
	min-width: 0;
	flex: 0 0 auto;
}

.tdom-bb__intro-eyebrow {
	display: block;
	font-family: var(--mono, ui-monospace, monospace);
	font-size: 9px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(41, 43, 44, 0.5);
	margin-bottom: 2px;
}

.tdom-bb__intro-title {
	display: block;
	font-family: var(--display, var(--serif, Georgia, serif));
	font-size: 14px;
	font-weight: 500;
	color: var(--ink, #292b2c);
	letter-spacing: -0.005em;
	white-space: nowrap;
}

/* Date fields stretch to fill the available space between the intro and
 * the CTA group. Both internal padding (away from the divider line) AND
 * input padding-left (away from the icon) are generous so the date never
 * feels cramped against the calendar glyph. */
.tdom-bb__field {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 4px 22px 4px 24px;     /* 24 px from divider → icon */
	border-right: 1px solid rgba(41, 43, 44, 0.10);
}

.tdom-bb__form .tdom-bb__field:nth-of-type(2) {
	border-right: 0;
}

.tdom-bb__label {
	display: block;
	font-family: var(--mono, ui-monospace, monospace);
	font-size: 9px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(41, 43, 44, 0.5);
	margin-bottom: 5px;
}

.tdom-bb__input-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.tdom-bb__icon {
	position: absolute;
	left: 0;
	top: 50%;
	width: 15px;
	height: 15px;
	transform: translateY(-50%);
	color: var(--gold-deep, #0d6a39);
	opacity: 0.85;
	pointer-events: none;
}

/* Higher-specificity selector (`input.tdom-bb__input` = 2 classes + tag) +
 * `!important` on the critical box-model properties — third-party styles
 * (GeneratePress base form rules, plugin form CSS, WPForms, etc.) very
 * commonly target generic `input[type="text"]` with similar specificity
 * and would otherwise clobber our padding/height. */
input.tdom-bb__input,
.tdom-bb__form input.tdom-bb__input {
	width: 100%;
	padding: 1px 0 1px 36px !important;   /* 36 px from icon → date number */
	margin: 0 !important;
	border: 0 !important;
	background: transparent !important;
	font-family: var(--serif, Georgia, serif);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3 !important;
	color: var(--ink, #292b2c);
	cursor: pointer;
	letter-spacing: 0.005em;
	box-shadow: none !important;
	height: auto !important;
	min-height: 0 !important;
	box-sizing: border-box;
}

.tdom-bb__input:focus {
	outline: 0 !important;
	color: var(--gold-deep, #0d6a39);
}

.tdom-bb__input::placeholder {
	color: rgba(41, 43, 44, 0.35);
	font-weight: 400;
}

.tdom-bb__input:invalid {
	box-shadow: none !important;
}

/* ------------------------------------------------------------------ CTA group (nights + submit) */

.tdom-bb__cta {
	flex: 0 0 auto;
	display: flex;
	align-items: stretch;
	background: rgba(13, 106, 57, 0.06);
	border: 1px solid rgba(13, 106, 57, 0.10);
	border-radius: 10px;
	padding: 4px;
	gap: 4px;
}

.tdom-bb__cta .tdom-bb__nights {
	display: flex;
	align-items: center;          /* spans centered vertically inside nights */
	align-self: center;            /* nights centered vertically inside .tdom-bb__cta */
	justify-content: center;
	gap: 6px;
	padding: 0 16px;
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: var(--ink, #292b2c);
	user-select: none;
	line-height: 1;
}

.tdom-bb__nights-num {
	display: inline-flex;
	align-items: center;
	font-family: var(--display, var(--serif, Georgia, serif));
	font-size: 22px;
	font-weight: 400;
	line-height: 1;
	color: var(--gold-deep, #0d6a39);
	letter-spacing: -0.01em;
}

.tdom-bb__nights-lbl {
	display: inline-flex;
	align-items: center;
	font-family: var(--mono, ui-monospace, monospace);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(41, 43, 44, 0.6);
	line-height: 1;
}

/* ------------------------------------------------------------------ submit */

.tdom-bb__submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 22px;
	border: 0;
	border-radius: 8px;
	background: var(--gold-deep, #0d6a39);
	color: #fff;
	font-family: var(--sans, system-ui, sans-serif);
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
}

.tdom-bb__submit:hover {
	background: var(--gold, #12894a);
	box-shadow: 0 4px 14px rgba(13, 106, 57, 0.25);
}

.tdom-bb__submit:active {
	transform: translateY(1px);
}

.tdom-bb__submit-icon {
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

.tdom-bb__submit:hover .tdom-bb__submit-icon {
	transform: translateX(3px);
}

/* ------------------------------------------------------------------ flatpickr theme */

.flatpickr-calendar.tdom-bb-calendar {
	font-family: var(--sans, system-ui, sans-serif);
	border-radius: 12px;
	box-shadow:
		0 18px 40px rgba(0, 0, 0, 0.18),
		0 4px 12px  rgba(0, 0, 0, 0.10);
	border: 0;
}

.flatpickr-calendar.tdom-bb-calendar .flatpickr-day.selected,
.flatpickr-calendar.tdom-bb-calendar .flatpickr-day.startRange,
.flatpickr-calendar.tdom-bb-calendar .flatpickr-day.endRange {
	background: var(--gold-deep, #0d6a39);
	border-color: var(--gold-deep, #0d6a39);
	color: #fff;
}

.flatpickr-calendar.tdom-bb-calendar .flatpickr-day:hover {
	background: var(--paper-2, #efeae0);
}

.flatpickr-calendar.tdom-bb-calendar .flatpickr-day.today {
	border-color: var(--gold-deep, #0d6a39);
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
	.tdom-bb__intro {
		display: none;
	}
}

@media (max-width: 820px) {
	.tdom-bb__form {
		flex-wrap: wrap;
		gap: 6px;
		padding: 8px clamp(12px, 3vw, 16px);
	}

	.tdom-bb__field {
		flex: 1 1 calc(50% - 8px);
		min-width: 0;
		padding: 4px 14px;
	}

	.tdom-bb__form .tdom-bb__field:nth-of-type(1) {
		border-right: 1px solid rgba(41, 43, 44, 0.10);
	}

	.tdom-bb__cta {
		flex: 1 1 100%;
		margin-top: 4px;
	}

	.tdom-bb__cta .tdom-bb__nights {
		padding: 0 14px;
	}

	.tdom-bb__submit {
		flex: 1 1 auto;
		justify-content: center;
	}
}

@media (max-width: 540px) {
	.tdom-bb__input {
		font-size: 14px;
		padding-left: 30px;
	}

	.tdom-bb__nights-num {
		font-size: 18px;
	}
}
