/* Адаптивная навигация с гамбургер-меню */

/* Базовые стили навигации */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 0.75rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-secondary-light) !important;
  text-decoration: none;
  z-index: 1001;
}

.navbar-brand:hover {
  color: var(--color-secondary) !important;
}

/* Кнопка гамбургера */
.navbar-toggler {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1002;
}

.navbar-toggler-icon {
  width: 25px;
  height: 3px;
  background-color: var(--color-secondary-light);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-secondary-light);
  margin: 6px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Анимация гамбургера при открытии */
.navbar-toggler.active .navbar-toggler-icon {
  background-color: transparent;
}

.navbar-toggler.active .navbar-toggler-icon::before {
  transform: rotate(45deg) translate(7px, 7px);
}

.navbar-toggler.active .navbar-toggler-icon::after {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Контейнер навигации */
.navbar-collapse {
  display: flex;
  flex-grow: 1;
  align-items: center;
  justify-content: flex-end;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 1rem;
  flex-direction: row;
}

.navbar-nav li {
  position: relative;
}

/* Основные ссылки навигации */
.nav-link {
  color: var(--color-neutral-light) !important;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 4px;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-secondary-light) !important;
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* Dropdown стили */
.dropdown {
  position: relative;
}

.dropdown-toggle::after {
  content: '▼';
  font-size: 0.7rem;
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-primary-dark);
  border: none;
  border-radius: 8px;
  box-shadow: var(--shadow-heavy);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  margin-top: 0.5rem;
}

/* Десктопные hover эффекты */
@media (min-width: 992px) {
  .dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
  }

  .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  /* Убираем JS показ dropdown на десктопе */
  .dropdown.show .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
  }
  
  /* Принудительно убираем JS класс show */
  .dropdown.show {
    position: relative;
  }
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--color-neutral-light) !important;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-secondary-light) !important;
  text-decoration: none;
}

/* Планшеты и средние экраны */
@media (max-width: 991px) {
  .navbar-toggler {
    display: flex;
  }
  
  .navbar-collapse {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    background-color: var(--color-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 4rem 0 2rem 0;
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  
  .navbar-collapse.show {
    left: 0;
  }
  
  .navbar-nav {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  
  .navbar-nav li {
    width: 100%;
  }
  
  .nav-link {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    font-size: 1rem;
  }
  
  /* Dropdown в мобильной версии */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .dropdown.show .dropdown-menu {
    max-height: 300px;
  }
  
  .dropdown-item {
    padding: 0.75rem 2rem;
    border-left: 3px solid var(--color-secondary);
  }
  
  .dropdown-toggle::after {
    float: right;
    margin-top: 0.3rem;
  }
  
  /* Оверлей для закрытия меню */
  .navbar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .navbar-backdrop.show {
    opacity: 1;
    visibility: visible;
  }
}

/* Мобильные устройства */
@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .navbar-collapse {
    width: 280px;
  }
  
  .nav-link {
    font-size: 0.95rem;
  }
  
  .dropdown-item {
    font-size: 0.9rem;
    padding: 0.5rem 2rem;
  }
}

/* Десктоп - принудительно горизонтальная навигация */
@media (min-width: 992px) {
  .navbar {
    flex-direction: row !important;
  }
  
  .navbar-collapse {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    width: auto !important;
    height: auto !important;
    background-color: transparent !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  
  .navbar-nav {
    flex-direction: row !important;
    gap: 1rem;
    width: auto !important;
    align-items: center;
  }
  
  .navbar-nav li {
    width: auto !important;
  }
  
  .nav-link {
    padding: 0.5rem 1rem !important;
    border-bottom: none !important;
    border-radius: 4px !important;
    font-size: 0.95rem !important;
  }
  
  .navbar-toggler {
    display: none !important;
  }
}

/* Десктоп - улучшения для больших экранов */
@media (min-width: 1200px) {
  .navbar-nav {
    gap: 1.5rem;
  }
  
  .nav-link {
    font-size: 1rem;
  }
  
  .dropdown-menu {
    min-width: 250px;
  }
} 