/* ══════════════════════════════════════════════
   DEMO LIFESTYLE — Flight Booking Page
   ══════════════════════════════════════════════ */

/* ── Layout ── */
.fb-layout {
  display: flex; flex-direction: column; gap: var(--space-md);
  max-width: 820px; margin: 0 auto;
  padding-bottom: var(--space-xl);
}

/* ── Offer Reminder Strip ── */
.fb-offer-strip {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  box-shadow: var(--shadow-soft);
}
.fb-offer-strip__badge {
  background: var(--accent); color: var(--white);
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--radius-full);
  white-space: nowrap;
}
.fb-offer-strip__text {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-offer-strip__airline {
  font-size: 13px; font-weight: 700; color: var(--grey);
  white-space: nowrap;
}

/* ── Search Card ── */
.fb-search-card { padding: 24px; }
.fb-search-card .hb-card__title {
  display: flex; align-items: center; gap: 8px;
}

/* ── Trip Type Toggle ── */
.fb-trip-toggle {
  display: flex; gap: 0;
  background: var(--light); border-radius: var(--radius-full);
  padding: 4px; margin-bottom: 18px;
  width: fit-content;
}
.fb-trip-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-full);
  border: none; background: transparent;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--grey); cursor: pointer;
  transition: all var(--ease); white-space: nowrap;
}
.fb-trip-btn:hover { color: var(--charcoal); }
.fb-trip-btn--active {
  background: var(--white); color: var(--charcoal);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.fb-trip-btn svg { flex-shrink: 0; }

/* ── From / To Route Row ── */
.fb-route-row {
  display: flex; align-items: flex-end; gap: 8px;
  margin-bottom: 16px;
}
.fb-route-col { flex: 1; min-width: 0; }
.fb-swap-btn {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 50%; border: 1.5px solid var(--grey-border);
  background: var(--white); color: var(--charcoal);
  font-size: 18px; cursor: pointer; transition: all var(--ease);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.fb-swap-btn:hover {
  background: var(--charcoal); color: var(--white);
  border-color: var(--charcoal);
}

/* ── Dates Row ── */
.fb-dates-row {
  display: flex; gap: 12px;
  margin-bottom: 16px;
}

/* ── Quick Filters ── */
.fb-quick-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════
   STEP 2 — Search Summary + Sort + Results
   ══════════════════════════════════════════════ */

/* ── Search Summary Bar ── */
.fb-search-summary {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg); padding: 14px 18px;
  box-shadow: var(--shadow-soft);
}
.fb-search-summary__route {
  font-size: 14px; color: var(--charcoal); font-weight: 500;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.fb-search-summary__route strong {
  font-weight: 800; font-size: 15px;
}
.fb-edit-search {
  background: none; border: none;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  color: var(--accent); cursor: pointer; padding: 0;
  white-space: nowrap;
}
.fb-edit-search:hover { text-decoration: underline; }

/* ── Sort Bar ── */
.fb-sort-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.fb-sort-pill {
  padding: 8px 16px; border-radius: var(--radius-full);
  border: 1.5px solid var(--grey-border); background: var(--white);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--charcoal); cursor: pointer; transition: all var(--ease);
}
.fb-sort-pill:hover { border-color: var(--accent); color: var(--accent); }
.fb-sort-pill--active {
  background: var(--charcoal); border-color: var(--charcoal); color: var(--white);
}

/* ── Results Layout (filters sidebar + cards) ── */
.fb-results-layout {
  display: flex; gap: 20px; align-items: flex-start;
}

/* ── Filters Sidebar ── */
.fb-filters {
  width: 220px; min-width: 220px;
  background: var(--white); border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-soft);
  position: sticky; top: 16px;
}
.fb-filters__title {
  font-size: 16px; font-weight: 800; color: var(--charcoal);
  margin: 0 0 16px;
}
.fb-filter-group {
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--grey-border);
}
.fb-filter-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.fb-filter-input { font-size: 13px; }
.fb-checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--charcoal); cursor: pointer;
  padding: 4px 0;
}
.fb-checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}

/* ── Flight List ── */
.fb-flight-list { flex: 1; min-width: 0; }
.fb-results-count {
  font-size: 13px; font-weight: 600; color: var(--grey);
  margin: 0 0 12px;
}

/* ── No Results ── */
.fb-no-results {
  background: var(--light); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center;
  color: var(--grey); font-size: 14px;
}

/* ══════════════════════════════════════════════
   Flight Cards
   ══════════════════════════════════════════════ */

.fb-flight-card {
  background: var(--white); border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px; position: relative;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.fb-flight-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.fb-flight-card--offer {
  border-color: var(--accent);
  border-width: 1.5px;
}

/* Offer tag badge */
.fb-flight-card__offer-tag {
  position: absolute; top: -10px; right: 16px;
  background: var(--accent); color: var(--white);
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-full);
}

/* Top row: airline + price */
.fb-flight-card__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px;
}
.fb-flight-card__airline {
  display: flex; align-items: center; gap: 10px;
}
.fb-flight-card__logo {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  letter-spacing: 0.05em;
}
.fb-flight-card__carrier {
  font-size: 14px; font-weight: 700; color: var(--charcoal);
}
.fb-flight-card__number {
  font-size: 12px; color: var(--grey);
}
.fb-flight-card__price-col { text-align: right; }
.fb-flight-card__price {
  font-size: 18px; font-weight: 800; color: var(--charcoal);
}
.fb-flight-card__price-note {
  font-size: 11px; color: var(--grey);
}

/* Route timeline */
.fb-flight-card__route {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.fb-flight-card__endpoint { text-align: center; min-width: 50px; }
.fb-flight-card__time {
  font-size: 18px; font-weight: 800; color: var(--charcoal);
  display: block;
}
.fb-flight-card__time sup {
  font-size: 11px; color: var(--accent); font-weight: 600;
}
.fb-flight-card__code {
  font-size: 12px; font-weight: 600; color: var(--grey);
  display: block; margin-top: 2px;
}

/* Duration track */
.fb-flight-card__duration {
  flex: 1; text-align: center;
}
.fb-flight-card__dur-text {
  font-size: 12px; font-weight: 600; color: var(--charcoal);
  display: block; margin-bottom: 4px;
}
.fb-flight-card__track {
  position: relative; height: 2px; background: var(--grey-border);
  border-radius: 1px;
}
.fb-flight-card__track-line {
  position: absolute; inset: 0;
  background: var(--charcoal); border-radius: 1px;
}
.fb-flight-card__stop-dot {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--white);
}
.fb-flight-card__stops {
  font-size: 11px; color: var(--grey); display: block;
  margin-top: 4px;
}

/* Bottom row: tags + select btn */
.fb-flight-card__bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--grey-border);
}
.fb-flight-card__tags { display: flex; gap: 6px; }
.fb-tag {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--light); color: var(--charcoal);
}
.fb-tag--green {
  background: #ecfdf5; color: #059669;
}

/* ══════════════════════════════════════════════
   STEP 3 — Itinerary + Passenger
   ══════════════════════════════════════════════ */

/* ── Itinerary Card ── */
.fb-itinerary-card { padding: 20px; }

.fb-itinerary {
  margin-bottom: 16px;
}
.fb-itinerary:last-of-type { margin-bottom: 0; }
.fb-itinerary__label {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.fb-itinerary__segment {
  display: flex; align-items: flex-start; gap: 16px;
}
.fb-itinerary__col { min-width: 90px; }
.fb-itinerary__col--end { text-align: right; }
.fb-itinerary__time {
  font-size: 20px; font-weight: 800; color: var(--charcoal);
}
.fb-itinerary__time sup {
  font-size: 11px; color: var(--accent); font-weight: 600;
}
.fb-itinerary__city {
  font-size: 13px; color: var(--charcoal); font-weight: 600;
  margin-top: 2px;
}
.fb-itinerary__date {
  font-size: 12px; color: var(--grey); margin-top: 2px;
}
.fb-itinerary__mid {
  flex: 1; text-align: center; padding-top: 4px;
}
.fb-itinerary__airline {
  font-size: 12px; font-weight: 600; color: var(--grey);
  margin-bottom: 6px;
}
.fb-itinerary__track {
  position: relative; height: 2px; background: var(--grey-border);
  border-radius: 1px; margin: 0 8px;
}
.fb-itinerary__track-line {
  position: absolute; inset: 0;
  background: var(--charcoal); border-radius: 1px;
}
.fb-itinerary__plane {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  background: var(--white); padding: 0 4px;
}
.fb-itinerary__dur {
  font-size: 12px; color: var(--grey); margin-top: 6px;
}

/* ── Fare Rules ── */
.fb-fare-rules {
  display: flex; flex-direction: column; gap: 8px;
}
.fb-fare-rule {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--charcoal);
  padding: 6px 0;
  border-bottom: 1px solid var(--grey-border);
}
.fb-fare-rule:last-child { border-bottom: none; }
.fb-fare-rule__label {
  font-weight: 600; min-width: 130px;
}

/* ── Passenger Card ── */
.fb-passenger-card { padding: 20px; }

/* ── Form Row (2-col) ── */
.fb-form-row {
  display: flex; gap: 12px;
  margin-bottom: 0;
}

/* ── Extras Toggle ── */
.fb-extras-toggle {
  margin-top: 8px;
  border-top: 1px solid var(--grey-border);
}

/* ══════════════════════════════════════════════
   Loading Animation — Plane on Clouds
   ══════════════════════════════════════════════ */

.fb-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 420px; padding: 40px 20px;
  background: linear-gradient(180deg, #e8f0fe 0%, #f0f6ff 40%, #ffffff 100%);
  border-radius: var(--radius-lg); border: 1px solid var(--grey-border);
  overflow: hidden; position: relative;
  /* Fill available viewport on mobile */
  min-height: max(420px, calc(100vh - 200px));
}

/* ── Sky gradient overlay ── */
.fb-loading::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, #c9ddf7 0%, transparent 100%);
  opacity: 0.5;
}

/* ── Plane ── */
.fb-loading__plane {
  font-size: 48px; position: relative; z-index: 2;
  animation: fb-plane-fly 2.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.12));
}

@keyframes fb-plane-fly {
  0%, 100% { transform: translate(0, 0) rotate(-2deg); }
  25%      { transform: translate(12px, -10px) rotate(-4deg); }
  50%      { transform: translate(0, -6px) rotate(-1deg); }
  75%      { transform: translate(-12px, -10px) rotate(-3deg); }
}

/* ── Clouds ── */
.fb-loading__clouds {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden; pointer-events: none;
}

.fb-loading__cloud {
  position: absolute; font-size: 42px;
  opacity: 0; animation: fb-cloud-drift linear infinite;
}
.fb-loading__cloud:nth-child(1) { top: 18%; animation-duration: 6s; animation-delay: 0s;   font-size: 38px; }
.fb-loading__cloud:nth-child(2) { top: 42%; animation-duration: 5s; animation-delay: 1.5s; font-size: 50px; }
.fb-loading__cloud:nth-child(3) { top: 65%; animation-duration: 7s; animation-delay: 0.8s; font-size: 34px; }
.fb-loading__cloud:nth-child(4) { top: 28%; animation-duration: 5.5s; animation-delay: 2.5s; font-size: 44px; }
.fb-loading__cloud:nth-child(5) { top: 55%; animation-duration: 6.5s; animation-delay: 3.5s; font-size: 36px; }

@keyframes fb-cloud-drift {
  0%   { left: 110%; opacity: 0; }
  10%  { opacity: 0.35; }
  90%  { opacity: 0.35; }
  100% { left: -20%; opacity: 0; }
}

/* ── Text + dots ── */
.fb-loading__text {
  margin-top: 28px; font-size: 18px; font-weight: 700;
  color: var(--charcoal); position: relative; z-index: 2;
}
.fb-loading__sub {
  margin-top: 6px; font-size: 13px; color: var(--grey);
  position: relative; z-index: 2;
}
.fb-loading__dots::after {
  content: ''; animation: fb-dots 1.5s steps(4, end) infinite;
}
@keyframes fb-dots {
  0%  { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ── Progress bar ── */
.fb-loading__progress {
  width: 220px; height: 4px; margin-top: 24px;
  background: var(--grey-border); border-radius: 2px;
  overflow: hidden; position: relative; z-index: 2;
}
.fb-loading__progress-bar {
  height: 100%; width: 0;
  background: var(--accent); border-radius: 2px;
  animation: fb-progress-fill 5s ease-out forwards;
}
@keyframes fb-progress-fill {
  0%   { width: 0; }
  20%  { width: 30%; }
  50%  { width: 55%; }
  80%  { width: 82%; }
  100% { width: 100%; }
}

/* ── Route badge ── */
.fb-loading__route {
  margin-top: 20px; padding: 8px 20px;
  background: var(--white); border-radius: var(--radius-full);
  border: 1px solid var(--grey-border);
  font-size: 14px; font-weight: 700; color: var(--charcoal);
  position: relative; z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ══════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════ */

@media (max-width: 900px) {
  .fb-layout { max-width: 100%; }

  /* Search card — tighter padding */
  .fb-search-card { padding: 16px; }

  /* From / To: stack vertically */
  .fb-route-row { flex-direction: column; gap: 0; align-items: stretch; }
  .fb-swap-btn {
    align-self: center; margin: -6px 0;
    width: 34px; height: 34px; min-width: 34px;
    font-size: 15px; z-index: 1; position: relative;
  }

  /* Dates + Passengers rows: keep side-by-side on mobile */
  .fb-dates-row { gap: 10px; }
  .fb-dates-row .form-group { margin-bottom: 10px; }

  /* Form groups: reduce spacing on mobile */
  .fb-search-card .form-group { margin-bottom: 10px; }
  .fb-search-card .form-label { font-size: 11px; margin-bottom: 4px; }
  .fb-search-card .form-input { padding: 10px 12px; font-size: 14px; }
  .fb-route-row { margin-bottom: 8px; }
  .fb-dates-row { margin-bottom: 8px; }

  /* Results */
  .fb-results-layout { flex-direction: column; align-items: stretch; }
  .fb-filters {
    width: 100%; min-width: 0;
    position: static;
  }
  .fb-sort-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
  .fb-sort-bar::-webkit-scrollbar { display: none; }
  .fb-sort-pill { white-space: nowrap; flex-shrink: 0; }

  /* Flight cards */
  .fb-flight-card { padding: 14px 16px; }
  .fb-flight-card__price { font-size: 16px; }
  .fb-flight-card__time { font-size: 16px; }

  /* Itinerary */
  .fb-itinerary__segment { gap: 10px; }
  .fb-itinerary__time { font-size: 18px; }
  .fb-itinerary__col { min-width: 70px; }

  /* Passenger forms — stack fields vertically on mobile for breathing room */
  .fb-form-row { flex-direction: column; gap: 0; }
  .fb-form-row .form-group { margin-bottom: 14px; }
  .fb-passenger-card { padding: 18px; }
  .fb-passenger-card .form-label { font-size: 12px; margin-bottom: 5px; }
  .fb-passenger-card .form-input,
  .fb-passenger-card .form-select { font-size: 16px; padding: 12px 14px; -webkit-appearance: none; }
  .fb-itinerary-card { padding: 16px; }

  /* Fare rules */
  .fb-fare-rule { flex-direction: column; align-items: flex-start; gap: 2px; }
  .fb-fare-rule__label { min-width: 0; }

  /* Search summary */
  .fb-search-summary { flex-direction: column; gap: 8px; align-items: flex-start; }

  /* Button overflow fix */
  .fb-layout .hb-card .flex.gap-md { flex-wrap: nowrap; }
  .fb-layout .hb-card .flex.gap-md .btn { min-width: 0; padding-left: 12px; padding-right: 12px; }

  .page__main--booking { padding-bottom: 80px; }
}

@media (max-width: 480px) {
  .fb-offer-strip { flex-wrap: wrap; gap: 6px; }
  .fb-offer-strip__text { font-size: 13px; }
  .fb-quick-filters { gap: 6px; }
  .fb-flight-card__route { gap: 8px; }
  .fb-flight-card__endpoint { min-width: 44px; }

  /* Passenger form on small screens */
  .fb-form-row .form-group { margin-bottom: 12px; }
}

/* ── Date input fix (iOS + cross-browser) ── */
input[type="date"].fb-pax-field,
input[type="date"]#fbDepart,
input[type="date"]#fbReturn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  line-height: 1.2;
  position: relative;
  background: var(--white);
  color: var(--charcoal);
}

/* Ensure date inputs show consistent height & alignment */
.fb-dates-row input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 10px 36px 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--charcoal);
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-md, 10px);
  width: 100%;
  box-sizing: border-box;
}

/* Position calendar icon on the right, no overlap */
.fb-dates-row input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.5;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
}

/* Firefox — hide default icon and use custom positioning */
.fb-dates-row input[type="date"]::-moz-calendar-picker-indicator {
  opacity: 0.5;
}

/* Hidden return group (one-way) */
.fb-return-hidden {
  display: none !important;
}

/* Full-width departure when return is hidden */
.fb-dates-row--one-way {
  /* departure takes full width */
}
.fb-dates-row--one-way .form-group { flex: 1; }
