/* ===========================================================================
   Vista Destination — results search widget & checkout form (2026 refresh)
   ---------------------------------------------------------------------------
   WHY THIS FILE EXISTS
   vista-flight.css carries three overlapping generations of rules for the
   results search widget, several of them !important. Editing them in place is
   a specificity fight nobody wins. Everything here uses fresh namespaces
   (.vd-rs-* for the results search, .vd-co-* for the checkout form) that the
   legacy rules cannot reach, so behaviour is predictable.

   Loaded last in layouts/header.php. Two small, deliberately scoped overrides
   for legacy classes are marked below.
   =========================================================================== */

:root {
  --vd-ink: #0f172a;
  --vd-muted: #64748b;
  --vd-faint: #94a3b8;
  --vd-line: #dfe6f0;
  --vd-line-soft: #edf1f7;
  --vd-blue: #0060d4;
  --vd-blue-dark: #0050b0;
  --vd-blue-tint: #f0f6ff;
  --vd-surface: #fff;
  --vd-radius: 12px;
  --vd-field-h: 46px;
}

/* ===========================================================================
   1. Results page — back bar
   =========================================================================== */

.vd-rs-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

.vd-rs-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem 0.5rem 0.7rem;
  border: 1px solid var(--vd-line);
  border-radius: 999px;
  background: var(--vd-surface);
  color: var(--vd-blue);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}
.vd-rs-back svg { width: 1rem; height: 1rem; }
.vd-rs-back:hover { border-color: #bfd6f5; background: var(--vd-blue-tint); }
.vd-rs-back:focus-visible { outline: 2px solid var(--vd-blue); outline-offset: 2px; }

.vd-rs-crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; min-width: 0; }
.vd-rs-crumb strong { font-size: 0.875rem; font-weight: 800; color: var(--vd-ink); letter-spacing: -0.01em; }
.vd-rs-crumb em { font-style: normal; font-size: 0.75rem; font-weight: 600; color: var(--vd-muted); }

/* ===========================================================================
   2. Results page — search widget
   =========================================================================== */

.vd-rs-search {
  background: var(--vd-surface);
  border: 1px solid var(--vd-line);
  border-radius: 18px;
  padding: 0.9rem 1rem 1rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.vd-rs-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.8rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--vd-line-soft);
}

/* Segmented trip-type control. The radio stays in the DOM for the form post
   and for keyboard/AT users; it is visually replaced by the pill. */
.vd-rs-trip { display: inline-flex; padding: 3px; gap: 3px; background: #f1f5f9; border-radius: 999px; }
.vd-rs-trip label { position: relative; margin: 0; cursor: pointer; }
.vd-rs-trip input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.vd-rs-trip span {
  display: block;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--vd-muted);
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}
.vd-rs-trip label.is-active span { background: var(--vd-surface); color: var(--vd-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }
.vd-rs-trip input:focus-visible + span { outline: 2px solid var(--vd-blue); outline-offset: 2px; }

.vd-rs-cabin { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; }
.vd-rs-cabin > span {
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--vd-faint);
}
.vd-rs-cabin select {
  height: 38px;
  padding: 0 0.6rem;
  border: 1px solid var(--vd-line);
  border-radius: 10px;
  background: var(--vd-surface);
  color: var(--vd-ink);
  font-size: 0.8125rem;
  font-weight: 700;
}

.vd-rs-grid {
  display: grid;
  gap: 0.6rem;
  align-items: end;
  grid-template-columns:
    minmax(0, 1.15fr) 42px minmax(0, 1.15fr)
    minmax(0, 0.85fr) minmax(0, 0.85fr) minmax(0, 1fr) 128px;
  grid-template-areas: "from swap to depart return pax submit";
}
.vd-rs-grid > .vd-rs-field:nth-of-type(1) { grid-area: from; }
.vd-rs-grid > .vd-rs-field:nth-of-type(2) { grid-area: to; }
.vd-rs-grid > .vd-rs-field:nth-of-type(3) { grid-area: depart; }
.vd-rs-grid > .vd-rs-field:nth-of-type(4) { grid-area: return; }
.vd-rs-grid > .vd-rs-travellers { grid-area: pax; }
.vd-rs-swap { grid-area: swap; }
.vd-rs-submit { grid-area: submit; }

.vd-rs-field { position: relative; min-width: 0; margin: 0; }
.vd-rs-field > label,
.vd-rs-field > .vd-rs-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vd-faint);
}

.vd-rs-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: var(--vd-field-h);
  padding: 0 0.7rem;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius);
  background: var(--vd-surface);
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.vd-rs-control:hover { border-color: #c7d7ee; }
.vd-rs-field:focus-within .vd-rs-control,
.vd-rs-control:focus-visible {
  border-color: var(--vd-blue);
  box-shadow: 0 0 0 3px rgba(0, 96, 212, 0.12);
  outline: none;
}
.vd-rs-control > svg { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; color: var(--vd-faint); }

/* min-width:0 is what stops a date input from clipping its own value — the
   default intrinsic width of type="date" is wider than the grid track. */
.vd-rs-control input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--vd-ink);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
}
.vd-rs-control input:focus { outline: none; }
.vd-rs-control input::placeholder { color: #b6c2d2; font-weight: 500; }

.vd-rs-date { color-scheme: light; }
.vd-rs-date::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

.vd-rs-swap {
  align-self: end;
  width: 42px;
  height: var(--vd-field-h);
  display: grid;
  place-items: center;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius);
  background: var(--vd-surface);
  color: var(--vd-blue);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.vd-rs-swap svg { width: 1.05rem; height: 1.05rem; }
.vd-rs-swap:hover { border-color: #bfd6f5; background: var(--vd-blue-tint); }
.vd-rs-swap:focus-visible { outline: 2px solid var(--vd-blue); outline-offset: 2px; }

.vd-rs-travellers-btn { cursor: pointer; }
.vd-rs-travellers-btn strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--vd-ink);
}

.vd-rs-popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 0.4rem);
  right: 0;
  width: min(19rem, 88vw);
  padding: 0.9rem;
  border: 1px solid var(--vd-line);
  border-radius: 14px;
  background: var(--vd-surface);
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.28);
}
.vd-rs-pax { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; }
.vd-rs-pax b { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--vd-ink); }
.vd-rs-pax small { display: block; font-size: 0.6875rem; color: var(--vd-muted); }
.vd-rs-pax > div { display: inline-flex; align-items: center; gap: 0.3rem; }
.vd-rs-pax button {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface);
  color: var(--vd-ink);
  font-size: 1rem; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.vd-rs-pax button:hover { border-color: var(--vd-blue); color: var(--vd-blue); }
.vd-rs-pax input {
  width: 42px; height: 30px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  text-align: center;
  font-size: 0.8125rem; font-weight: 700;
  color: var(--vd-ink);
  font-family: inherit;
}
.vd-rs-popover-done {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.55rem;
  border: 0;
  border-radius: 10px;
  background: var(--vd-blue);
  color: #fff;
  font-size: 0.8125rem; font-weight: 700;
  cursor: pointer;
}

/* Brand blue, not the previous green. Two competing primary colours on one
   screen (green search, blue Select) made neither read as the next step. */
.vd-rs-submit {
  align-self: end;
  height: var(--vd-field-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--vd-radius);
  background: var(--vd-blue);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease;
}
.vd-rs-submit svg { width: 1rem; height: 1rem; }
.vd-rs-submit:hover { background: var(--vd-blue-dark); }
.vd-rs-submit:focus-visible { outline: 2px solid var(--vd-ink); outline-offset: 2px; }

.vd-rs-ac {
  position: absolute;
  z-index: 130;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 17rem;
  overflow: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: 1px solid var(--vd-line);
  border-radius: 12px;
  background: var(--vd-surface);
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.3);
}
.vd-rs-ac li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}
.vd-rs-ac li:hover,
.vd-rs-ac li.is-active { background: var(--vd-blue-tint); }
.vd-rs-ac .vd-ac-iata {
  flex: 0 0 auto;
  min-width: 2.4rem;
  padding: 0.15rem 0.3rem;
  border-radius: 5px;
  background: #eef2f8;
  color: var(--vd-ink);
  font-size: 0.6875rem; font-weight: 800; text-align: center;
}
.vd-rs-ac .vd-ac-name {
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.8125rem; color: #334155;
}

.vd-rs-child-ages { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.7rem; }
.vd-rs-child-ages label { font-size: 0.75rem; font-weight: 700; color: var(--vd-muted); }
.vd-rs-child-ages input {
  width: 4.5rem; height: 36px; margin-left: 0.4rem;
  padding: 0 0.5rem;
  border: 1px solid var(--vd-line); border-radius: 8px;
  font-family: inherit; font-weight: 700; color: var(--vd-ink);
}

.vd-rs-cap-note {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--vd-line-soft);
  border-radius: 12px;
  background: var(--vd-surface);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--vd-muted);
}
.vd-rs-cap-note a { color: var(--vd-blue); font-weight: 700; }

/* Legacy override 1: the date strip is now real <button> elements, but the
   original rules only styled <span>. */
.vd-day-tabs-v16 button {
  background: var(--vd-surface);
  border: 1px solid #e0e8f2;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}
.vd-day-tabs-v16 button:hover { border-color: #bfd6f5; color: var(--vd-blue); }
.vd-day-tabs-v16 button.is-active { border-color: var(--vd-blue); color: var(--vd-blue); background: var(--vd-blue-tint); }
.vd-day-tabs-v16 button[aria-busy="true"] { opacity: .6; cursor: progress; }

@media (max-width: 1180px) {
  .vd-rs-grid {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    grid-template-areas:
      "from   swap   to"
      "depart depart return"
      "pax    pax    submit";
  }
}

@media (max-width: 700px) {
  .vd-rs-search { padding: 0.85rem; border-radius: 14px; }
  .vd-rs-controls { justify-content: flex-start; }
  .vd-rs-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "from" "swap" "to" "depart" "return" "pax" "submit";
  }
  .vd-rs-swap { justify-self: center; width: 40px; height: 34px; transform: rotate(90deg); }
  .vd-rs-popover { right: auto; left: 0; }
  .vd-rs-submit { height: 48px; }
}

/* ===========================================================================
   3. Checkout form
   =========================================================================== */

.vd-co-topbar { margin-bottom: 0.75rem; }

.vd-co-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem 0.5rem 0.7rem;
  border: 1px solid var(--vd-line);
  border-radius: 999px;
  background: var(--vd-surface);
  color: var(--vd-blue);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}
.vd-co-back svg { width: 1rem; height: 1rem; }
.vd-co-back:hover { border-color: #bfd6f5; background: var(--vd-blue-tint); }
.vd-co-back:focus-visible { outline: 2px solid var(--vd-blue); outline-offset: 2px; }

/* Airline logo on the itinerary cards. Legacy override 2: the head previously
   held a bare icon div, which is what the marked-up screenshot flagged. */
.vd-checkout-card-head .vd-co-airline-logo {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--vd-line-soft);
  border-radius: 12px;
  background: var(--vd-surface);
  color: var(--vd-blue);
}
.vd-co-airline-logo img { width: 30px; height: 30px; object-fit: contain; }
.vd-co-airline-logo > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--vd-blue);
}
.vd-co-airline-logo svg { width: 1.1rem; height: 1.1rem; }

/* --- 6-column form grid ---------------------------------------------------
   Every field is a label containing a caption and one control, so captions
   sit on a single baseline and controls share one height. That is what fixes
   the ragged rows in the current form. */
.vd-co-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem 0.75rem;
  align-items: start;
}
.vd-co-span-1 { grid-column: span 1; }
.vd-co-span-2 { grid-column: span 2; }
.vd-co-span-3 { grid-column: span 3; }
.vd-co-span-6 { grid-column: span 6; }

.vd-co-field { display: flex; flex-direction: column; min-width: 0; margin: 0; }

.vd-co-label {
  display: block;
  margin-bottom: 0.32rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.3;
}
.vd-co-label em {
  font-style: normal;
  font-weight: 600;
  color: var(--vd-faint);
  font-size: 0.6875rem;
}

.vd-co-field input,
.vd-co-field select {
  width: 100%;
  min-width: 0;
  height: var(--vd-field-h);
  padding: 0 0.7rem;
  border: 1px solid var(--vd-line);
  border-radius: 10px;
  background: var(--vd-surface);
  color: var(--vd-ink);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color .16s ease, box-shadow .16s ease;
  appearance: none;
  -webkit-appearance: none;
}
.vd-co-field select {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
}
.vd-co-field input::placeholder { color: #b6c2d2; font-weight: 500; }
.vd-co-field input:hover,
.vd-co-field select:hover { border-color: #c7d7ee; }
.vd-co-field input:focus,
.vd-co-field select:focus {
  border-color: var(--vd-blue);
  box-shadow: 0 0 0 3px rgba(0, 96, 212, 0.12);
  outline: none;
}
/* :user-invalid, not :invalid. A required empty date input is :invalid from
   the moment it renders, which painted every date field red before the
   traveller had typed anything. :user-invalid only fires after they have
   interacted with the field. */
.vd-co-field input:user-invalid,
.vd-co-field select:user-invalid { border-color: #e0a3a3; box-shadow: 0 0 0 3px rgba(200, 60, 60, 0.08); }
.vd-co-date { color-scheme: light; }
.vd-co-date::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

.vd-co-help { margin-top: 0.3rem; font-size: 0.6875rem; line-height: 1.5; color: var(--vd-muted); }

.vd-co-subhead {
  margin: 1.35rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--vd-line-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vd-faint);
}

/* --- Travel documents: tinted band ---------------------------------------
   Neutral green while the passport is optional, amber when the fare requires
   it. A quiet tint, not a warning colour, so it reads as guidance. */
.vd-co-docs {
  margin-top: 1.1rem;
  border: 1px solid #d9ebe0;
  border-radius: 14px;
  background: #f7fbf8;
  overflow: hidden;
}
.vd-co-docs-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #d9ebe0;
  background: #e9f6ee;
  color: #17693e;
}
.vd-co-docs-head svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.vd-co-docs-head strong { font-size: 0.8125rem; font-weight: 800; letter-spacing: -0.005em; }
.vd-co-docs-head em {
  margin-left: auto;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
}
.vd-co-docs .vd-co-grid { padding: 0.9rem; }

.vd-co-docs.is-required { border-color: #f0dcb4; background: #fffcf5; }
.vd-co-docs.is-required .vd-co-docs-head { border-bottom-color: #f0dcb4; background: #fdf3de; color: #8a5d0a; }

/* Passenger blocks: even rhythm between travellers. */
.vd-passenger-block-pro { padding-top: 1.15rem; }
.vd-passenger-block-pro + .vd-passenger-block-pro {
  margin-top: 1.35rem;
  border-top: 1px solid var(--vd-line-soft);
}

@media (max-width: 860px) {
  .vd-co-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vd-co-span-1,
  .vd-co-span-2,
  .vd-co-span-3 { grid-column: span 1; }
  .vd-co-span-6 { grid-column: span 2; }
  .vd-co-title { grid-column: span 1; }
  .vd-co-first { grid-column: span 1; }
}

@media (max-width: 540px) {
  .vd-co-grid { grid-template-columns: minmax(0, 1fr); }
  .vd-co-span-1,
  .vd-co-span-2,
  .vd-co-span-3,
  .vd-co-span-6,
  .vd-co-title,
  .vd-co-first { grid-column: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  .vd-rs-back, .vd-rs-control, .vd-rs-swap, .vd-rs-submit, .vd-rs-trip span,
  .vd-co-back, .vd-co-field input, .vd-co-field select, .vd-day-tabs-v16 button {
    transition: none;
  }
  .vd-rs-swap { transform: none; }
  @media (max-width: 700px) { .vd-rs-swap { transform: rotate(90deg); } }
}

/* Legacy override 3: arrival times such as "11:50 PM" wrapped inside the
   fixed-width time column on the results card. */
.vd-time-v16 strong { white-space: nowrap; }
