/* Навигация */
.navbar {
  background: #f9f9f9;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Логотип */
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  text-decoration: none;
  padding: 1rem 0;
  display: inline-block;
}

/* Бургер-меню (скрыт на десктопе, виден на мобильных) */
.burger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 30px;
  height: 22px;
  position: relative;
  z-index: 1001;
}

.burger span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #333;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.burger span:nth-child(1) {
  top: 0;
}
.burger span:nth-child(2) {
  top: 9px;
}
.burger span:nth-child(3) {
  top: 18px;
}

.burger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 9px;
}

/* Десктопное меню (горизонтальное) */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: static;
}

.nav-link {
  color: #04395e;
  text-decoration: none;
  padding: 1.2rem 0;
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  transition: color 0.3s;
  position: relative;
}

.nav-link:hover {
  color: #667eea;
}

/* Индикатор для пунктов с подменю */
.has-dropdown > .nav-link::after {
  font-size: 0.7rem;
  margin-left: 5px;
  opacity: 0.6;
}

/* ВЫПАДАЮЩЕЕ МЕНЮ - на всю ширину, центрировано */
.dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 999;
  border-top: 3px solid #667eea;
  border-radius: 5px;
}

/* Контейнер содержимого выпадашки - центрирован и 1280px */
.dropdown-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  gap: 40px;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Стили для колонок */
.dropdown-column {
  flex: 1;
}

.dropdown-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #667eea;
  display: inline-block;
}

.dropdown-list {
  list-style: none;
}

.dropdown-list li {
  margin-bottom: 10px;
}

.dropdown-list a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s;
  display: block;
  padding: 5px 0;
}

.dropdown-list a:hover {
  color: #667eea;
  transform: translateX(5px);
}

/* 2-й и 3-й уровни */
.submenu {
  list-style: none;
  margin-top: 10px;
  margin-left: 15px;
}

.submenu li {
  margin-bottom: 8px;
}

.submenu a {
  font-size: 0.9rem;
  color: #888;
}

.submenu a:hover {
  color: #667eea;
}

.has-submenu > a {
  font-weight: 500;
  color: #555;
}

/* Карточки/баннеры */
.dropdown-featured {
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
  padding: 20px;
  border-radius: 12px;
}

.featured-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #667eea;
}

.featured-text {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
}

/* ========== МОБИЛЬНАЯ ВЕРСИЯ (max-width: 768px) ========== */
@media (max-width: 768px) {
  /* Показываем бургер */
  .burger {
    display: block;
  }

  /* Меню скрыто по умолчанию, выезжает слева */
  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    flex-direction: column;
    gap: 0;
    padding: 80px 20px 30px;
    transition: left 0.3s ease;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
  }

  .nav-menu.active {
    left: 0;
  }

  /* Оверлей */
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid #eee;
    position: static;
  }

  .nav-link {
    padding: 1rem 0;
    display: block;
    width: 100%;
  }

  /* Выпадашка в мобильной версии */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    display: none;
    border-top: none;
    border-left: 3px solid #667eea;
    margin-left: 10px;
    margin-top: 5px;
    background: #f9f9f9;
  }

  .nav-item.active .dropdown-menu {
    display: block;
  }

  .dropdown-container {
    flex-direction: column;
    padding: 20px;
    gap: 25px;
  }

  .has-dropdown > .nav-link::after {
    content: " ▶";
    float: right;
    font-size: 0.8rem;
  }

  .has-dropdown.active > .nav-link::after {
    content: " ▼";
  }

  .dropdown-column {
    width: 100%;
  }

  .submenu {
    margin-left: 15px;
  }
}
