/* Build 751: Mappi opens OM discovery from a reachable, collapsible map drawer. */

html body main.app-shell section.map-stage .our-map-explorer-button[hidden] {
  display: none !important;
}

html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-explorer-button:not([hidden]) {
  position: fixed !important;
  z-index: 712 !important;
  right: auto !important;
  bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom, 0px) + 22px) !important;
  left: 50% !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 39px minmax(0, auto) 27px !important;
  min-width: 202px !important;
  min-height: 54px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 8px 6px 7px !important;
  border: 1px solid rgba(189, 240, 226, 0.66) !important;
  border-radius: 19px 19px 16px 16px !important;
  color: #17484d !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(107, 226, 194, 0.23), transparent 40%),
    rgba(251, 255, 253, 0.96) !important;
  box-shadow: 0 15px 34px rgba(2, 39, 51, 0.23), inset 0 1px 0 #ffffff !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  transform: translateX(-50%) !important;
  cursor: pointer !important;
}

html body .our-map-explorer-mappi {
  display: grid !important;
  width: 39px !important;
  height: 39px !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #0b8277, #24bfa2) !important;
  box-shadow: 0 7px 15px rgba(5, 111, 101, 0.22) !important;
}

html body .our-map-explorer-mappi img {
  width: 36px !important;
  height: 36px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 4px rgba(1, 38, 44, 0.17)) !important;
}

html body .our-map-explorer-copy {
  display: grid !important;
  min-width: 0 !important;
  gap: 1px !important;
  text-align: left !important;
}

html body .our-map-explorer-copy small {
  color: #0b8578 !important;
  font-size: 0.49rem !important;
  font-weight: 920 !important;
  letter-spacing: 0.06em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

html body .our-map-explorer-copy strong {
  color: #103e45 !important;
  font-size: 0.83rem !important;
  font-weight: 920 !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

html body .our-map-explorer-chevron {
  display: grid !important;
  width: 27px !important;
  height: 27px !important;
  place-items: center !important;
  border-radius: 999px !important;
  color: #08786e !important;
  background: #e2f5ef !important;
}

html body .our-map-explorer-chevron svg {
  width: 15px !important;
  height: 15px !important;
}

html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-discovery-bar:not([hidden]) {
  position: fixed !important;
  z-index: 714 !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom, 0px) + 20px) !important;
  left: 50% !important;
  width: min(760px, calc(100vw - 28px)) !important;
  max-height: min(270px, calc(100dvh - 178px)) !important;
  overflow: auto !important;
  transform: translateX(-50%) !important;
  transform-origin: 50% 100% !important;
  animation: ourMapDrawerArrive 220ms ease-out both !important;
}

html body .our-map-tray-actions {
  display: flex !important;
  min-width: max-content !important;
  align-items: center !important;
  gap: 6px !important;
}

html body .our-map-discovery-close {
  display: grid !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid rgba(16, 128, 112, 0.13) !important;
  border-radius: 14px !important;
  color: #35716d !important;
  background: rgba(231, 247, 241, 0.82) !important;
  cursor: pointer !important;
}

html body .our-map-discovery-close svg {
  width: 18px !important;
  height: 18px !important;
}

html body main.app-shell section.map-stage.map-focus.mappi-explore-ready #logoHomeButton {
  position: relative !important;
  background: rgba(75, 221, 181, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(104, 232, 198, 0.16) !important;
}

html body main.app-shell section.map-stage.map-focus.mappi-explore-ready #logoHomeButton img {
  filter: drop-shadow(0 0 7px rgba(93, 241, 199, 0.55)) !important;
}

html body main.app-shell section.map-stage.map-focus.mappi-explore-invite #logoHomeButton {
  animation: mappiExploreInvite 1.35s ease-in-out 3 !important;
}

html body main.app-shell section.map-stage.map-focus.mappi-explore-invite .our-map-explorer-button:not([hidden]) {
  animation: ourMapExplorerInvite 1.35s ease-in-out 2 !important;
}

html body main.app-shell section.map-stage.map-focus.our-map-mode:has(.mymappi-our-map-popup-shell) .our-map-explorer-button:not([hidden]) {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html body main.app-shell section.map-stage.map-focus.our-map-mode:has(#locationBanner:not([hidden])) .our-map-explorer-button:not([hidden]) {
  bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom, 0px) + 136px) !important;
}

html body main.app-shell section.map-stage.map-focus.our-map-mode.our-map-discovery-open #locationBanner:not([hidden]) {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes ourMapDrawerArrive {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes mappiExploreInvite {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-1px) scale(1.07); }
}

@keyframes ourMapExplorerInvite {
  0%, 100% { box-shadow: 0 15px 34px rgba(2, 39, 51, 0.23), 0 0 0 0 rgba(34, 190, 156, 0); }
  50% { box-shadow: 0 15px 34px rgba(2, 39, 51, 0.23), 0 0 0 7px rgba(34, 190, 156, 0.12); }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-discovery-bar:not([hidden]) {
    top: auto !important;
    bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom, 0px) + 18px) !important;
    width: calc(100vw - 20px) !important;
    max-height: min(264px, calc(100dvh - 168px)) !important;
    border-radius: 21px !important;
  }

  html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-explorer-button:not([hidden]) {
    bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom, 0px) + 18px) !important;
  }

  html body main.app-shell section.map-stage.map-focus.our-map-mode:has(#locationBanner:not([hidden])) .our-map-explorer-button:not([hidden]) {
    bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom, 0px) + 136px) !important;
  }

  html body .our-map-tray-actions {
    gap: 4px !important;
  }

  html body .our-map-discovery-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

@media (max-width: 390px) {
  html body .our-map-pin-key-button {
    min-width: 44px !important;
    width: 44px !important;
    grid-template-areas: "lock" !important;
    grid-template-columns: 1fr !important;
    padding: 0 !important;
  }

  html body .our-map-pin-key-button > :not(:first-child) {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-discovery-bar:not([hidden]),
  html body main.app-shell section.map-stage.map-focus.mappi-explore-invite #logoHomeButton,
  html body main.app-shell section.map-stage.map-focus.mappi-explore-invite .our-map-explorer-button:not([hidden]) {
    animation: none !important;
  }
}
