/**
 * @file
 * Секция «Контакты» (нода mt_contact): сетка — контент слева, липкая карта справа.
 */

.mt-contacts-section {
  scroll-margin-top: 6rem;
  width: 100%;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .mt-contacts-section {
    margin-top: 2rem;
    margin-bottom: 0;
  }
}

.mt-contacts-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.mt-contacts-section__main,
.mt-contacts-section__map-col {
  min-width: 0;
}

/* Левая колонка: форма, контакты, «Как добраться» */
.mt-contacts-section__main {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

@media (min-width: 1024px) {
  .mt-contacts-section__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.75rem;
    /* Map column height follows left (form + contacts ± «Как добраться»). */
    align-items: stretch;
  }
}

/* Оболочка формы обратной связи — как sticky: белая карточка + серый .wfb-sticky-inner */
.mt-contacts-section__form-shell.wfb-sticky-root {
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  background-color: #fff;
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid #f3f4f6;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
}

@media (min-width: 768px) {
  .mt-contacts-section__form-shell.wfb-sticky-root {
    padding: 1.125rem;
  }
}

.mt-contacts-section__form-shell .wfb-sticky-title {
  margin: 0 0 0.35rem;
  font-size: clamp(0.95rem, 0.9rem + 0.35vw, 1.1rem);
  font-weight: 500;
  color: #1e293b;
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.mt-contacts-section__form-lead {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}

.mt-contacts-section__form-inner.wfb-sticky-inner {
  background-color: #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 992px) {
  .mt-contacts-section__form-inner.wfb-sticky-inner {
    padding: 0.875rem 1rem;
    gap: 0.65rem;
  }
}

.mt-contacts-section__form-inner > * {
  margin: 0;
}

/* Карточка вокруг webform — legacy, если шаблон без sticky-оболочки */
.mt-contacts-section__form-card {
  position: relative;
  height: fit-content;
  padding: 1.125rem 1.125rem 1rem;
  border: 1px solid #f3f4f6;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
}

@media (min-width: 768px) {
  .mt-contacts-section__form-card {
    padding: 1.25rem 1.25rem 1.125rem;
  }
}

.mt-contacts-section__form-title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

.mt-contacts-section__form-inner {
  position: relative;
}

/* Правая колонка: карта */
.mt-contacts-section__map-col .geo-card-wrapper {
  margin-top: 0;
}

/* Мобильная карта */
.mt-contacts-section__map-col .geo-card__map-wrapper {
  min-height: 16rem;
}

.mt-contacts-section__map-col .geo-card__map {
  min-height: 16rem;
}

.mt-contacts-section__map-col .geo-card__map iframe,
.mt-contacts-section__map-col .geo-card__map .geolocation-map-container,
.mt-contacts-section__map-col .geo-card__map .leaflet-container {
  width: 100% !important;
  min-height: 16rem;
}

@media (min-width: 1024px) {
  /*
   * Map height tracks left column only.
   * height:0 + min-height:100% — map does not contribute to row sizing
   * (otherwise alean-geo 220px iframe / leaflet keeps the map taller than left).
   */
  .mt-contacts-section__main {
    grid-row: 1;
  }

  .mt-contacts-section__map-col {
    grid-row: 1;
    position: relative;
    top: 0 !important;
    align-self: stretch;
    z-index: 2;
    height: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mt-contacts-section__map-col .geo-card-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin-top: 0;
  }

  .mt-contacts-section__map-col .geo-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    height: 100% !important;
  }

  .mt-contacts-section__map-col .geo-card__map-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0 !important;
    height: auto;
  }

  .mt-contacts-section__map-col .geo-card__map {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0 !important;
    height: 100% !important;
  }

  .mt-contacts-section__map-col .geo-card__map > * {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100% !important;
  }

  /* Beat alean-geo.css height: 220px !important */
  .mt-contacts-section__map-col .geo-card__map iframe,
  .mt-contacts-section__map-col .geo-card__map .geolocation-map-container,
  .mt-contacts-section__map-col .geo-card__map .leaflet-container {
    flex: 1 1 auto;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }
}
