/**
 * Стили для хедера сайта
 */

:root {
  --header-opacity: 0.7; /* Уменьшили с 0.8 до 0.7 для снижения непрозрачности */
  --divider-thickness: 2px;
  --video-brightness: 1; /* Регулировка яркости видео: 1 - нормальная яркость, 0 - полностью темное */
  --video-overlay-opacity: 0.6; /* Увеличили с 0.5 до 0.6 для лучшей видимости контента на фоне */
  --primary-color: #0071CE;
  --text-color: #333;
  --light-color: #fff;
  --hover-color: #005ba5;
}

/* Фоновое видео или изображение */
.background-video-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
}

.background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: brightness(var(--video-brightness));
}

.background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  z-index: -2;
  filter: brightness(var(--video-brightness));
}

/* Затемняющий слой поверх видео */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, var(--video-overlay-opacity));
  z-index: -1;
  pointer-events: none;
}

/* Стили хедера */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, var(--header-opacity));
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 999; /* Хедер имеет значительно меньший z-index, чем модальное окно */
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 50px;
}

.header-logo img,
.custom-logo {
  height: 40px;
  width: auto;
}

.header-logo .site-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.header-contacts {
  display: flex;
  align-items: center;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

.contact-item:hover {
  color: var(--primary-color);
}

.divider {
  height: 20px;
  width: var(--divider-thickness);
  background-color: var(--primary-color);
  margin: 0 10px;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-color);
  transition: color 0.3s, transform 0.3s;
}

.social-icon:hover {
  color: var(--primary-color);
  transform: scale(1.2);
}

.call-button {
  background-color: var(--primary-color);
  color: var(--light-color);
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.call-button:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);
}

.header-divider {
  margin: 0 50px;
  height: var(--divider-thickness);
  background-color: var(--primary-color);
  border-radius: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 100px;
  transition: opacity 0.3s ease;
  z-index: 90;
}

.header-nav {
  padding: 15px 50px;
  display: flex;
  justify-content: center;
  gap: 40px;
}

.nav-item {
  position: relative;
  font-weight: 500;
  padding: 5px 0;
  cursor: pointer;
  color: var(--text-color);
  text-decoration: none;
}

.nav-item:hover {
  color: var(--primary-color);
}

.nav-item:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

.nav-item:hover:after {
  width: 100%;
}

.has-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.dropdown-title {
  position: relative;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
}

.has-dropdown:hover .dropdown-arrow,
.has-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 600px;
  opacity: 0;
  visibility: hidden;
  transform-origin: top center;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

.dropdown-container {
  padding: 20px;
  display: flex;
  gap: 20px;
}

.dropdown-column {
  flex: 1;
}

.dropdown-heading {
  font-weight: 600;
  margin: 0 0 15px 0;
  color: var(--primary-color);
  font-size: 16px;
}

.dropdown-item {
  padding: 8px 0;
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: color 0.2s, transform 0.2s;
  color: var(--text-color);
  text-decoration: none;
}

.dropdown-item:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

.dropdown-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-image img {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  object-fit: cover;
}

/* Настройка отображения выпадающего меню на десктопе */
@media (min-width: 769px) {
  .has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* Мобильное меню */
.mobile-menu-toggle {
  display: none;
  width: 30px;
  height: 24px;
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  z-index: 200;
  cursor: pointer;
}

.mobile-menu-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--text-color);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.mobile-menu-toggle span:nth-child(1) {
  top: 0px;
}

.mobile-menu-toggle span:nth-child(2) {
  top: 10px;
}

.mobile-menu-toggle span:nth-child(3) {
  top: 20px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  top: 10px;
  transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.mobile-menu-toggle.active span:nth-child(3) {
  top: 10px;
  transform: rotate(-45deg);
}

/* Отступ для основного контента, чтобы не перекрываться с хедером */
.site-content {
  margin-top: 130px; /* Адаптируйте значение в зависимости от высоты хедера */
  position: relative;
  z-index: 1;
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
  .header {
    max-height: 100vh;
    overflow-y: visible;
  }

  .header-top {
    flex-direction: row;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 20px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .header-contacts {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 20px;
    padding: 80px 20px 30px;
    z-index: 150;
    overflow-y: auto;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform, opacity;
  }

  .header-divider {
    display: none;
  }

  .header-contacts.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .header-nav {
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 15px;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .nav-item {
    font-size: 16px;
    width: 100%;
    margin-bottom: 10px;
  }

  .nav-item:after {
    display: none;
  }

  .site-content {
    margin-top: 80px;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    width: 100%;
    min-width: 100%;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateX(0);
  }

  .dropdown-container {
    flex-direction: column;
    padding: 10px 0 10px 15px;
    gap: 10px;
  }

  .dropdown-column {
    width: 100%;
    margin-bottom: 15px;
  }

  .dropdown-image {
    display: none; /* Скрываем изображения в мобильной версии */
  }

  .has-dropdown {
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .has-dropdown .dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 12px;
    transition: transform 0.3s;
    pointer-events: none; /* Чтобы стрелка не перехватывала клики */
  }

  .has-dropdown .dropdown-title {
    display: block;
    width: 100%;
    padding-right: 30px; /* Чтобы текст не перекрывался со стрелкой */
  }

  .has-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
  }

  .has-dropdown.active .dropdown-menu {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 5;
  }

  .dropdown-heading {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .dropdown-item {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: block;
    width: 100%;
    position: relative;
    z-index: 5;
    pointer-events: auto;
  }

  /* Запрет прокрутки при открытом мобильном меню */
  body.menu-open {
    overflow: hidden;
  }
}
