/* Wayzuno travel date picker: one Dates field and its calendar (date-picker.js). */

.dp-replaced { display: none !important; }

.trip-fields.has-dp {
  position: relative;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

/* Dates field --------------------------------------------------------------- */
.dp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dp-field[hidden] { display: none; }
.dp-field-label {
  color: var(--muted, #475569);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dp-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 7px 14px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--ink, #0f172a);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.dp-trigger:hover { border-color: var(--line-strong, #cbd5e1); background: #fff; }
.dp-trigger:focus-visible { outline: 3px solid var(--blue, #4f46e5); outline-offset: 2px; }
.dp-trigger[aria-expanded="true"] {
  border-color: var(--blue, #4f46e5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
.dp-trigger-icon { display: flex; color: var(--blue, #4f46e5); flex: 0 0 auto; }
.dp-trigger-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dp-trigger-text strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-trigger-text small { font-size: 12.5px; line-height: 1.3; color: var(--muted, #475569); }
.dp-trigger-text small:empty { display: none; }

/* Calendar ------------------------------------------------------------------ */
.dp-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1000;
  width: min(720px, calc(100vw - 32px));
  padding: 18px 20px 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px;
  background: #fff;
  color: var(--ink, #0f172a);
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, .28), 0 0 0 1px rgba(15, 23, 42, .04);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  animation: dpIn .16s cubic-bezier(.16, 1, .3, 1);
}
.dp-pop[hidden] { display: none; }
@keyframes dpIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dp-pop { animation: none; } }

.dp-pop button { font: inherit; color: inherit; }
.dp-pop button:focus-visible { outline: 2px solid var(--blue, #4f46e5); outline-offset: 2px; }

.dp-head { display: flex; align-items: center; gap: 12px; }
.dp-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.dp-tabs { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.dp-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 132px;
  min-height: 48px;
  padding: 6px 14px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.dp-tab[hidden], .dp-tab-sep[hidden] { display: none; }
.dp-tab small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted, #475569);
}
.dp-tab strong { font-size: 15px; font-weight: 600; }
.dp-tab[aria-pressed="true"] {
  border-color: var(--blue, #4f46e5);
  background: var(--pale, #eef2ff);
  box-shadow: inset 0 0 0 1px var(--blue, #4f46e5);
}
.dp-tab[aria-pressed="true"] small { color: var(--blue-hover, #4338ca); }
.dp-tab-sep { width: 14px; height: 1.5px; background: var(--line-strong, #cbd5e1); flex: 0 0 auto; }
.dp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #475569) !important;
  cursor: pointer;
}
.dp-close:hover { background: #f1f5f9; color: var(--ink, #0f172a) !important; }

.dp-hint { margin: 12px 0 4px; font-size: 13px; color: var(--muted, #475569); min-height: 18px; }

.dp-body { position: relative; }
.dp-nav {
  position: absolute;
  top: 2px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}
.dp-nav:hover:not(:disabled) { background: #f8fafc; border-color: var(--line-strong, #cbd5e1); }
.dp-nav:disabled { opacity: .35; cursor: default; }
.dp-prev { left: 0; }
.dp-next { right: 0; }

.dp-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.dp-month-title { margin: 0 0 6px; height: 44px; line-height: 44px; text-align: center; font-size: 15px; font-weight: 600; }
.dp-grid { width: 100%; border-collapse: separate; border-spacing: 0 3px; table-layout: fixed; }
.dp-grid th {
  height: 26px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-light, #64748b);
  text-align: center;
}
.dp-grid td { padding: 0; }

.dp-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-day-num { font-size: 14px; font-weight: 600; line-height: 1; }
.dp-day-price { font-size: 10.5px; font-weight: 500; line-height: 1; color: var(--muted-light, #64748b); }
.dp-day.is-low .dp-day-price { color: var(--teal-hover, #047857); font-weight: 700; }
@media (hover: hover) {
  .dp-day:hover:not(:disabled):not(.is-depart):not(.is-return) { background: #f1f5f9; }
}
.dp-day.is-today .dp-day-num { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.dp-day.is-disabled { color: #cbd5e1; cursor: default; }

/* Days the search also checks around the chosen dates. */
.dp-day.in-flex { outline: 1.5px dashed #a5b4fc; outline-offset: -4px; }

.dp-day.in-range { border-radius: 0; background: var(--pale, #eef2ff); color: #3730a3; }
.dp-day.is-preview-end { background: var(--pale, #eef2ff); box-shadow: inset 0 0 0 2px var(--blue, #4f46e5); }
.dp-day.is-depart, .dp-day.is-return { background: var(--blue, #4f46e5); color: #fff; }
.dp-day.is-depart:not(.is-solo) { border-radius: 10px 0 0 10px; }
.dp-day.is-return { border-radius: 0 10px 10px 0; }
.dp-day.is-depart .dp-day-price, .dp-day.is-return .dp-day-price { color: rgba(255, 255, 255, .88); }
.dp-day.is-other-leg::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--blue, #4f46e5);
  opacity: .6;
}
.dp-day:focus-visible { z-index: 1; }

/* Footer -------------------------------------------------------------------- */
.dp-foot { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line, #e2e8f0); }
.dp-options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.dp-flex, .dp-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dp-flex[hidden], .dp-presets[hidden] { display: none; }
.dp-options-label { margin-right: 4px; font-size: 12px; font-weight: 600; color: var(--muted, #475569); }
.dp-chip {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 999px;
  background: #fff;
  font-size: 13px !important;
  font-weight: 500;
  cursor: pointer;
}
.dp-chip:hover { border-color: var(--line-strong, #cbd5e1); background: #f8fafc; }
.dp-chip[aria-pressed="true"] {
  border-color: var(--blue, #4f46e5);
  background: var(--pale, #eef2ff);
  color: #3730a3 !important;
  font-weight: 600;
}
.dp-price-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 12px; color: var(--muted, #475569); }
.dp-price-note[hidden] { display: none; }
.dp-price-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--teal, #059669); flex: 0 0 auto; }
.dp-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.dp-summary { font-size: 14px; font-weight: 600; }
.dp-done {
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  background: var(--ink, #0f172a);
  color: #fff !important;
  font-weight: 600 !important;
  cursor: pointer;
}
.dp-done:hover { background: #1e293b; }

/* A flight row's calendar sits under that row. */
.journey-leg { position: relative; }
.journey-leg > .dp-pop { top: calc(100% + 6px); left: auto; right: 0; }

/* Tablet: Dates and Cabin stack. */
@media (max-width: 760px) {
  .trip-fields.has-dp { grid-template-columns: minmax(0, 1fr); }
}

/* Phone: the calendar is a full-height sheet with a fixed footer. */
@media (max-width: 640px) {
  html.dp-sheet-open, html.dp-sheet-open body { overflow: hidden; }
  html.dp-sheet-open body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(15, 23, 42, .45);
  }
  .dp-pop,
  .journey-leg > .dp-pop {
    position: fixed;
    top: 24px;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 0;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation-name: dpSheet;
  }
  .dp-pop[hidden] { display: none; }
  @keyframes dpSheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .dp-tab { min-width: 0; flex: 1; }
  .dp-hint { margin: 10px 0 2px; }
  .dp-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -16px; padding: 0 16px; }
  .dp-months { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dp-nav { top: 4px; }
  .dp-prev { left: 16px; }
  .dp-next { right: 16px; }
  .dp-day { height: 48px; }
  .dp-foot { margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8px 16px -12px rgba(15, 23, 42, .25); }
  .dp-options { gap: 8px; }
  .dp-chip { min-height: 44px; }
  .dp-actions { margin-top: 12px; }
  .dp-done { flex: 0 0 auto; min-width: 120px; }
}

@media (forced-colors: active) {
  .dp-day.is-depart, .dp-day.is-return, .dp-tab[aria-pressed="true"], .dp-chip[aria-pressed="true"] { outline: 2px solid Highlight; }
  .dp-day.in-range { outline: 1px solid Highlight; }
}
