/**
 * Sprint 18.4.470 — Location popover above search bar (z-index fix)
 */

/* Utility / topbar row must stack above main search header */
.site-header .utility-bar,
.site-header .tf-topbar,
.site-header .tf-topbar-inner,
#tf-global-header .utility-bar,
#tf-global-header .tf-topbar,
#tf-global-header .tf-topbar-inner {
  position: relative !important;
  z-index: 1300 !important;
}

.tf-topbar-location-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  z-index: 1310 !important;
}

.tf-location-popover {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  left: 0 !important;
  z-index: 1400 !important;
  min-width: 260px !important;
  max-width: min(320px, 92vw) !important;
  padding: 14px !important;
  border-radius: 14px !important;
  background: #fff !important;
  border: 1px solid #e6eef8 !important;
  box-shadow: 0 14px 36px rgba(7, 27, 70, 0.18) !important;
  color: #0b2f66 !important;
  /* isolate so nothing in search row paints over */
  isolation: isolate !important;
}

.tf-location-popover[hidden] {
  display: none !important;
}

.tf-location-popover > strong {
  display: block !important;
  margin: 0 0 4px !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  color: #0b2f66 !important;
}

.tf-location-popover > small,
.tf-location-popover [data-tf-location-status] {
  display: block !important;
  margin: 0 0 12px !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #5b6b7c !important;
}

.tf-location-detect {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(100deg, #f4b72f, #e0a40f) !important;
  color: #1a1200 !important;
  font-size: 13.5px !important;
  font-weight: 850 !important;
  cursor: pointer !important;
  box-shadow: 0 8px 18px rgba(224, 164, 15, 0.28) !important;
  transition: filter 0.15s ease, opacity 0.15s ease !important;
}

.tf-location-detect:hover:not(:disabled) {
  filter: brightness(1.03) !important;
}

.tf-location-detect:disabled,
.tf-location-detect.is-loading {
  opacity: 0.75 !important;
  cursor: wait !important;
}

.tf-location-detect svg {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 auto !important;
}

/* Search row should stay below location popover */
.site-header .header-main,
.site-header .tf-header-main,
.site-header .tf-header-search-row,
#tf-global-header .header-main,
#tf-global-header .tf-header-main,
#tf-global-header .tf-header-search,
#tf-global-header .global-search {
  position: relative !important;
  z-index: 20 !important;
}

@media (max-width: 640px) {
  .tf-location-popover {
    left: auto !important;
    right: 0 !important;
    min-width: 240px !important;
  }
}
