/* ===== HEADER ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background-color: #b2b1ff9c;
  color: white;
  flex-wrap: wrap;
  gap: 20px;
}

.logo-container {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-text {
  text-align: right;
  flex: 1;
  min-width: 200px;
}

.header-text h1 {
  font-size: 1.8rem;
  margin: 0;
}

/* Сохраняет исходный вид заголовка в шапке на внутренних страницах. */
.header-text .site-title {
  font-size: 1.8rem;
  margin: 0;
  color: #000;
  font-weight: 700;
  line-height: 1.2;
}

.header-text p {
  font-size: 1rem;
  opacity: 0.9;
  margin: 5px 0 0;
  padding-right: 60px; /* сдвинет влево */
  text-align: right;
}

/* ===== NAVIGATION ===== */
/* ==== Главная Услуги О компании Блог Контакты ===== */
.main-nav {
  background-color: #002b5c;
  /* липкое позиционирование position: sticky; */
  position: sticky;
  top: 0;
  /* слои (z-ось). Оно определяет, какой элемент будет ближе к пользователю, а какой перекрываться другими */
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 2);
}

.nav-container {
  width: 100%;
  margin: 0;
  padding: 0 20px;
}

.nav-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  padding: 12px 0;
  margin: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-menu > li {
  position: relative;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: var(--transition);
  display: block;
  text-align: center;
  min-width: 100px;
}

.nav-menu a:hover,
.nav-menu a:focus {
  color: #fff;
  background-color: #004a99;
}

/* Выпадающее меню (dropdown) */
/* Контейнер выпадающего меню */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  z-index: 100;
  backdrop-filter: blur(0);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Анимация при открытии */
.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin: 0;
}

/* Ссылки в выпадающем меню */
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #1a2c3e;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

/* Иконки для пунктов (если добавишь) */
.dropdown-menu a::before {
  content: "→";
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.25s ease;
  font-size: 0.9rem;
}

/* Эффект при наведении */
.dropdown-menu a:hover {
  background: linear-gradient(90deg, #e8f0fe 0%, #ffffff 100%);
  color: #0066cc;
  padding-left: 28px;
}

.dropdown-menu a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* Разделитель между пунктами */
.dropdown-menu li:not(:last-child) a {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Первый пункт - скругление сверху */
.dropdown-menu li:first-child a {
  border-radius: 12px 12px 0 0;
}

/* Последний пункт - скругление снизу */
.dropdown-menu li:last-child a {
  border-radius: 0 0 12px 12px;
}

/* ===== MAIN CONTENT ===== */
.cards-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 30px;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.open-form {
  display: block;
  margin: 0 auto 40px;
  padding: 12px 30px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.open-form:hover {
  background-color: #cc0000;
  transform: translateY(-2px);
}

/* ===== FOOTER ===== */
#site-footer {
  background-color: #b2b1ff9c;
  color: black;
  padding: 30px 0;
  margin-top: auto; /* работает с flex-контейнером .page */
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-left,
.footer-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-left p {
  margin: 0;
  font-size: 1rem;
}

.footer-phone a,
.footer-email a {
  color: black;
  text-decoration: none;
  transition: var(--transition);
}

.footer-phone a:hover,
.footer-email a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-right {
  text-align: right;
}

.metrika-link {
  display: inline-block;
  width: 88px;
  height: 31px;
  background: none;
  background-size: contain;
  opacity: 0.8;
  transition: opacity 0.2s;
}

html.analytics-consent-granted .metrika-link {
  background-image: url('https://informer.yandex.ru/informer/103989291/3_1_FFFFFFFF_EFEFEFFF_0_pageviews');
  background-repeat: no-repeat;
}

.metrika-link:hover {
  opacity: 1;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .main-nav {
    position: static;
  }

  header {
    flex-direction: column;
    text-align: center;
  }

  .logo-container {
    width: 80px;
    height: 80px;
  }

  .header-text h1,
  .header-text .site-title {
    font-size: 1.5rem;
  }

  .header-text,
  .header-text p {
    text-align: center;
    padding-right: 0;
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .nav-menu > li {
    width: 100%;
  }

  .nav-menu a {
    min-width: auto;
    padding: 10px;
  }

  .dropdown-menu {
    display: none;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background-color: #003366;
    margin-top: 8px;
    padding: 6px 0;
    border: 0;
  }

  .dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown > a::after {
    content: " ▾";
    display: inline-block;
    transition: transform var(--transition);
  }

  .dropdown.open > a::after {
    transform: rotate(180deg);
  }

  .dropdown-menu a {
    color: #fff;
    justify-content: flex-start;
    padding: 10px 16px;
  }

  .dropdown-menu a:hover,
  .dropdown-menu a:focus {
    color: #fff;
    background: #004a8f;
    padding-left: 22px;
  }

  .cards-container {
    grid-template-columns: 1fr;
    padding: 20px 15px;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .footer-right {
    text-align: center;
  }
}
