.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #1a1a1dc0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  padding: 10px 0;
  border-bottom: 1px solid #333;
  backdrop-filter: blur(2px);
}

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

.logo-title-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-logo img {
  height: 50px;
  transition: transform 0.3s ease;
}

.nav-logo img:hover {
  transform: scale(1.05);
}

.nav-title h2 {
  color: #fff;
  margin: 0;
  font-size: 1.4em;
  font-weight: 500;
  white-space: nowrap;
}

.lang-switcher {
  display: flex;
  gap: 10px;
  padding: -5px;
  text-align: center;
  vertical-align: middle;
}

.lang-flag {
    font-size: 1.5em;
    opacity: 0.7;
    transition: all 0.3s;
    text-decoration: none;
    vertical-align: middle;
}

.lang-flag:hover {
    opacity: 1;
    transform: scale(1.1);
    vertical-align: middle;
}

.lang-flag.active {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    vertical-align: middle;
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
  flex: 1;
  justify-content: flex-start;
  margin-left: 30px;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.95em;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.1);
}

.nav-links .active {
  color: #ffbc00 !important;
  font-weight: 600;
  background: rgba(255,188,0,0.1);
}

.cta-button {
  background: rgba(255,188,0,0.1);
  color: #ffbc00 !important;
  /* padding: 8px 20px !important; */
  border-radius: 25px;
  margin-left: 15px;
}

.cta-button:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.mobile-header {
  display: none;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.mobile-logo {
  display: flex !important;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger.active span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger.active span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.desktop-title {
  display: block;
}

.user-panel {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
  padding-right: 20px;
  order: 999;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #2d2d30;
  padding: 8px 15px;
  border-radius: 25px;
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #404040;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  transition: transform 0.2s;
}

.icon-btn:hover {
  transform: scale(1.1);
}

.login-btn.icon-btn {
  width: 40px;
  height: 40px;
  background: rgba(255,188,0,0.1);
  border-radius: 10px;
  color: #ffbc00 !important;
}

.login-btn.icon-btn:hover {
  background: rgba(255,255,255,0.1);
}

.logout-btn.icon-btn {
  color: #fff;
}

.user-info:hover::after {
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.8em;
  margin-top: 5px;
  opacity: 0;
  animation: fadeInDown 0.3s forwards;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Новые стили для мобильного меню */
.mobile-user-panel {
  display: none;
  width: 100%;
  padding: 15px 0;
  border-top: 1px solid #333;
}

@media (max-width: 768px) {
  .header-nav {
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
  }

  .nav-logo img {
    height: 40px;
  }

  .nav-title h2 {
    font-size: 1.2em;
  }

  .nav-links {
    order: 2;
    width: 100%;
    margin-left: 0;
    gap: 15px;
    justify-content: flex-start;
  }

  .nav-links a {
    font-size: 0.9em;
    padding: 6px 10px;
  }

  .cta-button {
    margin-left: 0;
  }

  .user-panel {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    padding-right: 0;
  }
}

@media (max-width: 480px) {
  .desktop-user-panel {
    display: none !important;
  }
  
  .mobile-user-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .nav-links.open .mobile-user-panel {
    display: flex;
  }
  
  .header-nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
  }

  .logo-title-group {
    display: none;
  }

  .desktop-title {
    display: none;
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: -35px; */
  }

  .nav-links {
    margin-top: -35px;
    padding: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 10px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
  }

  .nav-links.open {
    margin-top: -5px;
    opacity: 1;
    max-height: 500px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-links a,
  .cta-button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 10px;
    text-align: left;
    white-space: normal;
    /* overflow: hidden; */
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-links.open a,
  .nav-links.open .cta-button {
    opacity: 1;
    transform: translateX(0);
  }
}