/* Shared origin/destination search — phones only (home + trips) */

.city-picker__head,
.city-picker__search {
  display: none;
}

.city-picker__context-icon {
  display: none;
}

@media (min-width: 768px) {
  #tripForm .dropdown-menu.origin_location,
  #tripForm .dropdown-menu.destination_location,
  .searchbar .dropdown-menu.origin_location,
  .searchbar .dropdown-menu.destination_location {
    top: calc(100% + 0.5rem) !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    overflow: hidden !important;
    padding: 0.35rem !important;
    transition: none !important;
  }

  #tripForm .dropdown-menu .city-picker {
    display: flex;
    flex-direction: column;
    max-height: calc(min(40dvh, 18rem) - 0.7rem);
    overflow: hidden;
  }

  #tripForm .dropdown-menu .city-picker__head {
    min-height: 1.9rem;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.3rem 0.55rem;
    margin-bottom: 0.3rem;
    background: var(--brand-bg-muted, #f3f3f3);
    color: var(--brand-muted, #52525b);
    border-radius: 0.5rem;
  }

  #tripForm .dropdown-menu .city-picker__title {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    line-height: 1.25;
    font-weight: 650;
  }

  #tripForm .dropdown-menu .city-picker__context-icon {
    display: inline-block;
    position: static;
    transform: none;
    min-width: auto;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1;
  }

  #tripForm .dropdown-menu .city-picker__close {
    display: none;
  }

  #tripForm .dropdown-menu .city-picker .staredlocations {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    border-radius: 0.55rem;
    padding-inline: 0.2rem;
  }

  #tripForm .dropdown-menu .city-picker .staredlocations::-webkit-scrollbar {
    width: 6px;
  }

  #tripForm .dropdown-menu .city-picker .staredlocations::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  #tripForm .dropdown-menu .city-picker .staredlocations::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }

  #tripForm .dropdown-menu .city-picker .staredlocations::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
  }
}

body.city-picker-open {
  overflow: hidden;
}

/* The fullscreen picker must always cover the fixed page navigation. */
body.city-picker-open .layout-navbar,
body.city-picker-open .landing-navbar {
  z-index: 0 !important;
  pointer-events: none;
}

@media (max-width: 767.98px) {
  .trips-page-shell .searchbar-body {
    padding: 0.9rem !important;
  }

  .landing-hero .hero-search-head {
    display: none !important;
    margin: 0 !important;
  }

  #tripForm.row,
  #tripForm .row,
  .searchbar-body > .row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0.5rem;
    margin: 0 !important;
  }

  #tripForm .col-12.col-md-3 .mt-1 {
    margin-top: 0 !important;
  }

  #tripForm .od-pair-col {
    position: relative;
  }

  .landing-hero #tripForm .od-pair,
  #tripForm .od-pair {
    --od-swap-gutter: 0 !important;
    --bs-gutter-y: 0 !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: 0.5rem;
  }

  .landing-hero #tripForm .od-pair > .inputcel,
  .landing-hero #tripForm .od-pair > .inputcel:first-child,
  .landing-hero #tripForm .od-pair > .inputcel:last-of-type,
  #tripForm .od-pair > .inputcel,
  #tripForm .od-pair > .inputcel:first-child,
  #tripForm .od-pair > .inputcel:last-of-type {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    padding-inline: 0 !important;
  }

  #tripForm .searchbar-field-label,
  #tripForm label.form-text {
    display: none !important;
  }

  #tripForm .inputcel {
    padding: 0 !important;
  }

  #tripForm .input-container input.form-control,
  #tripForm .search-submit-btn,
  #tripForm .searchbar-submit {
    background: var(--brand-bg-muted, #f3f3f3);
    border: 1px solid transparent;
    border-radius: 0.85rem !important;
    min-height: 3.15rem !important;
    height: 3.15rem !important;
    padding-block: 0;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: none;
  }

  #tripForm .input-container input.form-control {
    padding-inline-start: 2.65rem;
    padding-inline-end: 2.75rem;
    text-align: start;
    direction: rtl;
    unicode-bidi: isolate;
    border-radius: 0.85rem !important;
  }

  #tripForm input.starttimeselector,
  #tripForm input.bdi {
    direction: rtl !important;
    text-align: start !important;
  }

  #tripForm .input-container input.form-control:focus {
    background: var(--brand-bg-muted, #f3f3f3);
    border-color: var(--brand-ink, #000);
    box-shadow: none;
  }

  #tripForm .input-container > i.icon {
    left: auto !important;
    right: auto !important;
    inset-inline-start: 0.45rem;
    inset-inline-end: auto;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-muted, #5e5e5e);
    margin: 0;
  }

  #tripForm .od-pair-col > .od-swap-btn,
  #tripForm .od-swap-btn {
    --od-swap-size: 2.35rem;
    left: auto !important;
    right: auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: 0.75rem !important;
    top: 50% !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
    border-radius: 50%;
    background: #fff;
    color: var(--brand-ink, #000);
    border: 1px solid var(--brand-border, rgba(0, 0, 0, 0.12));
    box-shadow:
      0 0 0 3px var(--brand-surface, #fff),
      0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 6;
  }

  #tripForm .od-swap-btn .ti {
    transform: rotate(90deg);
  }

  #tripForm .od-swap-btn:hover,
  #tripForm .od-swap-btn:focus-visible,
  #tripForm .od-swap-btn:active {
    transform: translateY(-50%) !important;
    color: var(--brand-ink, #000);
    background: #fff;
  }

  #tripForm .od-swap-btn:active {
    transform: translateY(-50%) scale(0.94) !important;
  }

  #tripForm .search-submit-btn,
  #tripForm .searchbar-submit {
    width: 100%;
    background: var(--brand-ink, #000);
    color: var(--brand-ink-inverse, #fff);
    font-weight: 700;
    font-size: 1.05rem;
  }

  #tripForm .origin.dropdown-toggle::after,
  #tripForm .origin.dropdown-toggle::before,
  #tripForm .destination.dropdown-toggle::after,
  #tripForm .destination.dropdown-toggle::before {
    display: none !important;
    content: none !important;
  }

  #tripForm .dropdown-menu.origin_location,
  #tripForm .dropdown-menu.destination_location,
  body > .dropdown-menu.origin_location[data-city-picker-host],
  body > .dropdown-menu.destination_location[data-city-picker-host] {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: var(--brand-surface, #fff);
    z-index: 2147483000 !important;
    overflow: hidden !important;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker {
    --picker-inline: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100dvh;
    background: var(--brand-surface, #fff);
  }

  :is(#tripForm .input-container, body > .dropdown-menu[data-city-picker-host]) .city-picker i {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    min-width: 0;
    padding: 0;
    margin: 0;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__head,
  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__search {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-inline: var(--picker-inline);
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__head {
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--brand-border, rgba(0, 0, 0, 0.08));
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__close {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: var(--brand-ink, #000);
    border-radius: 0.65rem;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__close .ti {
    font-size: 1.25rem;
    line-height: 1;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-ink, #000);
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__search {
    position: relative;
    padding-block: 0.75rem;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__search > .ti-search {
    position: absolute !important;
    inset-inline-start: calc(var(--picker-inline) + 0.7rem);
    inset-inline-end: auto;
    top: 50%;
    left: auto;
    transform: translateY(-50%);
    color: var(--brand-muted, #5e5e5e);
    pointer-events: none;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker #origincontainer,
  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker #desticontainer,
  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker .px-1 {
    padding-inline: 0 !important;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker__input {
    min-height: 3.15rem;
    height: 3.15rem;
    padding-inline-start: 2.4rem;
    padding-inline-end: 0.85rem;
    background: var(--brand-bg-muted, #f3f3f3);
    border: 1px solid transparent;
    border-radius: 0.85rem;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker .staredlocations {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-inline: var(--picker-inline);
    padding-bottom: env(safe-area-inset-bottom, 0.75rem);
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker .staredlocation_title {
    display: block;
    margin: 0.35rem 0 0.5rem;
    padding: 0;
  }

  :is(#tripForm, body > .dropdown-menu[data-city-picker-host]) .city-picker .dropdown-item {
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    min-height: 3.15rem;
    display: flex;
    align-items: center;
    padding: 0.85rem 0.15rem;
    font-size: 1rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
  }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  #tripForm .od-swap-btn .ti {
    transform: rotate(90deg);
  }
}
