.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: visible;
  background: rgba(250, 251, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(198, 203, 194, 0.56);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 21px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo a {
  font-size: 18px;
  font-weight: 700;
  color: #233828;
  text-decoration: none;
}

.header-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 880px;
}

.header-nav-top {
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: stretch;
  border-left: 1px solid rgba(199, 203, 210, 0.55);
}

.header-nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 26px;
  border: 0;
  border-right: 1px solid rgba(199, 203, 210, 0.55);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: #2f3848;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.header-nav:hover .header-nav-trigger,
.header-nav:focus-within .header-nav-trigger {
  color: #1f2940;
}

.header-nav-item:hover .header-nav-trigger,
.header-nav-item:focus-within .header-nav-trigger {
  background: rgba(244, 246, 251, 0.88);
}

.header-nav-item {
  position: relative;
  display: flex;
  flex: 1 1 0;
}

.header-mega-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  right: auto;
  width: min(1480px, calc(100vw - 32px));
  max-width: none;
  transform: translate(-50%, -12px);
  padding: 18px 0 22px;
  border: 1px solid rgba(212, 216, 223, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 42px rgba(21, 31, 47, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.24s ease,
    visibility 0.24s ease;
}

.header-mega-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
}

.header-mega-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(220, 230, 244, 0.16)),
    radial-gradient(circle at top left, rgba(115, 155, 235, 0.16), transparent 36%);
  z-index: 0;
}

.site-header:hover .header-mega-menu,
.site-header:focus-within .header-mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.header-mega-column {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 164px;
  padding: 0 18px;
  border-right: 1px solid rgba(219, 222, 227, 0.92);
}

.header-mega-column:last-child {
  border-right: 0;
}

.header-mega-title {
  margin: 0 0 10px;
  color: #1c2432;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-dropdown-link {
  position: relative;
  display: block;
  width: fit-content;
  padding: 7px 2px;
  border-radius: 0;
  color: #404a5a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.18s ease, transform 0.18s ease;
}

.header-dropdown-link-emphasis {
  color: #1f5d35;
  font-weight: 700;
}

.header-dropdown-link:hover {
  color: #0d5bd1;
  transform: translateY(1px);
}

.header-login a {
  font-size: 14px;
  color: #314137;
  text-decoration: none;
}

.header-login {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user-name {
  font-size: 13px;
  color: #4b5d50;
  font-weight: 600;
}

.header-logout-form {
  margin: 0;
}

.header-logout-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #bfcfbe;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #294031;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.header-logout-button:hover {
  background: #eef4ed;
  border-color: #aabca8;
}

.header-logout-button:active {
  transform: translateY(1px);
}

@media (max-width: 980px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .header-nav-top {
    flex-wrap: wrap;
    gap: 8px;
    border-left: 0;
  }

  .header-nav {
    min-width: 0;
    width: 100%;
  }

  .header-mega-menu {
    left: 0;
    right: auto;
    width: 100%;
    transform: translateY(-12px);
  }

  .header-mega-inner {
    grid-template-columns: 1fr;
    padding: 0 18px;
  }

  .site-header:hover .header-mega-menu,
  .site-header:focus-within .header-mega-menu {
    transform: translateY(0);
  }

  .header-nav-trigger {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
    padding: 0 18px;
    border: 1px solid rgba(199, 203, 210, 0.55);
  }

  .header-mega-column {
    min-height: 0;
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(219, 222, 227, 0.92);
  }

  .header-mega-column:last-child {
    border-bottom: 0;
  }
}
