/* Страница Контакты */

.contacts-page {
  width: 100%;
  min-height: 100vh;
}

/* Hero: только звезда справа */
.contacts-hero-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-top: 32px;
}

.contacts-hero-star {
  position: absolute;
  top: -80px;
  height: 799px;
  width: auto;
  pointer-events: none;
  z-index: 0;
}

.contacts-hero-star--right {
  right: 0;
  transform: scaleX(-1);
}

.contacts-hero-container {
  position: relative;
  max-width: 1500px;
  padding-inline: clamp(24px, calc(100px - (1500px - 100vw) * 76px / 416px), 100px);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  z-index: 1;
  margin-bottom: 160px;
}

.contacts-page .contacts-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "title right"
    "form right";
  gap: 48px;
  align-items: stretch !important;
}

@media (max-width: 1023px) {
  .contacts-page .contacts-hero-inner {
    grid-template-columns: 1fr;
    /* Заголовок «Написать нам» — вплотную к форме, а не в самом верху:
       иначе он оказывается над контактами и картой, к которым не относится. */
    grid-template-areas:
      "right"
      "title"
      "form";
  }

  .contacts-map-wrap {
    min-height: 470px;
  }

  .contacts-map-wrap .ymaps-2-1-79-map {
    height: 470px !important;
  }
}

/* Левый блок: форма */
.contacts-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.contacts-title {
  grid-area: title;
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 64px;
  line-height: 100%;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #108669;
  margin: 0;
  text-shadow: 0px 16px 25px 0px #10866929;
}

.contacts-form-card {
  grid-area: form;
  border-radius: 32px;
  padding: 24px;
  gap: 48px;
  background: #FFFFFF;
  box-shadow: 0px 0px 24px 1px #2F2F2F0A,
              0px 1px 1px -0.5px #2F2F2F0A,
              0px 3px 3px -1.5px #2F2F2F0A,
              0px 6px 6px -3px #2F2F2F0A,
              0px 12px 12px -6px #2F2F2F0A,
              0px 24px 24px -12px #2F2F2F0A,
              0px 0px 0px 1px #2F2F2F0A;
  display: flex;
  flex-direction: column;
}

.contacts-form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contacts-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 16px;
  border: 1px solid #EEEEEE;
  background: #FAFAFA;
  padding: 32px 24px;
  box-sizing: border-box;
}

.contacts-form-field--error {
  border-color: #e5484d;
  background: #fff8f8;
}

.contacts-form-field input,
.contacts-form-field textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 510;
  font-size: 24px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #2B2B2B;
  outline: none;
  box-sizing: border-box;
}

.contacts-form-field input::placeholder,
.contacts-form-field textarea::placeholder {
  color: #BABABA;
}

.contacts-form-field textarea {
  min-height: 160px;
  resize: vertical;
}

.contacts-form-submit {
  border-radius: 36px;
  padding: 16px 32px;
  gap: 10px;
  background: #108669;
  border: none;
  cursor: pointer;
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 590;
  font-size: 20px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  width: 100%;
  box-sizing: border-box;
}

.contacts-form-submit:hover {
  opacity: 0.9;
}

.contacts-form-error-msg {
  margin: 0;
  padding: 0;
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 510;
  font-size: 14px;
  line-height: 130%;
  color: #c62a2a;
}

/* Правый блок: контакты и карта — высота как у левого, карта заполняет остаток */
.contacts-page .contacts-right {
  grid-area: right;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.contacts-info-row {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.contacts-info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.contacts-info-block--location {
  margin-top: 40px;
}

.contacts-info-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.contacts-info-label {
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 32px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #2B2B2B;
  margin: 0;
}

.contacts-info-value {
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 510;
  font-style: normal;
  font-size: 24px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #2B2B2B;
  margin: 0;
}

.contacts-map-wrap {
  width: 100%;
  flex: 1 1 0;
  min-height: 400px;
  margin-top: 40px;
  border-radius: 24px;
  overflow: hidden;
  background: #eee;
}

.contacts-map-wrap iframe,
.contacts-map-wrap div[style*="width"] {
  width: 100% !important;
  height: 100% !important;
}

/* Пока не задан API-ключ Яндекс.Карт — вместо пустого блока ссылка */
.contacts-map-wrap--fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
  background: #f4f8f6;
  border: 1px solid #dfeae6;
  text-decoration: none;
  transition: background 0.2s ease;
}

.contacts-map-wrap--fallback:hover {
  background: #eaf3ef;
}

.contacts-map-fallback-text {
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 590;
  font-size: 20px;
  color: var(--color-green, #108669);
}

.contacts-map-fallback-address {
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  color: #2b2b2b;
}

.contacts-page .footer-container {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  padding-inline: clamp(24px, calc(100px - (1500px - 100vw) * 76px / 416px), 100px);
}

@media (max-width: 768px) {
  .contacts-hero-container {
    margin-bottom: 64px;
  }

  .contacts-page .contacts-hero-inner {
    gap: 24px;
  }

  .contacts-hero-star {
    display: none;
  }

  .contacts-title {
    font-size: 32px;
  }

  .contacts-info-row {
    flex-direction: column;
    gap: 16px;
  }

  .contacts-info-block--location {
    margin-top: 16px;
  }

  .contacts-info-icon {
    width: 40px;
    height: 40px;
  }

  .contacts-info-label {
    font-size: 20px;
  }

  .contacts-info-value {
    font-size: 16px;
  }

  .contacts-map-wrap {
    margin-top: 24px;
  }

  .contacts-form-card {
    gap: 24px;
  }

  .contacts-form-field {
    padding: 25px 12px;
  }

  .contacts-form-field input,
  .contacts-form-field textarea {
    font-size: 14px;
  }

  .contacts-form-field textarea {
    min-height: 120px;
  }

  .contacts-form-submit {
    font-size: 16px;
  }
}
