/*
 * 7th Sky Conditional Booking Forms — Instant Flight Request Form.
 * Compact one-line flight search bar, scoped to .ssbf-ifr.
 *
 * No colours are hard-coded here: every colour reads the same CSS variables
 * the widget's Elementor Style tab sets (Fields, Labels, Icons, Choice Cards,
 * Counters, Buttons), so everything is changed from the editor.
 */

.ssbf-ifr {
	--ifr-cell-h: 58px;
	--ifr-gap: 10px;
}

.ssbf-ifr [hidden] { display: none !important; }

/* ---------- Top row ---------- */

.ssbf-ifr__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}

.ssbf-ifr__trips { display: flex; gap: 8px; flex-wrap: wrap; }

.ssbf-ifr__trip,
.ssbf-ifr__class { position: relative; cursor: pointer; margin: 0; }

.ssbf-ifr__trip input,
.ssbf-ifr__class input,
.ssbf-ifr__flex input {
	position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}

.ssbf-ifr__trip span,
.ssbf-ifr__class span {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 6px;
	border: 1px solid var(--ssbf-card-border);
	background: var(--ssbf-card-bg);
	color: var(--ssbf-card-color);
	font-size: 14px;
	line-height: 1.3;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.ssbf-ifr__trip.is-active span,
.ssbf-ifr__class.is-active span {
	background: var(--ssbf-card-active-bg);
	border-color: var(--ssbf-card-active-bg);
	color: var(--ssbf-card-active-color);
}

.ssbf-ifr__trip input:focus-visible + span,
.ssbf-ifr__class input:focus-visible + span {
	outline: 2px solid var(--ssbf-field-border-focus);
	outline-offset: 2px;
}

.ssbf-ifr__flex {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 14px; cursor: pointer; margin: 0;
}

.ssbf-ifr__box {
	width: 16px; height: 16px; flex: 0 0 auto; position: relative;
	border: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
	border-radius: 3px;
	background: var(--ssbf-field-bg);
}

.ssbf-ifr__flex input:checked + .ssbf-ifr__box {
	background: var(--ssbf-card-active-bg);
	border-color: var(--ssbf-card-active-bg);
}

.ssbf-ifr__flex input:checked + .ssbf-ifr__box::after {
	content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
	border: solid var(--ssbf-card-active-color); border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------- Bar ---------- */

.ssbf-ifr__bar { display: flex; align-items: stretch; gap: var(--ifr-gap); }

.ssbf-ifr__group { display: flex; position: relative; min-width: 0; }
.ssbf-ifr__group--route { flex: 2 1 0; gap: var(--ifr-gap); }
.ssbf-ifr__group--pax   { flex: 1 1 0; }
.ssbf-ifr__group--phone { flex: 1 1 0; }

.ssbf-ifr__group--dates {
	flex: 1.6 1 0;
	border: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
	border-radius: var(--ssbf-field-radius);
	background: var(--ssbf-field-bg);
	overflow: hidden;
}

.ssbf-ifr__cell {
	flex: 1 1 0; min-width: 0;
	display: flex; align-items: center; gap: var(--ssbf-icon-gap);
	min-height: var(--ifr-cell-h);
	padding: 8px 12px;
	background: var(--ssbf-field-bg);
	border: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
	border-radius: var(--ssbf-field-radius);
	position: relative; text-align: left;
	font: inherit; color: var(--ssbf-field-color);
	transition: border-color 0.2s, background 0.2s;
}

.ssbf-ifr__cell:hover { border-color: var(--ssbf-field-border-hover); background: var(--ssbf-field-bg-hover); }

.ssbf-ifr__group--dates .ssbf-ifr__cell { border: 0; border-radius: 0; cursor: pointer; }
.ssbf-ifr__group--dates .ssbf-ifr__cell + .ssbf-ifr__cell {
	border-left: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
}

.ssbf-ifr__cell:focus-within,
.ssbf-ifr__pax-toggle[aria-expanded="true"],
.ssbf-ifr__group--dates:focus-within {
	border-color: var(--ssbf-field-border-focus);
	background: var(--ssbf-field-bg-focus);
}

.ssbf-ifr__cell.has-error,
.ssbf-ifr__multi.has-error textarea,
.ssbf-ifr__cfield.has-error input { border-color: var(--ssbf-error) !important; }

.ssbf-ifr__cell.is-disabled .ssbf-ifr__value { opacity: 0.5; }

.ssbf-ifr__icon {
	flex: 0 0 auto; display: inline-flex;
	color: var(--ssbf-icon-color);
	transition: color 0.2s;
}
.ssbf-ifr__cell:hover .ssbf-ifr__icon { color: var(--ssbf-icon-color-hover); }
.ssbf-ifr__cell:focus-within .ssbf-ifr__icon { color: var(--ssbf-icon-color-focus); }
.ssbf-ifr__icon svg { width: var(--ssbf-icon-size); height: var(--ssbf-icon-size); }

.ssbf-ifr__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }

/* Colour and margin of labels come from Style → Labels (.ssbf-label). */
.ssbf-ifr .ssbf-ifr__label {
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	margin: 0;
	opacity: 0.8;
}

.ssbf-ifr__value,
.ssbf-ifr .ssbf-ifr__input {
	font-size: 15px; line-height: 1.3; font-weight: 500;
	color: var(--ssbf-field-color);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ssbf-ifr .ssbf-ifr__input {
	width: 100%;
	border: 0 !important; outline: 0; box-shadow: none !important;
	background: transparent !important;
	padding: 0 !important; margin: 0;
	height: auto !important; min-height: 0 !important;
	font-family: inherit;
}

.ssbf-ifr .ssbf-ifr__input::placeholder { color: var(--ssbf-placeholder); opacity: 1; }

.ssbf-ifr__date {
	position: absolute; inset: 0; width: 100%; height: 100%;
	opacity: 0; cursor: pointer; border: 0; padding: 0; margin: 0;
}
.ssbf-ifr__date::-webkit-calendar-picker-indicator {
	position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer;
}

/* Swap */
.ssbf-ifr .ssbf-ifr__swap {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
	z-index: 2; width: 34px; height: 34px; border-radius: 50%; padding: 0;
	border: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
	background: var(--ssbf-field-bg);
	color: var(--ssbf-icon-color);
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer; transition: transform 0.3s, color 0.2s;
}
.ssbf-ifr .ssbf-ifr__swap:hover { color: var(--ssbf-icon-color-hover); }
.ssbf-ifr .ssbf-ifr__swap svg { width: 15px; height: 15px; }
.ssbf-ifr .ssbf-ifr__swap.is-flipped { transform: translate(-50%, -50%) rotate(180deg); }

.ssbf-ifr__group--route .ssbf-ifr__cell:first-child { padding-right: 24px; }
.ssbf-ifr__group--route .ssbf-ifr__cell:last-child  { padding-left: 22px; }

/* Passengers */
.ssbf-ifr__pax-toggle { cursor: pointer; width: 100%; }

.ssbf-ifr__pax {
	position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
	width: 300px; max-width: 90vw; padding: 12px;
	background: var(--ssbf-field-bg-focus);
	border: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
	border-radius: var(--ssbf-field-radius);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.ssbf-ifr__pax-row {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 7px 0;
	border-bottom: 1px solid var(--ssbf-field-border);
}
.ssbf-ifr__pax-row strong { display: block; font-size: 14px; font-weight: 600; }
.ssbf-ifr__pax-row small  { font-size: 12px; opacity: 0.7; }

.ssbf-ifr__counter { display: flex; align-items: center; gap: 4px; }

.ssbf-ifr .ssbf-ifr__step {
	width: 28px; height: 28px; padding: 0; border-radius: 50%;
	border: 1px solid var(--ssbf-counter-btn-border);
	background: var(--ssbf-counter-btn-bg);
	color: var(--ssbf-counter-btn-color);
	font-size: 16px; line-height: 1; cursor: pointer;
}
.ssbf-ifr .ssbf-ifr__step:hover {
	background: var(--ssbf-counter-btn-hover-bg);
	color: var(--ssbf-counter-btn-hover-color);
}

.ssbf-ifr .ssbf-ifr__counter input {
	width: 30px; text-align: center; padding: 0; border: 0;
	background: transparent; color: var(--ssbf-field-color);
	font-size: 14px; -moz-appearance: textfield;
}
.ssbf-ifr .ssbf-ifr__counter input::-webkit-inner-spin-button,
.ssbf-ifr .ssbf-ifr__counter input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.ssbf-ifr__classes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.ssbf-ifr__class span { display: block; text-align: center; padding: 6px; font-size: 13px; }

/* Search + Done use Style → Buttons (primary). */
.ssbf-ifr .ssbf-ifr__search,
.ssbf-ifr .ssbf-ifr__pax-done {
	border: 0; cursor: pointer; font-family: inherit;
	background: var(--ssbf-btn-bg);
	color: var(--ssbf-btn-color);
	border-radius: var(--ssbf-field-radius);
	transition: background 0.2s, color 0.2s;
}
.ssbf-ifr .ssbf-ifr__search:hover,
.ssbf-ifr .ssbf-ifr__pax-done:hover {
	background: var(--ssbf-btn-bg-hover);
	color: var(--ssbf-btn-color-hover);
}

.ssbf-ifr .ssbf-ifr__search {
	flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-width: 110px; padding: 0 18px;
	font-size: 16px; font-weight: 500;
}
.ssbf-ifr .ssbf-ifr__search svg { width: 18px; height: 18px; }
.ssbf-ifr .ssbf-ifr__search { white-space: nowrap; min-width: 150px; }
.ssbf-ifr .ssbf-consent { margin-top: 10px; }

.ssbf-ifr .ssbf-ifr__pax-done { width: 100%; padding: 8px; font-size: 14px; }

.ssbf-ifr__bar-error { margin: 8px 0 0; color: var(--ssbf-error); font-size: 13px; }

/* Multi city / advanced / contact inputs */
.ssbf-ifr__multi { margin-top: 10px; }

.ssbf-ifr__multi textarea,
.ssbf-ifr__adv select,
.ssbf-ifr__adv input,
.ssbf-ifr__cfield input {
	width: 100%; margin-top: 4px; padding: 8px 12px;
	border: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
	border-radius: var(--ssbf-field-radius);
	background: var(--ssbf-field-bg);
	color: var(--ssbf-field-color);
	font: inherit; font-size: 14px;
}
.ssbf-ifr__adv select,
.ssbf-ifr__adv input,
.ssbf-ifr__cfield input { height: 40px; }

.ssbf-ifr__multi textarea:focus,
.ssbf-ifr__adv select:focus,
.ssbf-ifr__adv input:focus,
.ssbf-ifr__cfield input:focus {
	outline: 0;
	border-color: var(--ssbf-field-border-focus);
	background: var(--ssbf-field-bg-focus);
}

.ssbf-ifr .ssbf-ifr__adv-toggle {
	display: inline-flex; align-items: center; gap: 6px;
	margin-top: 10px; padding: 2px 4px;
	border: 0; background: transparent; color: inherit;
	font: inherit; font-size: 14px; cursor: pointer;
}
.ssbf-ifr__adv-toggle svg { width: 14px; height: 14px; transition: transform 0.25s; }
.ssbf-ifr__adv-toggle.is-open svg { transform: rotate(180deg); }

.ssbf-ifr__adv {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--ifr-gap); margin-top: 8px;
}

.ssbf-ifr__contact {
	margin-top: 14px; padding: 14px;
	border: var(--ssbf-field-border-w) solid var(--ssbf-field-border);
	border-radius: var(--ssbf-field-radius);
	animation: ssbf-ifr-in 0.25s ease;
}
@keyframes ssbf-ifr-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.ssbf-ifr__contact-head {
	display: flex; justify-content: space-between; align-items: center; gap: 10px;
	margin-bottom: 10px; font-size: 15px;
}
.ssbf-ifr .ssbf-ifr__contact-close {
	border: 0; background: transparent; color: inherit; cursor: pointer;
	padding: 2px; display: inline-flex;
}
.ssbf-ifr .ssbf-ifr__contact-close svg { width: 16px; height: 16px; }

.ssbf-ifr__contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ifr-gap); }

.ssbf-ifr .ssbf-req { color: var(--ssbf-error); }
.ssbf-ifr .ssbf-consent { margin-top: 10px; }
.ssbf-ifr .ssbf-form-error { margin: 10px 0 0; color: var(--ssbf-error); }
.ssbf-ifr__contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ssbf-ifr .ssbf-ifr__search.is-loading,
.ssbf-ifr .ssbf-btn.is-loading { opacity: 0.6; pointer-events: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
	.ssbf-ifr__bar { flex-wrap: wrap; }
	.ssbf-ifr__group--route { flex: 1 1 100%; }
	.ssbf-ifr__group--dates { flex: 1 1 calc(60% - 5px); }
	.ssbf-ifr__group--pax   { flex: 1 1 calc(40% - 5px); }
	.ssbf-ifr__group--phone { flex: 1 1 100%; }
	.ssbf-ifr .ssbf-ifr__search { flex: 1 1 100%; min-height: 46px; }
	.ssbf-ifr__adv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
	.ssbf-ifr__group--route { flex-direction: column; gap: 6px; }
	.ssbf-ifr__group--route .ssbf-ifr__cell:first-child,
	.ssbf-ifr__group--route .ssbf-ifr__cell:last-child { padding: 8px 50px 8px 12px; }
	.ssbf-ifr .ssbf-ifr__swap { left: auto; right: 10px; transform: translateY(-50%) rotate(90deg); }
	.ssbf-ifr .ssbf-ifr__swap.is-flipped { transform: translateY(-50%) rotate(270deg); }
	.ssbf-ifr__group--dates,
	.ssbf-ifr__group--pax,
	.ssbf-ifr__group--phone { flex: 1 1 100%; }
	.ssbf-ifr__pax { left: 0; right: 0; width: auto; }
	.ssbf-ifr__adv,
	.ssbf-ifr__contact-grid { grid-template-columns: 1fr; }
}
