/**
 * Flight Search Widget — v2 pill layout styles
 * Namespaced with `.fsw-` prefix throughout to avoid collisions with theme/
 * page-builder CSS.
 *
 * Colors come from the site's own --accent / --dark-btn custom properties
 * (defined in :root by the theme). Fallback hex values match what was
 * supplied: --accent: #ff5722, --dark-btn: #f83c00.
 */

.fsw-widget {
	--fsw-accent: var(--accent, #ff5722);
	--fsw-accent-dark: var(--dark-btn, #f83c00);
	--fsw-navy: #15233b;
	--fsw-border: #e2e8f0;
	--fsw-text: #1e293b;
	--fsw-muted: #64748b;
	--fsw-bg: #ffffff;

	max-width: 1180px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	color: var(--fsw-text);
	box-sizing: border-box;
}

.fsw-widget *,
.fsw-widget *::before,
.fsw-widget *::after {
	box-sizing: border-box;
}

/* ---- Trip type floating pill ---- */
.fsw-trip-pill {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 2px;
	width: max-content;
	margin: 0 auto 18px;
	background: var(--fsw-accent);
	border-radius: 999px;
	padding: 4px;
}

.fsw-trip-opt {
	border: 0;
	background: transparent;
	color: #fff;
	padding: 9px 22px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 999px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.fsw-trip-opt.is-active {
	background: #fff;
	color: var(--fsw-text);
}

.fsw-trip-opt:hover:not(.is-active) {
	background: rgba(255, 255, 255, 0.15);
}

/* ---- Main pill bar ---- */
.fsw-bar {
	position: relative;
	display: flex;
	align-items: stretch;
	background: var(--fsw-bg);
	border-radius: 999px;
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
	padding: 10px 90px 10px 26px;
	gap: 0;
}

.fsw-seg {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 4px 18px;
	border-right: 1px solid #eef1f5;
}

.fsw-seg--travelers {
	border-right: 0;
	flex: 0 1 150px;
}

.fsw-seg-label {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--fsw-accent);
	margin-bottom: 4px;
}

.fsw-seg-label svg {
	flex-shrink: 0;
}

/* Text/airport inputs */
.fsw-seg input[type='text'] {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	border: 0;
	background: transparent;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--fsw-text);
}

.fsw-seg input[type='text']::placeholder {
	color: #94a3b8;
	font-weight: 700;
}

.fsw-seg input[type='text']:focus {
	outline: none;
}

/* Date + travelers "fake" display buttons — look like text, open native/pop controls */
.fsw-date-display,
.fsw-travelers-display {
	border: 0;
	background: transparent;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--fsw-text);
	text-align: left;
	cursor: pointer;
	width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fsw-date-native {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	width: 100%;
	height: 100%;
}

/* ---- Swap button (diamond) ---- */
.fsw-swap {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	margin: auto 0;
	border-radius: 9px;
	border: 1px solid var(--fsw-border);
	background: #fff;
	color: var(--fsw-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transform: rotate(45deg);
	transition: background 0.15s ease, transform 0.2s ease;
	z-index: 2;
}

.fsw-swap svg {
	transform: rotate(-45deg);
}

.fsw-swap:hover {
	background: #fff1ec;
	transform: rotate(225deg);
}

/* ---- Search circle button ---- */
.fsw-submit-circle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: 0;
	background: linear-gradient(180deg, var(--fsw-accent) 0%, var(--fsw-accent-dark) 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(248, 60, 0, 0.35);
	transition: filter 0.15s ease, transform 0.05s ease;
}

.fsw-submit-circle:hover {
	filter: brightness(1.05);
}

.fsw-submit-circle:active {
	transform: translateY(-50%) scale(0.96);
}

/* ---- Autocomplete suggestions ---- */
.fsw-suggestions {
	display: none;
	position: absolute;
	top: calc(100% + 14px);
	left: 0;
	min-width: 300px;
	background: #fff;
	border: 1px solid var(--fsw-border);
	border-radius: 10px;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
	max-height: 320px;
	overflow-y: auto;
	z-index: 60;
}

.fsw-suggestions.is-open {
	display: block;
}

.fsw-suggestion {
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid #f1f5f9;
}

.fsw-suggestion:last-child {
	border-bottom: 0;
}

.fsw-suggestion:hover,
.fsw-suggestion.is-active {
	background: #fff1ec;
}

.fsw-suggestion-main {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
}

.fsw-suggestion-code {
	background: var(--fsw-navy);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px;
	letter-spacing: 0.03em;
	flex-shrink: 0;
}

.fsw-suggestion-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fsw-suggestion-sub {
	font-size: 12px;
	color: var(--fsw-muted);
	margin-top: 2px;
	margin-left: 34px;
}

.fsw-suggestion mark {
	background: #ffe0d1;
	color: inherit;
	border-radius: 2px;
	padding: 0 1px;
}

.fsw-no-results {
	padding: 14px;
	font-size: 13px;
	color: var(--fsw-muted);
	text-align: center;
}

/* ---- Travelers popover ---- */
.fsw-travelers-pop {
	display: none;
	position: absolute;
	top: calc(100% + 14px);
	right: 0;
	width: 260px;
	background: #fff;
	border: 1px solid var(--fsw-border);
	border-radius: 12px;
	box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
	padding: 18px;
	z-index: 70;
}

.fsw-travelers-pop.is-open {
	display: block;
}

.fsw-pax-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid #f1f5f9;
}

.fsw-pax-info {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.fsw-pax-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--fsw-text);
}

.fsw-pax-sub {
	font-size: 12px;
	color: var(--fsw-muted);
}

.fsw-stepper {
	display: flex;
	align-items: center;
	gap: 12px;
}

.fsw-step-btn {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid var(--fsw-border);
	background: #fff;
	color: var(--fsw-text);
	font-size: 16px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.fsw-step-btn:hover:not(:disabled) {
	background: #fff1ec;
	border-color: var(--fsw-accent);
	color: var(--fsw-accent);
}

.fsw-step-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.fsw-step-val {
	min-width: 14px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
}

.fsw-pax-class {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	border: 1px solid var(--fsw-border);
	background: #f8fafc;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--fsw-text);
	margin-top: 14px;
}

.fsw-pax-class:focus {
	outline: none;
	border-color: var(--fsw-accent);
}

.fsw-pax-done {
	width: 100%;
	margin-top: 14px;
	border: 0;
	background: linear-gradient(180deg, var(--fsw-accent) 0%, var(--fsw-accent-dark) 100%);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	padding: 11px;
	border-radius: 8px;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.fsw-pax-done:hover {
	filter: brightness(1.05);
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
	.fsw-bar {
		flex-wrap: wrap;
		border-radius: 20px;
		padding: 16px 16px 80px;
	}
	.fsw-seg {
		flex: 1 1 40%;
		border-right: 0;
		border-bottom: 1px solid #eef1f5;
		padding: 10px 4px;
	}
	.fsw-seg--travelers {
		flex: 1 1 100%;
		border-bottom: 0;
	}
	.fsw-swap {
		position: absolute;
		right: 4px;
		top: 16px;
		margin: 0;
	}
	.fsw-submit-circle {
		right: 50%;
		top: auto;
		bottom: 12px;
		transform: translate(50%, 0);
		width: 54px;
		height: 54px;
	}
	.fsw-submit-circle:active {
		transform: translate(50%, 0) scale(0.96);
	}
	.fsw-travelers-pop {
		right: auto;
		left: 0;
	}
}

@media (max-width: 560px) {
	.fsw-seg {
		flex: 1 1 100%;
		border-bottom: 1px solid #eef1f5;
	}
	.fsw-trip-pill {
		width: 100%;
	}
	.fsw-trip-opt {
		flex: 1;
	}
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.fsw-swap {
		transition: none;
	}
	.fsw-swap:hover {
		transform: rotate(45deg);
	}
}
