/* One global location selector for header, home discovery and nearby preview. */
.global-location-picker-layer {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 76px max(22px, calc((100vw - var(--max)) / 2)) 24px;
  background: rgba(1, 8, 15, .42);
  backdrop-filter: blur(4px);
}

.global-location-picker-layer[hidden] {
  display: none !important;
}

body.global-location-picker-open {
  overflow: hidden;
}

.global-location-picker {
  width: min(430px, calc(100vw - 44px));
  padding: 20px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  outline: none;
  background:
    radial-gradient(circle at 92% 4%, rgba(53,215,255,.11), transparent 31%),
    radial-gradient(circle at 4% 100%, rgba(140,255,122,.07), transparent 36%),
    rgba(8,20,33,.985);
  box-shadow: 0 30px 90px rgba(0,0,0,.46);
}

.global-location-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.global-location-picker-head > div {
  display: grid;
  gap: 2px;
}

.global-location-picker-head strong {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.global-location-picker-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.global-location-picker-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.045);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.global-location-picker-close:hover,
.global-location-picker-close:focus-visible {
  outline: none;
  border-color: rgba(140,255,122,.3);
  color: var(--text);
  background: rgba(140,255,122,.07);
}

.global-location-picker-current {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.global-location-picker-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.global-location-picker-field > label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.global-location-picker .city-autocomplete {
  position: relative;
}

.global-location-picker .city-autocomplete-list {
  z-index: 4;
  max-height: min(320px, 42vh);
}

.global-location-picker-status {
  min-height: 18px;
  margin: 7px 0 0;
}

.global-location-picker-detect {
  width: 100%;
  margin-top: 13px;
}

.global-location-picker-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

/* The legacy home editor remains in DOM for compatibility but is no longer a visual surface. */
.home-location-editor {
  display: none !important;
}

#headerLocationButton[aria-expanded="true"] {
  border-color: rgba(140,255,122,.36);
  background: rgba(140,255,122,.075);
  box-shadow: 0 0 0 4px rgba(140,255,122,.055);
}

#eventsCity[data-global-location-owned="true"] {
  display: none !important;
}

.catalog-location-trigger {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.catalog-location-trigger strong {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.quick-search.catalog-location-events-v1 {
  grid-template-columns: minmax(0, 1.2fr) minmax(130px, .8fr) minmax(150px, .85fr) auto;
}

.quick-search.catalog-location-routes-v1 {
  grid-template-columns: minmax(0, 1.15fr) minmax(120px, .7fr) minmax(135px, .7fr) minmax(150px, .85fr) auto;
}

.global-route-location-empty {
  grid-column: 1 / -1;
}

.mobile-location-trigger {
  display: none;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

@media (min-width: 820px) and (max-width: 1180px) {
  .header-location-button {
    display: inline-flex;
    max-width: 148px;
    min-height: 40px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .header-location-button span {
    font-size: 12px;
  }
}

@media (max-width: 1100px) and (min-width: 701px) {
  .quick-search.catalog-location-routes-v1 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 819px) {
  .mobile-nav.global-location-mobile-ready {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .mobile-location-trigger {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1px;
    min-width: 0;
    padding: 0 2px;
    font-size: 9px;
  }

  .mobile-location-trigger > span {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-location-trigger > small {
    overflow: hidden;
    max-width: 100%;
    color: currentColor;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-location-trigger[aria-expanded="true"] {
    color: var(--accent);
  }

  .global-location-picker-layer {
    align-items: flex-end;
    padding: 0;
    background: rgba(1,8,15,.6);
    backdrop-filter: blur(6px);
  }

  .global-location-picker {
    width: 100%;
    max-height: min(82vh, 660px);
    overflow: auto;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .global-location-picker::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin: -7px auto 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
  }

  .global-location-picker-head strong {
    font-size: 21px;
  }

  .global-location-picker .city-autocomplete-list {
    max-height: 250px;
  }
}

@media (max-width: 700px) {
  .quick-search.catalog-location-events-v1,
  .quick-search.catalog-location-routes-v1 {
    grid-template-columns: 1fr;
  }

  .catalog-location-trigger {
    width: 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .global-location-picker-layer:not([hidden]) .global-location-picker {
    animation: global-location-picker-in .16s ease-out;
  }

  @keyframes global-location-picker-in {
    from { opacity: 0; transform: translateY(-7px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  @media (max-width: 819px) {
    .global-location-picker-layer:not([hidden]) .global-location-picker {
      animation-name: global-location-sheet-in;
    }

    @keyframes global-location-sheet-in {
      from { opacity: .72; transform: translateY(22px); }
      to { opacity: 1; transform: translateY(0); }
    }
  }
}
