/**
 * Booking bar (inc/elementor/booking-form.php): the boxed fields (.ct-book-field) and the three
 * looks of Figma "M16 Booking bar" (.ct-bookbar--hero, --plain, --card), shared by the Hero,
 * the Booking bar widget, the Villas comparison and the villa pages' booking card.
 */

/* ------------------------------------------------------------------ */
/* Booking fields                                                     */
/* ------------------------------------------------------------------ */

.ct-book-field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	color: var(--ct-c-earth);
}

.ct-book-field__icon,
.ct-book-field__chevron {
	flex: none;
	width: 24px;
	height: 24px;
}

.ct-book-field__chevron {
	color: var(--ct-c-muted);
	pointer-events: none;
}

.ct-book-field__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.ct-book-field__label {
	color: var(--ct-c-muted);
	cursor: pointer;
}

.ct-book-field__value {
	display: none;
	margin-top: 2px;
	overflow: hidden;
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ct-book-field__note {
	position: relative;
	font-size: var(--ct-fs-small);
	line-height: var(--ct-lh-small);
}

/* Without JavaScript the native controls show as they are. */
.ct-book-field__control {
	max-width: 100%;
	min-height: 32px;
	margin-top: 4px;
	color: inherit;
	font-family: var(--ct-sans);
	font-size: 16px;
	line-height: 24px;
}

/* With JavaScript: the chosen value is shown as text and the native control lies over the box. */
.ct-js .ct-book-field__value {
	display: block;
}

.ct-js .ct-book-field__control {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.ct-js .ct-book-field__date::-webkit-calendar-picker-indicator {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.ct-book-field:focus-within {
	outline: 2px solid var(--ct-c-earth);
	outline-offset: 2px;
}

/* Small select inside the dates box ("3 nights"); it sits above the date input. */
.ct-book-field__nights {
	z-index: 2;
	align-self: flex-start;
}

.ct-book-field__nights select {
	margin: 0;
	padding: 0 18px 0 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-family: var(--ct-sans);
	font-size: inherit;
	line-height: inherit;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.ct-book-field__nights select:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* The bar: shared                                                    */
/* ------------------------------------------------------------------ */

.ct-bookbar {
	border: 1px solid var(--ct-c-line);
	background: var(--ct-c-paper);
	color: var(--ct-c-earth);
}

.ct-bookbar__fields {
	min-width: 0;
}

.ct-bookbar .ct-bookbar__submit {
	flex: none;
}

.ct-bookbar__note {
	flex-basis: 100%;
}

/* ------------------------------------------------------------------ */
/* Hero look: rounded, icons, chevrons and dividers (Home)            */
/* ------------------------------------------------------------------ */

.ct-bookbar--hero {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 12px;
	padding: 12px 20px;
	border-radius: var(--ct-radius-panel);
}

.ct-bookbar--hero .ct-bookbar__fields {
	display: flex;
	flex: 1;
}

.ct-bookbar--hero .ct-bookbar__field {
	flex: 1 1 0;
	min-height: 88px;
	padding: 12px 16px;
	border-radius: var(--ct-radius-control);
}

/* 1px dividers, 64 tall, between the fields. */
.ct-bookbar--hero .ct-bookbar__field + .ct-bookbar__field::before {
	content: "";
	position: absolute;
	top: 12px;
	bottom: 12px;
	left: 0;
	width: 1px;
	background: var(--ct-c-line);
}

.ct-bookbar--hero .ct-book-field__label {
	text-transform: none;
}

.ct-bookbar--hero .ct-book-field__value {
	font-size: 17px;
	line-height: 26px;
	font-weight: 500;
}

.ct-bookbar--hero .ct-bookbar__submit {
	width: 220px;
}

/* ------------------------------------------------------------------ */
/* Plain look: square, labels and values (Villas)                     */
/* ------------------------------------------------------------------ */

.ct-bookbar--plain {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: center;
	gap: 16px;
	padding: 24px;
}

.ct-bookbar--plain .ct-bookbar__fields,
.ct-bookbar--card .ct-bookbar__fields {
	display: contents;
}

.ct-bookbar--plain .ct-bookbar__field,
.ct-bookbar--card .ct-bookbar__field {
	min-height: 64px;
}

.ct-bookbar--plain .ct-book-field__body,
.ct-bookbar--card .ct-book-field__body {
	gap: 4px;
}

.ct-bookbar--plain .ct-book-field__value,
.ct-bookbar--card .ct-book-field__value {
	display: flex;
	align-items: center;
	min-height: 44px;
	margin-top: 0;
}

.ct-bookbar--plain .ct-bookbar__submit {
	width: 100%;
}

/* ------------------------------------------------------------------ */
/* Card look: price line, stacked fields, full-width button (villas)  */
/* ------------------------------------------------------------------ */

.ct-bookbar--card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
}

.ct-bookbar__price {
	margin: 0;
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
}

.ct-bookbar--card .ct-bookbar__submit {
	width: 100%;
}

/* ------------------------------------------------------------------ */
/* Tablet                                                             */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	/* Hero: three fields in a row, the button full width under them. */
	.ct-bookbar--hero {
		gap: 8px;
		padding: 12px 20px 16px;
	}

	.ct-bookbar--hero .ct-bookbar__fields {
		flex-basis: 100%;
	}

	.ct-bookbar--hero .ct-bookbar__field {
		min-height: 76px;
		padding: 10px 12px;
		gap: 10px;
	}

	.ct-bookbar--hero .ct-bookbar__field + .ct-bookbar__field::before {
		top: 10px;
		bottom: 10px;
	}

	.ct-bookbar--hero .ct-book-field__value {
		font-size: 16px;
		line-height: 24px;
	}

	.ct-bookbar--hero .ct-bookbar__submit {
		width: 100%;
	}
}

/* ------------------------------------------------------------------ */
/* Phone                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	/* Hero: fields stacked with rules between them. */
	.ct-bookbar--hero .ct-bookbar__fields {
		flex-direction: column;
	}

	.ct-bookbar--hero .ct-bookbar__field + .ct-bookbar__field::before {
		top: 0;
		right: 0;
		bottom: auto;
		left: 0;
		width: auto;
		height: 1px;
	}

	/* Plain: fields stacked, then the button. */
	.ct-bookbar--plain {
		grid-template-columns: minmax(0, 1fr);
	}
}
