/**
 * Booking Form Component
 *
 * Horizontal search bar with date picker, guest counter,
 * accommodation selector and search button.
 */

.booking-form {
	display: flex;
	gap: 24px;
	align-items: stretch;
}

/* --- Field base --- */

.booking-form__field {
	flex: 1;
	height: 62px;
	padding: 8px 12px;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	color: var(--wp--preset--color--tertiary);
	position: relative;
}

.booking-form__field-header {
	display: flex;
	align-items: center;
	gap: 8px;
}

.booking-form__icon {
	flex-shrink: 0;
	color: var(--wp--preset--color--tertiary);
}

.booking-form__field-label {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	color: var(--wp--preset--color--tertiary);
	line-height: 1.3;
}

/* --- Date field --- */

.booking-form__date-input {
	background: none;
	border: none;
	outline: none;
	color: var(--wp--preset--color--tertiary);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 300;
	padding: 0;
	cursor: pointer;
	width: 100%;
}

.booking-form__date-input::placeholder {
	color: var(--wp--preset--color--tertiary);
	opacity: 0.7;
}

/* --- Guests field --- */

.booking-form__field--guests {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
}

.booking-form__guests-controls {
	display: flex;
	align-items: center;
	gap: 6px;
}

.booking-form__guests-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	color: var(--wp--preset--color--accent);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.booking-form__guests-input {
	background: none;
	border: none;
	outline: none;
	color: var(--wp--preset--color--tertiary);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	width: 28px;
	text-align: center;
	padding: 0;
	-moz-appearance: textfield;
}

.booking-form__guests-input::-webkit-inner-spin-button,
.booking-form__guests-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* --- Accommodation field --- */

.booking-form__select-wrap {
	position: relative;
}

.booking-form__select-trigger {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	color: var(--wp--preset--color--tertiary);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 300;
	text-align: left;
	width: 100%;
}

.booking-form__select-dropdown {
	position: absolute;
	top: calc(100% + 16px);
	left: -12px;
	right: -12px;
	background: var(--wp--preset--color--tertiary);
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	list-style: none;
	margin: 0;
	padding: 8px 0;
	z-index: 50;
	max-height: 240px;
	overflow-y: auto;
}

.booking-form__select-option {
	padding: 10px 16px;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	color: var(--wp--preset--color--corporativo-01);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.booking-form__select-option:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

.booking-form__select-option.is-selected {
	color: var(--wp--preset--color--accent);
}

/* --- Search button --- */

.booking-form__submit {
	flex-shrink: 0;
	width: 62px;
	height: 62px;
	background-color: var(--wp--preset--color--accent);
	border: none;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--tertiary);
	transition: background-color 0.3s ease;
}

.booking-form__submit:hover {
	background-color: var(--wp--preset--color--corporativo-01);
}

/* --- Flatpickr theme overrides --- */

.flatpickr-calendar {
	font-family: var(--wp--preset--font-family--body);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	border: none;
}

.flatpickr-months .flatpickr-month {
	background: var(--wp--preset--color--corporativo-01);
	color: var(--wp--preset--color--tertiary);
	border-radius: 12px 12px 0 0;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
	color: var(--wp--preset--color--tertiary);
	font-weight: 500;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
	fill: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--tertiary);
}

span.flatpickr-weekday {
	color: var(--wp--preset--color--corporativo-01);
	font-weight: 500;
}

.flatpickr-day {
	border-radius: 6px;
	color: var(--wp--preset--color--corporativo-01);
}

.flatpickr-day:hover {
	background: var(--wp--preset--color--tertiary);
	border-color: var(--wp--preset--color--secondary);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--tertiary);
}

.flatpickr-day.inRange {
	background: rgba(227, 104, 43, 0.15);
	border-color: transparent;
	box-shadow: -5px 0 0 rgba(227, 104, 43, 0.15), 5px 0 0 rgba(227, 104, 43, 0.15);
}

/* --- Responsive --- */

@media (max-width: 782px) {
	.booking-form {
		flex-direction: column;
		gap: 12px;
	}

	.booking-form__field {
		width: 100%;
	}

	.booking-form__submit {
		width: 100%;
	}

	.booking-form__select-dropdown {
		left: 0;
		right: 0;
	}
}
