.map-picker-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.42);
}

.map-picker-scrim[hidden],
.map-picker[hidden],
.map-picker__pin[hidden],
.map-picker__radius[hidden],
.map-picker__location-loader[hidden] {
  display: none;
}

.map-picker {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 91;
  width: min(760px, calc(100vw - 24px));
  height: min(680px, calc(100vh - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cfe1f4;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
}

.map-picker__bar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #1565c0;
  color: #fff;
}

.map-picker__bar strong {
  flex: 1;
  min-width: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-picker__close,
.map-picker__current {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.map-picker__current:disabled {
  cursor: default;
  opacity: 0.72;
}

.map-picker__current.is-loading .map-picker__current-icon {
  display: none;
}

.map-picker__current.is-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loading-spin 760ms linear infinite;
}

.map-picker__canvas {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  background: #dce8f2;
  touch-action: none;
  cursor: grab;
}

.map-picker__canvas.is-dragging {
  cursor: grabbing;
}

.map-picker__tiles {
  position: absolute;
  inset: 0;
}

.map-picker__tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  -webkit-user-drag: none;
}

.map-picker__radius {
  position: absolute;
  border: 2.5px solid rgba(21, 101, 192, 0.95);
  border-radius: 50%;
  background: rgba(33, 150, 243, 0.3);
  pointer-events: none;
}

.map-picker__pin {
  position: absolute;
  z-index: 5;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -82%);
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}

.map-picker__pin:active {
  cursor: grabbing;
}

.map-picker__pin::before {
  content: "\f193";
  color: #d32f2f;
  font-family: "MaterialIcons";
  font-size: 56px;
  line-height: 1;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.28);
}

.map-picker__zoom {
  position: absolute;
  right: 12px;
  top: 70px;
  display: grid;
  gap: 6px;
}

.map-picker__zoom button {
  width: 38px;
  height: 38px;
  border: 1px solid #dde7f2;
  border-radius: 8px;
  background: #fff;
  color: #17212b;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.map-picker__banner {
  position: absolute;
  z-index: 7;
  top: 12px;
  left: 12px;
  right: 58px;
  min-height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #17212b;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  font-weight: 700;
}

.map-picker__banner::before {
  content: "\e8dc";
  flex: 0 0 auto;
  color: #1565c0;
  font-family: "MaterialIcons";
  font-size: 19px;
  line-height: 1;
}

.map-picker__banner[data-icon="drag"]::before {
  content: "\e89f";
}

.map-picker__location-loader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
}

.map-picker__location-loader .loading-spinner {
  width: 56px;
  height: 56px;
  border-width: 4px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}

.map-picker__bottom {
  display: grid;
  gap: 10px;
  padding: 10px 16px 16px;
  background: #fff;
  border-top: 1px solid #dde7f2;
}

.map-picker__status {
  min-height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #17212b;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.map-picker__status .loading-spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.map-picker__status {
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-picker__bottom .search-button {
  width: 100%;
  height: 44px;
}

.map-picker__bottom .search-button:disabled {
  background: #e0e0e0;
  color: #8b8f94;
}

@media (max-width: 760px) {
  .map-picker {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: min(88vh, 760px);
    transform: none;
    border-radius: 8px 8px 0 0;
  }

  .map-picker__bar {
    min-height: 50px;
  }

  .map-picker__banner {
    right: 58px;
    font-size: 12px;
  }

  .map-picker__zoom {
    top: 68px;
  }
}
