/* onwardsky/booking-form: V9 hero form card. Values come from the V9 source. */

.os-book {
	position: relative;
	flex: 1 1 380px;
	min-width: 0;
	max-width: 100%;
	/* V9 sets no body line-height, so the card uses the browser's "normal". */
	line-height: normal;
}

@media (min-width: 1024px) {
	.os-book {
		max-width: 460px;
	}
}

.os-book .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Decorative map artwork, three placements as in V9. */
.os-book__art {
	position: absolute;
	z-index: 0;
	pointer-events: none;
}

.os-book__art picture {
	display: contents;
}

.os-book__art img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
}

@media (min-width: 1024px) {
	.os-book__art {
		--w: clamp(920px, 66vw, 980px);
		left: 50%;
		bottom: calc(var(--w) * -0.107);
		width: var(--w);
		margin-left: calc(var(--w) * -0.55);
		-webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 12%, #000 21%);
		mask-image: linear-gradient(90deg, transparent 0, transparent 12%, #000 21%);
	}
}

@media (min-width: 1200px) {
	.os-book__art {
		-webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .35) 10%, #000 21%);
		mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .35) 10%, #000 21%);
	}
}

@media (min-width: 720px) and (max-width: 1023.98px) {
	.os-book__art {
		right: -24px;
		bottom: calc(100% - 30px);
		width: min(600px, 72vw);
		-webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 52%, #000 66%);
		mask-image: linear-gradient(90deg, transparent 0, transparent 52%, #000 66%);
	}
}

@media (max-width: 719.98px) {
	.os-book__art {
		inset: -20px -40px -40px;
		/* The map is bottom-anchored and painted before the form is parsed. Starting
		   at the form's final height keeps it from moving (0.1 CLS) as the form arrives. */
		min-height: 559px;
		background: radial-gradient(ellipse 90% 62% at 60% 52%, rgba(189, 225, 223, .6) 0, rgba(231, 243, 243, .55) 48%, rgba(231, 243, 243, 0) 80%);
		-webkit-mask-image: linear-gradient(180deg, #000 0, #000 78%, transparent 100%);
		mask-image: linear-gradient(180deg, #000 0, #000 78%, transparent 100%);
	}

	.os-book__art img {
		display: none;
	}

	/* Masks, not an image: the card hides most of this map, so it should not count as the page's largest paint. */
	.os-book__art::before,
	.os-book__art::after {
		content: "";
		position: absolute;
		right: -170px;
		bottom: -70px;
		width: 560px;
		height: 328px;
		-webkit-mask: 0 0 / 100% 100% no-repeat;
		mask: 0 0 / 100% 100% no-repeat;
	}

	.os-book__art::before {
		background: #0b283d;
		-webkit-mask-image: url(../../assets/images/hero-map-mobile-v3.svg);
		mask-image: url(../../assets/images/hero-map-mobile-v3.svg);
	}

	.os-book__art::after {
		background: #000;
		-webkit-mask-image: url(../../assets/images/hero-map-mobile-v3-routes.svg);
		mask-image: url(../../assets/images/hero-map-mobile-v3-routes.svg);
	}
}

@media (max-width: 415.98px) {
	.os-book__art {
		min-height: 580px;
	}
}

.os-book__glow {
	position: absolute;
	z-index: 1;
	inset: 0;
	border-radius: 16px;
	box-shadow: var(--wp--custom--glow);
	pointer-events: none;
}

/* Card */
.os-book__card {
	position: relative;
	z-index: 2;
	margin: 0;
	padding: clamp(18px, 2.4vw, 28px);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--card);
}

.os-book__title {
	margin: 0 0 14px;
	font-size: 19px;
	font-weight: 700;
	color: var(--wp--preset--color--heading);
}

/* Trip type: native radios styled as V9's segmented control. */
.os-book__trip {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
	margin: 0;
	padding: 4px;
	border: 0;
	border-radius: 8px;
	background: var(--wp--preset--color--surface-alt);
}

.os-book__trip-option {
	position: relative;
	display: block;
}

.os-book__trip-option input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.os-book__trip-option span {
	display: grid;
	place-items: center;
	height: 44px;
	border-radius: 6px;
	font-size: var(--wp--preset--font-size--ui);
	font-weight: 600;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
}

@media (min-width: 720px) {
	.os-book__trip-option span {
		height: 40px;
	}
}

.os-book__trip-option input:checked + span {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--heading);
	box-shadow: 0 1px 2px rgba(14, 47, 52, .10), 0 0 0 1px #D1E1E1;
}

.os-book__trip-option input:focus-visible + span {
	outline: 3px solid var(--wp--preset--color--accent-bright);
	outline-offset: 2px;
}

/* Joined From/To box */
.os-book__route {
	position: relative;
	margin-top: 12px;
	border: 1px solid var(--wp--preset--color--border-strong);
	border-radius: 8px;
}

.os-book__route-line {
	position: absolute;
	top: 30px;
	bottom: 30px;
	left: 20px;
	width: 2px;
	background: var(--wp--preset--color--border-strong);
}

.os-book__field {
	position: relative;
	min-width: 0;
}

.os-book__control {
	position: relative;
	display: block;
	margin: 0;
	cursor: text;
}

.os-book__field--route .os-book__control {
	padding: 9px 60px 9px 44px;
}

.os-book__field--route + .os-book__field--route {
	border-top: 1px solid var(--wp--preset--color--divider);
}

.os-book__dot {
	position: absolute;
	top: 50%;
	left: 15px;
	width: 12px;
	height: 12px;
	margin-top: -6px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
}

.os-book__field--route:first-of-type .os-book__dot {
	border: 2.5px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--base);
}

.os-book__label {
	display: block;
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
	color: var(--wp--preset--color--muted);
}

.os-book__input {
	display: block;
	width: 100%;
	margin: 0;
	padding: 2px 0 0;
	border: 0;
	outline: none;
	background: transparent;
	font-size: 16px;
	font-weight: 500;
	color: var(--wp--preset--color--ink);
	box-shadow: none;
}

.os-book__field--route .os-book__input {
	font-size: 17px;
}

.os-book__input::placeholder {
	color: #7A8E91;
	opacity: 1;
}

.os-book__input--date {
	min-height: 26px;
	font-size: 15.5px;
}

/* V9 inputs carry no outline, so focus is shown on the field instead. */
.os-book__field :is(input, select):focus-visible {
	outline: none;
}

.os-book__field--route:focus-within {
	z-index: 3;
	border-radius: 7px;
	box-shadow: 0 0 0 3px var(--wp--preset--color--accent-bright);
}

.os-book__swap {
	position: absolute;
	z-index: 4;
	top: 50%;
	right: 10px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--border-strong);
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent);
	transform: translateY(-50%);
	cursor: pointer;
}

/* The "From" list opens over the swap button's lower half. */
.os-book__route:has(#osb-from0-list:not([hidden])) > .os-book__swap {
	opacity: 0;
	pointer-events: none;
}

.os-book__swap::before {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: url(../../assets/images/icon-swap.svg) center / contain no-repeat;
	mask: url(../../assets/images/icon-swap.svg) center / contain no-repeat;
}

.os-book__swap:hover {
	border-color: var(--wp--preset--color--accent);
}

/* Boxed fields: dates, passengers, extra flights */
.os-book__grid,
.os-book__leg-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-top: 10px;
}

.os-book__ret {
	display: contents;
}

.os-book__ret[hidden],
.os-book__leg[hidden],
.os-book__add-leg[hidden],
.os-book__leg-remove[hidden] {
	display: none;
}

.os-book__field--box > .os-book__control {
	padding: 9px 12px;
	border: 1px solid var(--wp--preset--color--border-strong);
	border-radius: 8px;
	background: var(--wp--preset--color--base);
}

.os-book__field--box:focus-within > .os-book__control {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 2px var(--wp--preset--color--accent-bright);
}

.os-book__pax.is-full {
	grid-column: 1 / -1;
}

.os-book__select {
	min-height: 26px;
	padding-right: 22px;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

.os-book__pax .os-book__control::after {
	content: "";
	position: absolute;
	right: 12px;
	bottom: 14px;
	width: 16px;
	height: 16px;
	background: var(--wp--preset--color--muted);
	-webkit-mask: url(../../assets/images/icon-caret.svg) center / contain no-repeat;
	mask: url(../../assets/images/icon-caret.svg) center / contain no-repeat;
	pointer-events: none;
}

.os-book__leg-grid .os-book__field--box:nth-of-type(3) {
	grid-column: 1 / -1;
}

.os-book__leg-remove {
	grid-column: 1 / -1;
	justify-self: end;
	margin: -2px 0 0;
	padding: 4px 0;
	border: 0;
	background: none;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--muted);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.os-book__leg-remove:hover {
	color: var(--wp--preset--color--heading);
}

.os-book__add-leg {
	width: 100%;
	min-height: 44px;
	margin-top: 10px;
	border: 1.5px dashed #9DCACC;
	border-radius: 8px;
	background: #F5FAFA;
	font-size: var(--wp--preset--font-size--ui);
	font-weight: 600;
	color: var(--wp--preset--color--accent);
	cursor: pointer;
}

.os-book__add-leg:hover {
	border-color: var(--wp--preset--color--accent);
}

/* Suggestions (not drawn in V9; built from V9 tokens). */
.os-book__options {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	right: 0;
	left: 0;
	max-height: 320px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	list-style: none;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	background: var(--wp--preset--color--base);
	box-shadow: 0 1px 2px rgba(14, 47, 52, .06), 0 18px 36px -18px rgba(14, 47, 52, .35);
}

.os-book__option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 6px;
	cursor: pointer;
}

.os-book__option:hover,
.os-book__option.is-active {
	background: var(--wp--preset--color--surface);
}

.os-book__opt-flag {
	flex: none;
	font-size: 18px;
	line-height: 1;
}

.os-book__opt-name {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.os-book__opt-city {
	overflow: hidden;
	font-size: var(--wp--preset--font-size--ui);
	font-weight: 600;
	color: var(--wp--preset--color--ink);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.os-book__opt-country {
	font-size: 13px;
	color: var(--wp--preset--color--muted);
}

.os-book__opt-code {
	flex: none;
	font-size: 13px;
	font-weight: 700;
	color: var(--wp--preset--color--accent);
}

/* Errors (not drawn in V9; pressed-orange text, 7:1 on white). */
.os-book__error,
.os-book__form-error {
	margin: 4px 0 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--wp--preset--color--cta-active);
}

.os-book__field--route .os-book__error {
	margin: 0;
	padding: 0 60px 8px 44px;
}

.os-book__field--box [aria-invalid="true"] {
	color: var(--wp--preset--color--ink);
}

.os-book__field--box:has([aria-invalid="true"]) > .os-book__control,
.os-book__route:has(.os-book__field--route [aria-invalid="true"]) {
	border-color: var(--wp--preset--color--cta-active);
}

.os-book__form-error {
	margin-top: 12px;
}

/* Price line */
.os-book__price {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 18px 0 10px;
}

.os-book__from {
	font-size: var(--wp--preset--font-size--ui);
	color: var(--wp--preset--color--muted);
}

.os-book__from strong {
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--wp--preset--color--heading);
}

.os-book__delivery {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--accent);
}

/* CTA: inherits the theme.json button element, sized as in V9. */
.os-book__submit.wp-element-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 58px;
	padding: 0 24px;
	font-size: 18px;
	cursor: pointer;
}

.os-book__submit::after {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: url(../../assets/images/icon-arrow.svg) center / contain no-repeat;
	mask: url(../../assets/images/icon-arrow.svg) center / contain no-repeat;
}

.os-book__trust {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 12px;
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--muted);
	text-align: center;
	white-space: nowrap;
}

.os-book__trust-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.os-book__trust-item::before {
	content: "";
	flex: none;
	width: 15px;
	height: 15px;
	background: currentColor;
	-webkit-mask: url(../../assets/images/icon-lock.svg) center / contain no-repeat;
	mask: url(../../assets/images/icon-lock.svg) center / contain no-repeat;
}

.os-book__trust-item--mail::before {
	-webkit-mask-image: url(../../assets/images/icon-mail.svg);
	mask-image: url(../../assets/images/icon-mail.svg);
}

.os-book__payments {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.os-book__pay {
	display: inline-flex;
	align-items: center;
	height: 24px;
	padding: 0 8px;
	border: 1px solid #DCE4E4;
	border-radius: 5px;
	font-size: 12.5px;
	font-style: italic;
	font-weight: 800;
	line-height: 1;
}

.os-book__pay--paypal span:first-child { color: #003087; }
.os-book__pay--paypal span:last-child { color: #0079C1; }
.os-book__pay--upi span:first-child { color: #F26B21; }
.os-book__pay--upi span:last-child { color: #1B7F3B; }

.os-book__pay--stripe {
	font-size: 13.5px;
	font-style: normal;
	letter-spacing: -.01em;
	color: #635BFF;
}

.os-book__pay--upi {
	letter-spacing: .02em;
}

.os-book__pay--visa {
	color: #1A1F71;
}

/* Logo-only badge; the word stays available to screen readers. */
.os-book__pay--mastercard {
	padding: 0 7px;
	font-size: 0;
}

.os-book__pay--mastercard::before {
	content: "";
	width: 26px;
	height: 16px;
	background: url(../../assets/images/mastercard.svg) center / contain no-repeat;
}

/* Sticky mobile bar, shown once the card has scrolled off screen. */
.os-book__sticky {
	position: fixed;
	z-index: 70;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--base);
	box-shadow: 0 -10px 30px -18px rgba(14, 47, 52, .4);
}

.os-book__sticky[hidden] {
	display: none;
}

@media (min-width: 720px) {
	.os-book__sticky {
		display: none;
	}
}

.os-book__sticky-price {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.2;
	color: var(--wp--preset--color--muted);
}

.os-book__sticky-price strong {
	display: block;
	font-size: 19px;
	color: var(--wp--preset--color--heading);
}

.os-book__sticky-cta.wp-element-button {
	flex: 1;
	height: 52px;
	padding: 0 16px;
	font-size: var(--wp--preset--font-size--large);
	cursor: pointer;
}
