.header {
  position: fixed;
  width: 100%;
  height: 14vh;
  z-index: 20; /* Увеличиваем z-index, чтобы шапка была над мобильным меню */
  transition: all 0.5s ease-in-out;
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  top: 0;
  left: 0;
}

.header.scrolled {
  background-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  height: 12vh;
}

/* Новый класс для шапки после прокрутки карусели */
.header.after-carousel {
  background-color: rgba(83, 97, 189, 0.9);
  box-shadow: var(--shadow-md);
}

/* Изменение цвета ссылок в шапке после прокрутки карусели */
.header.after-carousel .header-link {
  color: white;
}

.header.after-carousel .header-logo img {
  filter: brightness(1.1);
}

.header-container {
  height: 100%;
  margin: var(--container);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.header-logo {
  font-family: var(--primary-font-family);
  font-size: 30px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 90px;
  width: auto;
  max-width: 300px;
  transition: var(--transition-fast);
}

.header.scrolled .header-logo img {
  height: 80px;
  max-width: 280px;
}

.header-logo::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -5px;
  left: 0;
  background-color: var(--brand);
  transition: var(--transition-fast);
}

.header-logo:hover::after {
  width: 100%;
}

.header-navigation {
  font-family: var(--secondary-font-family);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-link {
  padding: 10px 20px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 520;
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  transition: var(--transition-fast);
  border-radius: 50px;
  cursor: pointer;
  color: aliceblue;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.header-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition-medium);
}

.header-link:hover {
  background-color: var(--brand);
  transform: translateY(-2px);
}

.header-link:hover::before {
  left: 100%;
}

.header-navigation-button {
  display: none;
}

.header_menu_button {
  display: none;
  position: relative;
  z-index: 30; /* Кнопка меню должна быть над всеми элементами */
  transition: var(--transition-fast);
}

.header_menu_button:hover {
  transform: scale(1.05);
}

/* Анимация для появления шапки */
@keyframes headerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  animation: headerFadeIn 1s ease-out forwards;
}

@media(max-width: 1200px) {
  .header-navigation {
    display: none;
  }

  .header_menu_button {
    display: block;
  }

  .header-container {
    margin: 0px 20px;
  }
}

/* Медиа-запросы для планшетов */
@media (max-width: 768px) {
  .header {
    height: 12vh;
  }

  .header.scrolled {
    height: 11vh;
  }

  .header-logo {
    font-size: 26px;
  }
  
  .header-logo img {
    height: 75px;
    max-width: 250px;
  }
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 480px) {
  .header {
    height: 11vh;
  }
  
  .header.scrolled {
    height: 10vh;
  }
  
  .header-container {
    margin: 0px 15px;
  }

  .header-logo {
    font-size: 22px;
  }
  
  .header-logo img {
    height: 65px;
    max-width: 200px;
  }
}

