/* ==========================================================================
   Travel Months — the ONE shared month-range component (D290, D319).
   The two no-JavaScript month dropdowns, the "Travel Months" panel (a
   floating panel from 768px, a bottom sheet on phones) and its two-handle
   slider, used unchanged on the homepage and on Deal Discovery. The rules
   up to "Deal Discovery" were moved verbatim from home.css (D319); only the
   closed field differs per page, because each page keeps its approved
   field box. EXISTING TOKENS ONLY; no motion.
   ========================================================================== */

.fr-month-fallback {
	grid-column: 2;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--fr-space-2);
	min-width: 0;
}

.fr-month-fallback[hidden] {
	display: none;
}

.fr-month-fallback__item {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.fr-month-fallback__label {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--fr-g5-ink-muted);
}

.fr-month-fallback__select {
	width: 100%;
	min-width: 0;
	min-height: 44px;
	padding: 0 var(--fr-space-2);
	border: 1px solid var(--fr-g5-field-border);
	border-radius: var(--fr-radius-sm);
	background: var(--fr-surface);
	font-family: var(--fr-font-body);
	font-size: 0.85rem;
	color: var(--fr-g5-ink);
}

/* The panel: floating under the field on desktop, a bottom sheet on phones. */
.fr-month-panel {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1001;
	max-height: 88vh;
	overflow-y: auto;
	padding: var(--fr-space-2) var(--fr-space-4) calc(var(--fr-space-5) + env(safe-area-inset-bottom, 0px));
	background: var(--fr-surface);
	color: var(--fr-g5-ink);
	border-radius: 24px 24px 0 0;
	box-shadow: 0 -12px 40px rgba(0, 8, 32, 0.45);
	text-align: left;
}

.fr-month-panel[hidden],
.fr-month-backdrop[hidden] {
	display: none;
}

.fr-month-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 8, 32, 0.6);
}

.fr-month-sheet-open,
.fr-month-sheet-open body {
	overflow: hidden;
}

.fr-month-panel__grabber {
	width: 44px;
	height: 5px;
	margin: 0 auto var(--fr-space-2);
	border-radius: var(--fr-radius-pill);
	background: var(--fr-g5-field-border);
}

.fr-month-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--fr-space-3);
}

.fr-month-panel__title {
	margin: 0;
	font-family: var(--fr-font-g5-display);
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--fr-g5-ink);
}

.fr-month-panel__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: calc(-1 * var(--fr-space-2));
	border: 0;
	border-radius: var(--fr-radius-md);
	background: transparent;
	color: var(--fr-g5-ink);
	cursor: pointer;
}

.fr-month-panel__subtitle {
	margin: 0 0 var(--fr-space-4);
	font-size: 0.95rem;
	color: var(--fr-g5-ink-muted);
}

.fr-month-panel__values {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--fr-space-3);
	margin: 0 0 var(--fr-space-4);
}

.fr-month-panel__value {
	padding: var(--fr-space-2) var(--fr-space-3);
	border: 1px solid var(--fr-g5-field-border);
	border-radius: var(--fr-radius-md);
}

.fr-month-panel__value dt {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--fr-g5-ink-muted);
}

.fr-month-panel__value dd {
	margin: 2px 0 0;
	/* One line at every width, so the slider never moves under a finger
	   while the month names change. */
	font-size: clamp(0.85rem, 4.1vw, 1.05rem);
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--fr-g5-ink);
}

/* Two native range inputs over one track. Each 44px thumb is the touch
   target; its visible handle is the 26px white disc with a purple ring.
   --from/--to are fractions (0–1) of the handles' travel. */
.fr-month-slider {
	--from: 0;
	--to: 1;
	--thumb: 44px;
	position: relative;
	height: var(--thumb);
}

.fr-month-slider__track {
	position: absolute;
	top: 50%;
	left: calc(var(--thumb) / 2);
	right: calc(var(--thumb) / 2);
	height: 8px;
	transform: translateY(-50%);
	border-radius: var(--fr-radius-pill);
	background: var(--fr-g5-field-border);
}

.fr-month-slider__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc(100% * var(--from));
	width: calc(100% * (var(--to) - var(--from)));
	min-width: 8px;
	border-radius: var(--fr-radius-pill);
	background: var(--fr-g5-gradient-cta);
}

/* "Any month" is not a chosen range: a pale fill, and the text says so. */
.fr-month-slider--any .fr-month-slider__fill {
	opacity: 0.3;
}

.fr-month-slider__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	background: transparent;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.fr-month-slider__input:focus {
	outline: none;
}

.fr-month-slider__input::-webkit-slider-runnable-track {
	height: var(--thumb);
	background: transparent;
}

.fr-month-slider__input::-moz-range-track {
	height: var(--thumb);
	background: transparent;
}

.fr-month-slider__input::-webkit-slider-thumb {
	width: var(--thumb);
	height: var(--thumb);
	border: 0;
	border-radius: 50%;
	background: radial-gradient(circle, var(--fr-surface) 0 10px, var(--fr-g5-purple) 10.5px 13px, transparent 13.5px);
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
}

.fr-month-slider__input::-moz-range-thumb {
	width: var(--thumb);
	height: var(--thumb);
	border: 0;
	border-radius: 50%;
	background: radial-gradient(circle, var(--fr-surface) 0 10px, var(--fr-g5-purple) 10.5px 13px, transparent 13.5px);
	cursor: grab;
	pointer-events: auto;
}

.fr-month-slider__input:focus-visible::-webkit-slider-thumb {
	background: radial-gradient(circle, var(--fr-surface) 0 10px, var(--fr-g5-purple) 10.5px 13px, var(--fr-focus-ring) 13.5px 16px, transparent 16.5px);
}

.fr-month-slider__input:focus-visible::-moz-range-thumb {
	background: radial-gradient(circle, var(--fr-surface) 0 10px, var(--fr-g5-purple) 10.5px 13px, var(--fr-focus-ring) 13.5px 16px, transparent 16.5px);
}

.fr-month-slider__scale {
	position: relative;
	display: flex;
	justify-content: space-between;
	min-height: 20px;
	padding: 0 calc(var(--fr-space-2) + 2px);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--fr-g5-ink-muted);
}

.fr-month-slider__year {
	position: absolute;
	top: 0;
	left: calc(22px + (100% - 44px) * var(--pos));
	transform: translateX(-50%);
	padding-top: 6px;
	border-top: 2px solid var(--fr-g5-field-border);
	color: var(--fr-g5-ink-muted);
}

.fr-month-panel__status {
	/* Room for the longest status (three lines on a 320px phone), so the
	   sheet — anchored to the bottom — never grows under a dragging finger. */
	min-height: calc(3 * 1.45em);
	margin: var(--fr-space-3) 0 var(--fr-space-4);
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--fr-g5-ink);
}

.fr-month-panel__actions {
	display: flex;
	gap: var(--fr-space-3);
}

.fr-month-panel__reset {
	flex: 1 1 0;
	min-height: 48px;
	padding: 0 var(--fr-space-3);
	border: 1.5px solid var(--fr-g5-ink);
	border-radius: var(--fr-radius-md);
	background: transparent;
	font-family: var(--fr-font-body);
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--fr-g5-ink);
	cursor: pointer;
}

.fr-month-panel__confirm {
	flex: 1 1 0;
}

.fr-month-panel :focus-visible {
	outline: 2px solid var(--fr-focus-ring);
	outline-offset: 2px;
}

/* The focused handle carries its own navy ring (above), not the whole input. */
.fr-month-panel .fr-month-slider__input:focus-visible {
	outline: none;
}

@media (min-width: 768px) {
	.fr-month-panel {
		position: absolute;
		top: calc(100% + var(--fr-space-2));
		left: 0;
		right: auto;
		bottom: auto;
		z-index: 40;
		width: 400px;
		max-height: none;
		overflow: visible;
		padding: var(--fr-space-4) var(--fr-space-5) var(--fr-space-5);
		border-radius: var(--fr-radius-g5-card);
		box-shadow: 0 0 0 1px var(--fr-g5-field-border), 0 18px 40px rgba(0, 8, 32, 0.4);
	}

	.fr-month-panel--align-right {
		left: auto;
		right: 0;
	}

	.fr-month-panel__grabber,
	.fr-month-backdrop {
		display: none;
	}

	.fr-month-sheet-open,
	.fr-month-sheet-open body {
		overflow: visible;
	}
}


/* --- Deal Discovery (Gate 6 V2 bar) ----------------------------------------
   The closed field keeps the bar's borderless value and theme chevron, like
   the From / To buttons (location-picker.css); the panel opens under it. */

.fr-discovery-filters__field--month {
	position: relative;
}

.fr-month-trigger[hidden] {
	display: none;
}

.fr-month-trigger--discovery {
	grid-area: control;
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
	min-height: 44px;
	padding: 0 calc(4px + 7px + 8px) 0 0;
	border: 0;
	border-radius: var(--fr-radius-sm);
	background: transparent;
	font-family: var(--fr-font-body);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 44px;
	color: var(--fr-g5-ink);
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* V-4: the bar's one theme chevron, drawn like the From / To buttons'. */
.fr-month-trigger--discovery::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 4px;
	width: 7px;
	height: 7px;
	margin-top: -6px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.fr-discovery-filters__field > .fr-month-fallback {
	grid-column: 1 / -1;
	padding-bottom: var(--fr-space-2);
}

@media (min-width: 1200px) {
	.fr-month-trigger--discovery {
		font-size: 1rem;
	}

	/* Without JavaScript the two dropdowns sit under the label, as on the
	   homepage, so the single-row bar does not squeeze them. */
	.fr-discovery-filters__field--month:not(.fr-search-field--month-enhanced) {
		grid-template-columns: 20px minmax(0, 1fr);
		grid-template-areas:
			"icon label"
			"control control";
		padding-top: var(--fr-space-2);
	}

	.fr-discovery-filters__field > .fr-month-fallback {
		grid-column: auto;
		grid-area: control;
		padding: var(--fr-space-1) 0 var(--fr-space-2);
	}
}
