:root {
  --ufirst-orange: #ff4f00;
  --ufirst-black: #101010;
  --ufirst-cream: #f5f0e7;
}

html.ufirst-map-modal-open,
body.ufirst-map-modal-open {
  overflow: hidden !important;
}

.ufirst-map-modal[hidden] {
  display: none !important;
}

.ufirst-map-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.ufirst-map-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
}

.ufirst-map-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  border-top: 4px solid var(--ufirst-orange);
  transform: translateY(8px) scale(.985);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.ufirst-map-modal.is-open .ufirst-map-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ufirst-map-modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px 12px 20px;
  background: var(--ufirst-black);
  color: #fff;
}

.ufirst-map-modal__bar h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.2;
  font-weight: 800;
}

.ufirst-map-modal__close {
  appearance: none;
  border: 0;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: var(--ufirst-orange);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.ufirst-map-modal__content {
  padding: 12px;
  background: var(--ufirst-cream);
  max-height: calc(92vh - 72px);
  overflow: auto;
}

.ufirst-map-modal__content img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(92vh - 96px);
  margin: 0 auto;
  object-fit: contain;
}

@media (max-width: 767px) {
  .ufirst-map-modal {
    padding: 10px;
  }

  .ufirst-map-modal__dialog {
    width: 96vw;
    max-height: 95vh;
    border-radius: 12px;
  }

  .ufirst-map-modal__bar {
    padding: 10px 10px 10px 14px;
  }

  .ufirst-map-modal__bar h2 {
    font-size: 17px;
  }

  .ufirst-map-modal__close {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .ufirst-map-modal__content {
    padding: 6px;
    max-height: calc(95vh - 60px);
  }

  .ufirst-map-modal__content img {
    max-height: calc(95vh - 72px);
  }
}