.header-spacer {
  min-width: 1px;
}

.mega-menu {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.mega-menu.open {
  height: 238px;
}

.menu-panel {
  height: 216px;
  grid-template-columns: 1fr;
  grid-template-rows: 52px 1fr;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.menu-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr;
  background: #f7f7f7;
}

.menu-tab {
  border: 0;
  border-right: 1px solid #e4e4e4;
  border-bottom: 1px solid #e2e2e2;
  background: #f7f7f7;
  font-weight: 800;
}

.menu-tab:last-child {
  border-right: 0;
}

.menu-tab.active {
  background: #2f3338;
  color: #fff;
}

.menu-groups {
  position: relative;
  background: #fff;
}

.menu-group {
  position: static;
  inset: auto;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: center;
  gap: 10px 22px;
  padding: 20px 28px;
}

.menu-group.active {
  display: grid;
}

.menu-group a {
  min-height: 42px;
  place-items: center start;
  border-bottom: 1px solid #eee;
  padding: 8px 4px;
  font-weight: 700;
  word-break: keep-all;
}

.menu-group a:hover {
  background: #fafafa;
  color: #245472;
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: 1fr auto 1fr;
  }

  .header-spacer {
    display: block;
  }

  .logo img {
    width: 142px;
  }

  .header-actions {
    gap: 10px;
  }

  .lang {
    max-width: 132px;
    border-radius: 18px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
  }

  .menu-toggle span {
    width: 34px;
    height: 5px;
  }

  .mega-menu {
    top: 77px;
    background: rgba(255, 255, 255, 0.99);
  }

  .mega-menu.open {
    height: auto;
    max-height: calc(100vh - 77px);
    overflow-y: auto;
  }

  .menu-panel {
    display: block;
    width: calc(100% - 24px);
    height: auto;
    margin: 10px auto 14px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  }

  .menu-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 48px;
  }

  .menu-tab {
    min-width: 0;
    border-right: 1px solid #e6e6e6;
    border-bottom: 1px solid #e2e2e2;
    background: #f5f5f5;
    font-size: 14px;
  }

  .menu-tab.active {
    background: #2f3338;
    color: #fff;
  }

  .menu-groups {
    min-height: 0;
  }

  .menu-group {
    position: static;
    display: none;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: visible;
    padding: 10px 14px 14px;
  }

  .menu-group.active {
    display: grid;
  }

  .menu-group a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid #ededed;
    padding: 10px 4px;
    text-align: left;
    font-size: 15px;
  }

  .menu-group a:last-child {
    border-bottom: 0;
  }
}
