/* Yandex map modal — B.LAB */

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.map-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.map-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.map-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(92vh, 720px);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s ease;
}

.map-modal.is-open .map-modal__dialog {
  transform: translateY(0) scale(1);
}

.map-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.map-modal__close:hover {
  background: #fff;
}

.map-modal__header {
  padding: 24px 56px 16px 24px;
  border-bottom: 1px solid var(--border);
}

.map-modal__brand {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.map-modal__title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.map-modal__address {
  margin: 0;
  font-family: var(--font-desc);
  font-size: 14px;
  color: var(--text-muted);
}

.map-modal__frame-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 360px;
  background: #e8e8e8;
  overflow: hidden;
}

.map-modal__map {
  width: 100%;
  height: min(56vh, 480px);
  min-height: 360px;
  z-index: 0;
}

.map-modal__map .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: var(--font-desc);
}

.map-modal__loading,
.map-modal__error {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
  margin: 0;
  padding: 24px;
  text-align: center;
  font-family: var(--font-desc);
  font-size: 14px;
  color: var(--text-muted);
}

.map-modal__error a {
  color: var(--text);
}

.map-modal__external {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 24px 20px;
  align-self: flex-start;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(17, 17, 17, 0.22);
  transition: border-color var(--transition), color var(--transition);
}

.map-modal__external:hover {
  border-color: var(--text);
}

body.map-modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .map-modal__header {
    padding: 20px 48px 14px 18px;
  }

  .map-modal__title {
    font-size: 18px;
  }

  .map-modal__map {
    min-height: 280px;
    height: 50vh;
  }

  .map-modal__external {
    margin-left: 18px;
    margin-right: 18px;
  }
}
