/* ========== HEADER - GLASSMORPHISM ========== */
.header {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 1000;
  background: rgba(42, 6, 44, 0.3) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(147, 51, 234, 0.2) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  justify-content: center;
  padding: 0;
  /* Убеждаемся, что glassmorphism работает */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.header::before {
  display: none !important;
}

/* Убеждаемся, что wrapper не переопределяет эффекты */
.header .header-wrapper {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.header-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  position: relative;
}


.header.scrolled {
  /* Основной фон с прозрачностью для glassmorphism */
  background: rgba(42, 6, 44, 0.65) !important;
  /* Glassmorphism эффекты - должны быть всегда */
  backdrop-filter: blur(25px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
  /* Дополнительные эффекты для усиления glassmorphism */
  border-bottom: 1px solid rgba(147, 51, 234, 0.4) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 
              0 0 0 1px rgba(147, 51, 234, 0.1) inset !important;
  transition: all 0.3s ease !important;
  /* Убеждаемся, что эффекты не переопределяются */
  will-change: backdrop-filter, background;
}

.header.scrolled::before {
  display: none !important;
}

/* Убеждаемся, что glassmorphism эффекты сохраняются */
.header.scrolled .header-wrapper {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.header.scrolled .header__logo {
  text-shadow: 0 0 10px rgba(147, 51, 234, 0.5) !important;
}

.header.scrolled .header__menu {
  backdrop-filter: blur(25px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
}

.header.scrolled .header__menu a {
  color: rgba(255, 255, 255, 0.9) !important;
}

.header.scrolled .header__menu a:hover {
  color: #ffffff !important;
  background: rgba(147, 51, 234, 0.15) !important;
}

/* ========== HEADER MENU ========== */
.header__menu {
  display: flex !important;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  background: transparent !important;
}

.header__menu li {
  margin: 0;
  padding: 0;
}

.header__menu a {
  position: relative;
  color: rgba(255, 255, 255, 0.9) !important;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  background: transparent !important;
}

.header__menu a:hover {
  color: #ffffff !important;
  transform: translateY(-2px);
  background: rgba(147, 51, 234, 0.1) !important;
}

.header__menu a[aria-current="page"] {
  color: #ffffff !important;
}

.header__logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
  transition: all 0.3s ease;
}

.header__logo:hover {
  transform: scale(1.05);
}

.header__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(90deg, #620080 0%, #ec4899 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.header__cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5);
  background: linear-gradient(90deg, #ec4899 0%, #620080 100%);
}

/* ========== MOBILE MENU ========== */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  transition: all 0.3s ease;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.menu-toggle:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .header {
    height: 70px;
  }
  
  .header-wrapper {
    padding: 0 16px;
  }
  
  .header__logo {
    font-size: 1.2rem;
  }
  
  .menu-toggle {
    display: flex;
    font-size: 0;
    padding: 0;
  }
  
  .header__menu {
    position: fixed !important;
    top: 70px;
    left: 0;
    width: 100%;
    background: rgba(42, 6, 44, 0.98) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border-bottom: 1px solid rgba(147, 51, 234, 0.3) !important;
    flex-direction: column !important;
    align-items: center;
    gap: 0 !important;
    padding: 0;
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
  }
  
  /* Сохраняем glassmorphism при скролле для мобильного меню */
  .header.scrolled .header__menu {
    background: rgba(42, 6, 44, 0.98) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
  }
  
  .header__menu.active {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    padding: 20px 0;
  }
  
  .header__menu li {
    width: 100% !important;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
    transition-delay: 0s;
    list-style: none !important;
  }
  
  .header__menu.active li {
    opacity: 1;
    transform: translateX(0);
  }
  
  .header__menu.active li:nth-child(1) {
    transition-delay: 0.1s;
  }
  
  .header__menu.active li:nth-child(2) {
    transition-delay: 0.15s;
  }
  
  .header__menu.active li:nth-child(3) {
    transition-delay: 0.2s;
  }
  
  .header__menu.active li:nth-child(4) {
    transition-delay: 0.25s;
  }
  
  .header__menu a {
    width: 90% !important;
    margin: 0 auto !important;
    padding: 0.75rem 1.2rem !important;
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    display: block !important;
    transition: all 0.3s ease;
    background: transparent !important;
    border-radius: 8px;
  }
  
  .header__menu a:hover {
    color: #ffffff !important;
    background: rgba(147, 51, 234, 0.2) !important;
    transform: translateX(5px);
  }
}

@media (max-width: 480px) {
  .header {
    height: 65px;
  }
  
  .header-wrapper {
    padding: 0 12px;
  }
  
  .header__logo {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
  }
  
  .menu-toggle {
    width: 36px;
    height: 36px;
  }
  
  .menu-toggle span {
    width: 22px;
    height: 2.5px;
  }
  
  .header__menu {
    top: 65px;
  }
  
  .header__menu.active {
    padding: 15px 0;
  }
  
  .header__menu a {
    width: 95%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
  }
}
