.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.brand picture {
  display: block;
  line-height: 0;
}

.brand img,
.brand picture img {
  display: block;
  width: 132px;
  max-height: 74px;
  object-fit: contain;
}

.brand-fallback {
  display: none;
  color: var(--blue-dark);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 34px;
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
  font-size: 15px;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 92px;
  white-space: nowrap;
  transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.main-nav a.is-active,
.main-nav a[aria-current="page"] {
  color: var(--blue);
}

.main-nav a.active::after,
.main-nav a.is-active::after,
.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 23px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: var(--blue-dark);
}

@media (max-width: 820px) {
  .header-inner {
    min-height: 74px;
  }

  .brand img,
  .brand picture img {
    width: 112px;
    max-height: 58px;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    left: 20px;
    right: 20px;
    top: 74px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(11, 49, 95, 0.14);
  }

  body.nav-open .main-nav {
    display: flex;
  }

  .main-nav a {
    min-height: auto;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .main-nav a:hover,
  .main-nav a.active,
  .main-nav a.is-active,
  .main-nav a[aria-current="page"] {
    background: #f2f8ff;
  }

  .main-nav a.active::after,
  .main-nav a.is-active::after,
  .main-nav a[aria-current="page"]::after {
    display: none;
  }
}

/* Logo size adjustment */
.brand img,
.brand picture img {
  width: 150px;
  max-height: 82px;
}

/* Mobile menu polish */
@media (max-width: 820px) {
  .site-header {
    position: sticky;
  }

  .menu-toggle {
    position: relative;
    transition: 0.2s ease;
  }

  .menu-toggle:hover {
    border-color: rgba(18, 103, 179, 0.35);
    background: #f7fbff;
  }

  body.nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .menu-toggle span {
    transition: 0.2s ease;
  }

  .main-nav {
    z-index: 30;
  }

  .main-nav a {
    font-size: 16px;
    font-weight: 800;
  }
}

/* Reliable mobile menu open state */
@media (max-width: 820px) {
  .main-nav.is-open,
  body.nav-open .main-nav {
    display: flex !important;
  }

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Header spacing after adding Administrare IT */
@media (min-width: 821px) {
  .main-nav {
    gap: 22px;
    font-size: 14px;
  }
}
