/* Ресурс Групп — мелкие правки поверх собранного CSS: мобильная шапка,
   клавиатурный фокус, уменьшение анимации. Отдельный файл, чтобы не править бандл. */

/* Логотип не переносится и не обрезается на узких экранах */
.brand-title {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .brand-title {
    font-size: 14px !important;
    letter-spacing: -0.03em !important;
  }
}

@media (max-width: 380px) {
  .brand-title {
    font-size: 12.5px !important;
  }
}

/* Видимый фокус для навигации с клавиатуры */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Картинки не вылезают за контейнер */
img {
  max-width: 100%;
  height: auto;
}

/* Тем, кто просил уменьшить анимацию, не показываем бегущую строку терминала и пульсацию */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Узкие экраны: шапка не должна выпихивать кнопку меню за границу экрана */
@media (max-width: 520px) {
  .brand-title {
    font-size: 12.5px !important;
  }

  header .btn {
    font-size: 13px !important;
    padding: 9px 11px !important;
    white-space: nowrap;
  }

  /* Перенос только целыми строками: телефон и почта не рвутся посередине */
  header a[href^="tel:"],
  header a[href^="mailto:"] {
    white-space: nowrap;
  }
}

/* Контраст мелкого текста: было #64748b (≈4.2:1), стало светлее — проходит AA */
:root {
  --text-subtle: #8494ab;
}

.ik-form-consent {
  color: #94a3b8 !important;
}

/* Cookie-баннер на телефоне: компактнее, чтобы не закрывать первый экран */
@media (max-width: 640px) {
  #ik-cookie-banner {
    padding: 0 10px 10px !important;
  }

  #ik-cookie-banner .ik-cc-box {
    padding: 12px 14px !important;
    gap: 10px !important;
    border-radius: 14px !important;
  }

  #ik-cookie-banner .ik-cc-icon {
    display: none !important;
  }

  #ik-cookie-banner .ik-cc-text {
    font-size: 12px !important;
    line-height: 1.45 !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }

  #ik-cookie-banner .ik-cc-actions {
    margin-left: 0 !important;
    width: 100%;
  }

  #ik-cookie-banner .ik-cc-btn {
    padding: 10px 16px !important;
    font-size: 13px !important;
    flex: 1 1 auto;
  }
}

/* --- Контакты: колонки выровнены по нижнему краю --- */
@media (min-width: 900px) {
  .contacts-grid {
    align-items: stretch !important;
  }

  /* реквизиты: пары «подпись / значение» в две колонки — карточка вдвое ниже */
  .contacts-grid > div:first-child > .glass-card:last-child > div:nth-child(2) {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px 28px !important;
    grid-auto-flow: row dense;
  }

  /* длинные значения (название, юр. адрес) — во всю ширину, короткие — парами */
  .contacts-grid > div:first-child > .glass-card:last-child > div:nth-child(2) > div:nth-child(1),
  .contacts-grid > div:first-child > .glass-card:last-child > div:nth-child(2) > div:nth-child(5) {
    grid-column: 1 / -1;
  }

  /* форма тянется на высоту левой колонки: воздух распределяется между полями,
     а не копится одним пустым блоком над кнопкой */
  .contacts-grid > .glass-card:last-child {
    display: flex !important;
    flex-direction: column;
  }

  .contacts-grid > .glass-card:last-child form {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  /* свободная высота уходит в поле комментария — форма заполняет карточку без пустот */
  .contacts-grid > .glass-card:last-child form > div:nth-child(3) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }

  .contacts-grid > .glass-card:last-child form textarea {
    flex: 1 1 auto;
    min-height: 140px;
    height: auto !important;
  }

  .contacts-grid > .glass-card:last-child form > button[type="submit"] {
    margin-top: 18px;
  }


}

/* Планшеты (900–1100): шапка была шире экрана — кнопка «Запросить КП» уезжала за край */
@media (min-width: 521px) and (max-width: 1100px) {
  header .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  header nav {
    gap: 2px !important;
  }

  header nav button,
  header nav a {
    font-size: 13.5px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  header .btn {
    padding: 9px 14px !important;
    font-size: 13.5px !important;
  }
}

/* Верхняя строка шапки на телефоне: контакты переносятся, а не растягивают страницу */
@media (max-width: 760px) {
  /* группа контактов в верхней строке: переносим адреса, а не растягиваем страницу */
  header div.container > div:last-child {
    flex-wrap: wrap !important;
    row-gap: 4px !important;
    justify-content: flex-start !important;
  }

  header div.container a[href^="mailto:"],
  header div.container a[href^="tel:"] {
    font-size: 12px !important;
  }
}

/* Телефоны: в верхней строке оставляем один адрес — она «липкая» и не должна съедать экран.
   Второй адрес есть в карточке контактов, в подвале и в политике. */
@media (max-width: 640px) {
  header div.container a[href="mailto:info@resurs-grupp.ru"] {
    display: none !important;
  }
}
