/* Unified Routes location picker — world-class desktop + mobile */

.rlp-toast {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font: 600 0.85rem/1.2 "DM Sans", system-ui, sans-serif;
  background: #132a8e;
  color: #fff;
  box-shadow: 0 12px 30px rgba(19, 42, 142, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(92vw, 28rem);
  text-align: center;
}
.rlp-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.rlp-toast.is-err {
  background: #b91c1c;
}

/* Enhanced hero/search forms */
form.rlp-enhanced {
  overflow: visible !important;
}

form.rlp-enhanced .grid.gap-3 {
  grid-template-columns: 1.45fr 1.15fr 1.15fr !important;
  align-items: end;
}

@media (max-width: 1023px) {
  form.rlp-enhanced .grid.gap-3 {
    grid-template-columns: 1fr 1fr !important;
  }
  form.rlp-enhanced .rlp-slot {
    grid-column: 1 / -1;
  }
}

@media (max-width: 639px) {
  form.rlp-enhanced .grid.gap-3 {
    grid-template-columns: 1fr !important;
  }
}

.rlp-legacy-hidden {
  display: none !important;
}

.rlp-slot {
  min-width: 0;
}

.rlp-field {
  position: relative;
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.rlp-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b7280;
}

.rlp-trigger {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 3.35rem;
  padding: 0.45rem 0.75rem 0.45rem 0.65rem;
  border: 1px solid #e8eaee;
  border-radius: 0.95rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
  color: #0e1116;
}

.rlp-trigger:hover,
.rlp-trigger:focus-visible {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(19, 42, 142, 0.08);
  outline: none;
}

.rlp-trigger.is-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.rlp-trigger.has-value {
  min-height: 3.45rem;
}

.rlp-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.7rem;
  background: #eef2ff;
  color: #132a8e;
}

.rlp-ico--accent {
  background: #fff7ed;
  color: #ff7a1a;
}

.rlp-trigger__text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.rlp-trigger__ph {
  font-size: 0.92rem;
  font-weight: 600;
  color: #9ca3af;
}

.rlp-trigger__title {
  font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #0b1957;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rlp-trigger__sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rlp-chev {
  flex: 0 0 auto;
  color: #9ca3af;
}

.rlp-error {
  font-size: 0.75rem;
  font-weight: 650;
  color: #e11d48;
}

/* Desktop dropdown — portaled to body (fixed via JS) */
.rlp-dropdown {
  position: fixed;
  z-index: 240;
  background: #fff;
  border: 1px solid rgba(19, 42, 142, 0.12);
  border-radius: 1rem;
  box-shadow: 0 24px 50px -20px rgba(11, 25, 87, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rlp-pop 0.18s ease;
}

@keyframes rlp-pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rlp-search {
  padding: 0.65rem 0.65rem 0.45rem;
  border-bottom: 1px solid #eef0f4;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.rlp-search input {
  width: 100%;
  border: 1px solid #e8eaee;
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem;
  font: 600 0.92rem/1.2 "DM Sans", system-ui, sans-serif;
  outline: none;
  background: #f8f9fc;
}

.rlp-search input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(19, 42, 142, 0.08);
  background: #fff;
}

.rlp-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52vh, 360px);
  overflow-x: hidden;
  overflow-y: auto !important;
  padding: 0.35rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.rlp-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.65rem 0.55rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.12s ease;
}

.rlp-row:hover,
.rlp-row.is-active {
  background: #f4f6fb;
}

.rlp-row--near {
  margin-bottom: 0.25rem;
  background: linear-gradient(90deg, #fff7ed, #fff);
  border: 1px solid rgba(255, 122, 26, 0.2);
}

.rlp-row__text {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.rlp-row__title {
  font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  font-weight: 750;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  color: #0b1957;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rlp-row__sub {
  font-size: 0.72rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rlp-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.88rem;
}

.rlp-country-hint {
  margin: 0.15rem 0.35rem 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  background: #eef2ff;
  color: #132a8e;
  font: 650 0.78rem/1.3 "DM Sans", system-ui, sans-serif;
}

.rlp-country-hint strong {
  font-weight: 800;
}

.rlp-row.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

/* Drop-off extras */
.rlp-extras {
  margin-top: 0.75rem;
}

.rlp-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3d4452;
  user-select: none;
}

.rlp-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #ff7a1a;
}

.rlp-drop {
  margin-top: 0.55rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.22s ease, margin 0.22s ease;
}

.rlp-drop.is-open {
  max-height: 12rem;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .rlp-drop,
  .rlp-dropdown,
  .rlp-sheet__panel {
    transition: none !important;
    animation: none !important;
  }
}

/* Mobile bottom sheet */
.rlp-sheet {
  position: fixed;
  inset: 0;
  z-index: 220;
}

.rlp-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 11, 31, 0.45);
  animation: rlp-fade 0.2s ease;
}

@keyframes rlp-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.rlp-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88svh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 1.25rem 1.25rem 0 0;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  box-shadow: 0 -18px 40px rgba(5, 11, 31, 0.25);
  animation: rlp-sheet-up 0.25s ease;
}

@keyframes rlp-sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

.rlp-sheet__grab {
  width: 2.5rem;
  height: 0.28rem;
  border-radius: 999px;
  background: #d1d5db;
  margin: 0.55rem auto 0.25rem;
}

.rlp-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 1rem 0.5rem;
  font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  color: #0b1957;
}

.rlp-sheet__x {
  border: 0;
  background: #f3f4f6;
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #374151;
}

.rlp-sheet .rlp-search {
  padding-inline: 1rem;
}

.rlp-sheet .rlp-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto !important;
  padding: 0.35rem 0.65rem 1rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.rlp-sheet-open {
  overflow: hidden;
}

/* Standalone (location landings) */
.rlp-standalone {
  display: grid;
  gap: 0.75rem;
}

.rlp-standalone .rlp-field {
  width: 100%;
}

/* Keep clipping ancestors open while our dropdown is used */
form.rlp-enhanced:has(.rlp-trigger[aria-expanded="true"]),
form.relative:has(.rlp-trigger[aria-expanded="true"]) {
  z-index: 50;
  overflow: visible !important;
}

div.overflow-clip:has(.rlp-trigger[aria-expanded="true"]) {
  overflow: visible !important;
}

section.relative.flex.h-\[100svh\].max-h-\[100svh\].flex-col.overflow-hidden:has(
    .rlp-trigger[aria-expanded="true"]
  ) {
  overflow: visible !important;
  z-index: 40;
}
