.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 110px;
  background: transparent;
  backdrop-filter: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: none;
}

.navbar.scrolled {
  height: 80px;
  background: rgba(243, 238, 239, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(238, 10, 16, 0.15);
}

.navbar.hidden {
  transform: translateY(-100%);
  box-shadow: none;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 1480px;
  max-width: 100%;
  padding: 0 40px;
  position: relative;
}

.navbar-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.brand-link {
  text-decoration: none;
  color: var(--text-color-main);
  display: flex;
  align-items: center;
  position: relative;
}

.brand-logo {
  height: 85px;
  width: auto;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  content: url("/assets/img/logo_white.png");
}

.navbar.scrolled .brand-logo {
  height: 65px;
  content: url("/assets/img/logo.png");
}

.navbar-menu {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  padding: 8px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.navbar.scrolled .navbar-menu {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
}

.navbar-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  position: relative;
  border-radius: 25px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background: linear-gradient(
    135deg,
    rgba(238, 10, 16, 0.1),
    rgba(238, 10, 16, 0.05)
  );
  transform: translateY(-1px);
}

.nav-link {
  text-decoration: none;
  color: var(--light-color);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 12px 18px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.navbar.scrolled .nav-link {
  color: var(--text-color-main);
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(238, 10, 16, 0.1),
    rgba(238, 10, 16, 0.05)
  );
  border-radius: 25px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    rgba(238, 10, 16, 0.7)
  );
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: var(--primary-color);
  transform: translateY(-1px);
  font-weight: 600;
}

.nav-link:hover::before {
  width: 100%;
}

.nav-link:hover::after {
  width: 60%;
}

.navbar-cta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  z-index: 1001;
}

.cta-button {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 55px;
  width: 200px;
  background: var(--gradient-primary);
  color: var(--light-color);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(238, 10, 16, 0.3);
  letter-spacing: 0.5px;
  border: 2px solid transparent;
}

.cta-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

.cta-button::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2),
    transparent,
    rgba(255, 255, 255, 0.2)
  );
  border-radius: 30px;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cta-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px rgba(238, 10, 16, 0.4);
  background: linear-gradient(135deg, #ee0a10 0%, #c8080d 100%);
}

.cta-button:hover::before {
  left: 100%;
}

.cta-button:hover::after {
  opacity: 1;
}

.cta-button:active {
  transform: translateY(-1px) scale(0.98);
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.navbar-toggle:hover {
  background: rgba(238, 10, 16, 0.1);
}

.toggle-line {
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--light-color),
    rgba(255, 255, 255, 0.8)
  );
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.navbar.scrolled .toggle-line {
  background: linear-gradient(
    90deg,
    var(--text-color-main),
    rgba(238, 10, 16, 0.8)
  );
}

.navbar-toggle:hover .toggle-line {
  background: linear-gradient(
    90deg,
    var(--primary-color),
    rgba(238, 10, 16, 0.9)
  );
}

.navbar-toggle.active .toggle-line:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.navbar-toggle.active .toggle-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-toggle.active .toggle-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.toggle-block {
  display: none;
}

/* Prevent scroll when mobile menu is open */
body.menu-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .navbar-container {
    padding: 0 30px;
  }

  .navbar-brand {
    width: 30%;
  }

  .navbar-cta {
    width: 40%;
    justify-content: center;
  }

  .toggle-block {
    width: 30%;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
  }

  .navbar-menu {
    display: none;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  .navbar-menu.active {
    display: flex;
  }

  .navbar-toggle {
    display: flex;
  }

  .cta-button {
    width: 160px;
    height: 50px;
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 70px;
    padding: 0;
  }

  .navbar.scrolled {
    height: 60px;
  }

  .navbar-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 15px;
    gap: 0;
  }

  /* Logo - левая колонка */
  .navbar-brand {
    grid-column: 1;
    justify-self: start;
    width: auto;
  }

  .brand-logo {
    height: 45px;
  }

  .navbar.scrolled .brand-logo {
    height: 40px;
  }

  /* Language selector - центральная колонка */
  .navbar-actions {
    grid-column: 2;
    justify-self: center;
    display: flex !important;
    order: 0;
  }

  .navbar-cta {
    display: none;
  }

  .language-selector {
    position: relative;
  }

  .language-toggle {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    min-width: auto;
  }

  .navbar.scrolled .language-toggle {
    background: linear-gradient(
      135deg,
      rgba(238, 10, 16, 0.05),
      rgba(238, 10, 16, 0.02)
    );
    border-color: rgba(238, 10, 16, 0.2);
    color: var(--text-color-main);
  }

  .globe-icon {
    width: 16px;
    height: 16px;
  }

  .current-lang {
    font-size: 12px;
    font-weight: 600;
  }

  /* Burger menu - правая колонка */
  .toggle-block {
    grid-column: 3;
    justify-self: end;
    display: flex;
    width: auto;
  }

  .navbar-toggle {
    display: flex;
    width: 30px;
    height: 22px;
  }

  /* Mobile menu */
  .navbar-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(20, 20, 24, 0.98);
    backdrop-filter: blur(20px);
    padding: 20px 0;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 999;
  }

  .navbar.scrolled .navbar-menu {
    top: 60px;
    height: calc(100vh - 60px);
    background: rgba(243, 238, 239, 0.98);
  }

  .navbar-menu.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  .nav-item {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0;
  }

  .navbar.scrolled .nav-item {
    border-bottom-color: rgba(238, 10, 16, 0.05);
  }

  .nav-link {
    padding: 18px 20px;
    font-size: 16px;
    color: var(--light-color);
  }

  .navbar.scrolled .nav-link {
    color: var(--text-color-main);
  }

  /* CTA button в мобильном меню */
  .navbar-menu.active .navbar-cta {
    display: flex;
    width: 100%;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-menu.active .cta-button {
    width: 100%;
    text-align: center;
    height: 50px;
  }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
  .navbar {
    height: 60px;
  }

  .navbar.scrolled {
    height: 55px;
  }

  .navbar-container {
    padding: 0 10px;
  }

  .brand-logo {
    height: 40px;
  }

  .navbar.scrolled .brand-logo {
    height: 35px;
  }

  .language-toggle {
    padding: 6px 10px;
  }

  .globe-icon {
    width: 14px;
    height: 14px;
  }

  .current-lang {
    font-size: 11px;
  }

  .navbar-toggle {
    width: 28px;
    height: 20px;
  }

  .toggle-line {
    height: 2px;
  }

  .navbar-menu {
    top: 60px;
    height: calc(100vh - 60px);
  }

  .navbar.scrolled .navbar-menu {
    top: 55px;
    height: calc(100vh - 55px);
  }
}

/* Scroll behavior enhancement */
.navbar-scrolled-padding {
  padding-top: 130px;
}

@media (max-width: 768px) {
  .navbar-scrolled-padding {
    padding-top: 90px;
  }
}

/* Additional animations for better UX */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-item {
  animation: fadeInUp 0.3s ease forwards;
}

.nav-item:nth-child(1) {
  animation-delay: 0.1s;
}
.nav-item:nth-child(2) {
  animation-delay: 0.2s;
}
.nav-item:nth-child(3) {
  animation-delay: 0.3s;
}
.nav-item:nth-child(4) {
  animation-delay: 0.4s;
}
.nav-item:nth-child(5) {
  animation-delay: 0.5s;
}
.nav-item:nth-child(6) {
  animation-delay: 0.6s;
}

/* Navbar Actions Container */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Language Selector */
.language-selector {
  position: relative;
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 10px 20px;
  cursor: pointer;
  color: var(--light-color);
  font-family: "Gilroy", sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.navbar.scrolled .language-toggle {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  color: var(--text-color-main);
  border-color: rgba(238, 10, 16, 0.1);
}

.language-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.language-toggle:hover {
  background: linear-gradient(
    135deg,
    rgba(238, 10, 16, 0.15),
    rgba(238, 10, 16, 0.1)
  );
  border-color: rgba(238, 10, 16, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(238, 10, 16, 0.15);
}

.language-toggle:hover::before {
  left: 100%;
}

.navbar.scrolled .language-toggle:hover {
  color: var(--primary-color);
}

.globe-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.language-toggle:hover .globe-icon {
  transform: rotate(15deg);
}

.current-lang {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .navbar {
    height: 70px;
    padding: 0;
  }

  .navbar.scrolled {
    height: 60px;
  }

  .navbar-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 15px;
    gap: 0;
  }

  /* Logo - левая колонка */
  .navbar-brand {
    grid-column: 1;
    justify-self: start;
    width: auto;
  }

  .brand-logo {
    height: 45px;
  }

  .navbar.scrolled .brand-logo {
    height: 40px;
  }

  /* Language selector - центральная колонка */
  .navbar-actions {
    grid-column: 2;
    justify-self: center;
    display: flex !important;
    order: 0;
  }

  .navbar-cta {
    display: none;
  }

  .language-selector {
    position: relative;
  }

  .language-toggle {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    min-width: auto;
  }

  .navbar.scrolled .language-toggle {
    background: linear-gradient(
      135deg,
      rgba(238, 10, 16, 0.05),
      rgba(238, 10, 16, 0.02)
    );
    border-color: rgba(238, 10, 16, 0.2);
    color: var(--text-color-main);
  }

  .globe-icon {
    width: 16px;
    height: 16px;
  }

  .current-lang {
    font-size: 12px;
    font-weight: 600;
  }

  /* Burger menu - правая колонка */
  .toggle-block {
    grid-column: 3;
    justify-self: end;
    display: flex;
    width: auto;
  }

  .navbar-toggle {
    display: flex;
    width: 30px;
    height: 22px;
  }

  /* Mobile menu */
  .navbar-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(20, 20, 24, 0.98);
    backdrop-filter: blur(20px);
    padding: 20px 0;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 999;
  }

  .navbar.scrolled .navbar-menu {
    top: 60px;
    height: calc(100vh - 60px);
    background: rgba(243, 238, 239, 0.98);
  }

  .navbar-menu.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  .nav-item {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0;
  }

  .navbar.scrolled .nav-item {
    border-bottom-color: rgba(238, 10, 16, 0.05);
  }

  .nav-link {
    padding: 18px 20px;
    font-size: 16px;
    color: var(--light-color);
  }

  .navbar.scrolled .nav-link {
    color: var(--text-color-main);
  }

  /* CTA button в мобильном меню */
  .navbar-menu.active .navbar-cta {
    display: flex;
    width: 100%;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-menu.active .cta-button {
    width: 100%;
    text-align: center;
    height: 50px;
  }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
  .navbar {
    height: 60px;
  }

  .navbar.scrolled {
    height: 55px;
  }

  .navbar-container {
    padding: 0 10px;
  }

  .brand-logo {
    height: 40px;
  }

  .navbar.scrolled .brand-logo {
    height: 35px;
  }

  .language-toggle {
    padding: 6px 10px;
  }

  .globe-icon {
    width: 14px;
    height: 14px;
  }

  .current-lang {
    font-size: 11px;
  }

  .navbar-toggle {
    width: 28px;
    height: 20px;
  }

  .toggle-line {
    height: 2px;
  }

  .navbar-menu {
    top: 60px;
    height: calc(100vh - 60px);
  }

  .navbar.scrolled .navbar-menu {
    top: 55px;
    height: calc(100vh - 55px);
  }
}
