#header {
  min-height: 168px;
  height: auto;
  padding-bottom: 58px;
}

#mega-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  box-sizing: border-box;
  border: solid 1px #d9dde2;
  background: #fff;
  max-width: 100%;
}

#mega-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu-list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  min-height: 44px;
  max-width: 100%;
}

.mega-menu-item {
  position: static;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.mega-menu-link {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  max-width: 190px;
  min-height: 44px;
  overflow: hidden;
  padding: 0 12px;
  color: #595959;
  font-size: 12px;
  font-weight: bold;
  line-height: 17px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mega-menu-link:hover,
.mega-menu-item:hover > .mega-menu-link,
.mega-menu-item:focus-within > .mega-menu-link {
  background: #29b4d4;
  color: #fff;
}

.has-mega-panel > .mega-menu-link:after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.mega-panel {
  box-sizing: border-box;
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  width: 100%;
  max-width: 100%;
  min-height: 150px;
  max-height: 70vh;
  overflow: auto;
  padding: 20px 22px;
  border: solid 1px #d9dde2;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  text-align: left;
}

.mega-menu-item:hover .mega-panel,
.mega-menu-item:focus-within .mega-panel {
  display: flex;
  gap: 22px;
}

.mega-panel-feature {
  box-sizing: border-box;
  flex: 0 0 210px;
  width: 210px;
  margin-right: 0;
  padding-right: 22px;
  border-right: solid 1px #d9dde2;
  color: #595959;
}

.mega-panel-feature span {
  display: block;
  margin-bottom: 6px;
  color: #999;
  font-size: 11px;
  text-transform: uppercase;
}

.mega-panel-feature strong {
  display: block;
  margin-bottom: 14px;
  color: #333;
  font-size: 21px;
  font-weight: normal;
  line-height: 25px;
  overflow-wrap: anywhere;
}

.mega-panel-feature a {
  display: inline-block;
  color: #239ab5;
  font-size: 13px;
  font-weight: bold;
}

.mega-subcategories {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 6px 18px;
  flex: 1;
  min-width: 0;
}

.mega-subcategories a {
  display: block;
  overflow: hidden;
  padding: 7px 0;
  color: #595959;
  font-size: 13px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mega-subcategories a:hover {
  color: #29b4d4;
}

@media (max-width: 1020px) {
  .mega-panel {
    width: 100%;
  }

  .mega-menu-link {
    max-width: 165px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 820px) {
  #header {
    height: auto;
    padding-bottom: 0;
  }

  #mega-menu {
    margin-top: 18px;
    position: static;
    text-align: left;
  }

  .mega-menu-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .mega-menu-item {
    position: relative;
    display: block;
    border-bottom: solid 1px #d9dde2;
  }

  .mega-menu-link {
    display: block;
    max-width: none;
    min-height: 0;
    overflow: visible;
    white-space: normal;
    line-height: 22px;
    padding: 13px 14px;
  }

  .has-mega-panel > .mega-menu-link:after {
    float: right;
    margin-top: 8px;
  }

  .mega-panel,
  .mega-menu-item:hover .mega-panel,
  .mega-menu-item:focus-within .mega-panel {
    display: block;
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: visible;
    min-height: 0;
    padding: 0 14px 14px;
    border: 0;
    box-shadow: none;
  }

  .mega-panel-feature {
    width: auto;
    margin: 0 0 8px;
    padding: 0;
    border-right: 0;
  }

  .mega-panel-feature span,
  .mega-panel-feature strong {
    display: none;
  }

  .mega-subcategories {
    display: block;
  }

  .mega-subcategories a {
    padding: 5px 0;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .mega-menu-list {
    grid-template-columns: 1fr;
  }
}
