.addonstack-header {
  --addonstack-nav-color: var(--color-content-black2);
  --addonstack-nav-arrow: none;
}

/* Reduce the main navigation bar by about 25% without shrinking its contents. */
.addonstack-header .header-menu-area3 {
  padding-top: 5.25px;
  padding-bottom: 5.25px;
}

@media (max-width: 1201px) {
  .addonstack-header .header-menu-area3 {
    min-height: 44px;
    padding-top: 8.5px;
    padding-bottom: 8.5px;
  }
  .addonstack-header .hamburger {
    width: 44px;
    height: 44px;
    padding: 15px 9px;
    box-sizing: border-box;
  }
  .addonstack-header .hamburger:focus-visible {
    outline: 2px solid #358db0 !important;
    outline-offset: -2px;
  }
}

/* Keep the regular dropdown above positioned hero sections, as the sticky menu is. */
.addonstack-header:not(.sticky-active) {
  position: relative;
  z-index: 1000;
}

.active-body .addonstack-header {
  --addonstack-nav-color: var(--color-content-white);
  --addonstack-nav-arrow: brightness(0) invert(1);
}

header.addonstack-header .header-menu-area3 nav.main-menu.menu-style1 > ul > li > a[href] {
  background-color: var(--addonstack-nav-bg, transparent);
  color: var(--addonstack-nav-color);
}

header.addonstack-header .header-menu-area3 nav.main-menu.menu-style1 > ul > li > a[href]::before {
  filter: var(--addonstack-nav-arrow);
}

/* Show one highlight per menu. Hover takes priority, then the open or current section. */
.addonstack-header .main-menu > ul > li:has(> a:hover),
.addonstack-header .main-menu > ul:not(:has(> li > a:hover)) > li[data-open="true"],
.addonstack-header .main-menu > ul:not(:has(> li > a:hover, > li[data-open="true"])) > li:has(> a.active) {
  --addonstack-nav-bg: #111;
  --addonstack-nav-color: #fff;
  --addonstack-nav-arrow: brightness(0) invert(1);
}

.addonstack-header .header-logo .addonstack-brand {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.addonstack-header .header-logo .addonstack-brand img {
  width: 197px;
  max-width: 62vw;
  height: auto;
}

.addonstack-header .header-logo .addonstack-brand img,
.active-body .sticky-active.addonstack-header .header-logo .addonstack-brand img {
  filter: none;
}

.addonstack-header .header-logo .addonstack-brand .addonstack-logo-dark,
.active-body .addonstack-header .header-logo .addonstack-brand .addonstack-logo-light {
  display: none;
}

.active-body .addonstack-header .header-logo .addonstack-brand .addonstack-logo-dark {
  display: block;
}

.sticky-active.addonstack-header:not(.is-sticky) {
  visibility: hidden;
}

.addonstack-header .main-menu > ul > li > .addonstack-mega-panel {
  --mega-blue: #1459db;
  --mega-text: #151821;
  --mega-line: #e0e4ec;
  width: min(1140px, 100%);
  max-height: min(var(--mega-available-height, 72vh), 540px);
  grid-template-columns: var(--mega-columns, repeat(3, minmax(0, 1fr)));
  grid-template-areas: var(--mega-layout, "categories subpages featured");
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--mega-line);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgb(16 25 45 / 18%);
  color: var(--mega-text);
  font: 500 14px/1.5 Arial, Helvetica, sans-serif;
  transition: opacity 200ms ease-in, transform 200ms ease-in;
}

.addonstack-mega-panel.mega-feature-left {
  --mega-layout: "featured categories subpages";
}

.addonstack-mega-panel.mega-feature-bottom {
  --mega-layout: "categories subpages" "featured featured";
}

.addonstack-mega-panel.mega-feature-top {
  --mega-layout: "featured featured" "categories subpages";
}

.addonstack-mega-panel:is(.mega-feature-top, .mega-feature-bottom) {
  --mega-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.addonstack-mega-panel [hidden] {
  display: none !important;
}

.addonstack-mega-panel .mega-categories,
.addonstack-mega-panel .mega-subpages,
.addonstack-mega-panel .mega-featured {
  min-width: 0;
  padding: 24px;
}

.addonstack-mega-panel .mega-categories {
  grid-area: categories;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  border-right: 1px solid var(--mega-line);
}

.addonstack-mega-panel .mega-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mega-text);
  font: 600 14px/1.45 Arial, Helvetica, sans-serif;
  text-align: left;
  cursor: pointer;
}

.addonstack-mega-panel .mega-category [aria-hidden="true"] {
  visibility: hidden;
}

.addonstack-mega-panel .mega-category[aria-selected="true"],
.addonstack-mega-panel .mega-category:hover,
.addonstack-mega-panel .mega-category:focus-visible {
  background: #edf3ff;
  color: var(--mega-blue);
}

.addonstack-mega-panel .mega-category[aria-selected="true"] [aria-hidden="true"] {
  visibility: visible;
}

.addonstack-mega-panel .mega-category:focus-visible {
  outline: 2px solid var(--mega-blue);
  outline-offset: 2px;
}

.addonstack-mega-panel .mega-subpages {
  grid-area: subpages;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.addonstack-mega-panel .mega-subpages ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.addonstack-mega-panel .mega-subpages li {
  margin: 0;
}

.addonstack-header .addonstack-mega-panel .mega-subpages a {
  display: block;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--mega-text);
  font-weight: 600;
  text-transform: none;
  overflow-wrap: anywhere;
}

.addonstack-header .addonstack-mega-panel .mega-subpages a:hover,
.addonstack-header .addonstack-mega-panel .mega-subpages a:focus-visible {
  background: #edf3ff;
  color: var(--mega-blue);
}

.addonstack-mega-panel .mega-cta {
  padding: 20px;
  border-radius: 8px;
  background: #131722;
  color: #fff;
}

.addonstack-mega-panel .mega-cta p {
  margin: 0 0 12px;
  color: inherit;
  font: 600 15px/1.5 Arial, Helvetica, sans-serif;
}

.addonstack-header .addonstack-mega-panel .mega-cta a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--mega-blue);
  color: #fff;
  font-weight: 600;
}

.addonstack-header .addonstack-mega-panel .mega-cta a:hover {
  background: #0b47bc;
}

.addonstack-mega-panel .mega-featured {
  grid-area: featured;
  background: #edf3ff;
}

.addonstack-mega-panel .mega-featured-copy,
.addonstack-mega-panel .mega-featured-title {
  display: block;
}

.addonstack-mega-panel .mega-featured-title {
  margin: 0 0 14px;
  color: var(--mega-text);
  font: 700 19px/1.3 Arial, Helvetica, sans-serif;
}

.addonstack-mega-panel .mega-featured img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.addonstack-mega-panel .mega-featured-description {
  display: block;
  margin-top: 12px;
  color: var(--mega-text);
  font-weight: 600;
}

.addonstack-mega-panel .mega-featured-link {
  display: inline-block;
  margin-top: 5px;
  color: var(--mega-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.addonstack-mega-panel:is(.mega-feature-top, .mega-feature-bottom) .mega-featured {
  padding: 0;
}

.addonstack-mega-panel:is(.mega-feature-top, .mega-feature-bottom) .mega-featured > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
}

.addonstack-mega-panel:is(.mega-feature-top, .mega-feature-bottom) .mega-featured img {
  width: auto;
  max-width: 100%;
  height: clamp(132px, 24vh, 184px);
}

.addonstack-mega-panel.mega-feature-bottom .mega-featured > a {
  grid-template-columns: minmax(0, 1fr) auto;
}

.addonstack-mega-panel.mega-feature-bottom .mega-featured img {
  order: 1;
}

.addonstack-mega-panel:is(.mega-feature-top, .mega-feature-bottom) .mega-featured-title {
  margin-bottom: 6px;
}

.addonstack-mega-panel:is(.mega-feature-top, .mega-feature-bottom) .mega-featured-description {
  margin-top: 0;
}

.addonstack-mobile-menu [data-mega-mobile] {
  padding-left: 0;
}

.addonstack-mobile-menu [data-mega-mobile] a,
.addonstack-mobile-menu [data-mega-mobile] summary {
  font: 600 14px/1.5 Arial, Helvetica, sans-serif;
}

.addonstack-mobile-menu [data-mega-mobile] details {
  margin: 4px 0;
}

.addonstack-mobile-menu [data-mega-mobile] summary {
  padding: 10px;
  border-radius: 8px;
  color: #151821;
  cursor: pointer;
}

.active-body .addonstack-mobile-menu [data-mega-mobile] details:not([open]) summary {
  color: #fff;
}

.addonstack-mobile-menu [data-mega-mobile] summary:focus-visible {
  outline: 2px solid #1459db;
  outline-offset: 2px;
}

.addonstack-mobile-menu [data-mega-mobile] details[open] summary {
  background: #edf3ff;
  color: #1459db;
}

.addonstack-mobile-menu [data-mega-mobile] details[open] ul {
  visibility: visible;
  height: auto;
  opacity: 1;
  padding: 4px 0 4px 16px;
}

/* Keep the bottom feature visible on shorter desktop screens. */
@media (min-width: 1202px) and (max-height: 750px) {
  .addonstack-mega-panel .mega-categories,
  .addonstack-mega-panel .mega-subpages { padding: 16px; }
  .addonstack-mega-panel .mega-category,
  .addonstack-header .addonstack-mega-panel .mega-subpages a { min-height: 36px; padding-block: 7px; }
  .addonstack-mega-panel:is(.mega-feature-top,.mega-feature-bottom) .mega-featured > a { padding: 12px 20px; }
  .addonstack-mega-panel:is(.mega-feature-top,.mega-feature-bottom) .mega-featured img { height: 96px; }
}
