:root {
  --header-primary-height: 4rem;
  /* 64px; mobile */
  --header-height: calc(var(--header-primary-height) + var(--header-secondary-height, 0px));
  --header-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.06);

  --header-dropdown-bg: rgb(240, 240, 240);
  --header-dropdown-offset: 0.8rem;
  /* Distance from the bottom edge of the nav bar */
  --header-dropdown-inner-padding: 2rem;
  --header-dropdown-arrow-height: 1rem;
  --header-dropdown-arrow-width: 2rem;

  --header-mobile-bg: var(--c-black);
  --header-mobile-txt: var(--c-white);
  --header-menu-gap: 1rem;
  /* 16px */
}

/* Outspecify the header-container-wrapper from header.css */
body .header-container-wrapper {
  padding: 0;
  height: var(--header-height);
}

.nd-nav {
  position: fixed;
  top: 0;
  z-index: 999;
  width: 100%;
  height: var(--header-primary-height);
  box-shadow: var(--header-shadow);
  background-color: var(--c-white);
}

.nd-nav__inner {
  display: flex;
  margin: 0 auto;
  padding: 0 var(--container-h-pad);
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  max-width: var(--container-max-width, 100%);
}

.nd-nav__logo img {
  display: block;
  max-width: 9rem;
}

.nd-nav__logo a {
  display: block;
  line-height: 1;
}

.nd-nav__cta-lockup {
  display: none;
}

.nd-nav__login a {
  color: currentColor;
}

/* Primary dropdown menu styles */
.nd-menu-group {
  list-style-type: none;
  padding: 0;
}

.nd-menu-group--toplevel {
  display: grid;
  grid-auto-flow: row;
  width: 100%;
}

.nd-menu-item.nd-menu-depth-2 {
  line-height: 1.2;
  padding: 0 8px;

  a {
    font-size: 14px;
  }
}

.nd-menu-group--popout:first-of-type .nd-menu-item.nd-menu-depth-2 {
  .nd-anchor-content {
    display: block;
    margin-top: 12px;

    .nd-menu-action-item {
      margin-top: -12px;
    }
  }
}

.nd-menu-depth-3 .nd-menu-group {
  padding-left: 1rem;
}

.nd-menu-depth-4 {
  margin-left: 1rem;
}

/** Menu items */
.nd-menu-item {
  font-weight: 500;
  line-height: 1.875;
}

.nd-menu-item__anchor {
  position: relative;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
  color: inherit;
}

.nd-menu-depth-3 .nd-menu-item__anchor {
  font-size: 1.125rem;
}

:not(a).nd-menu-item__anchor {
  cursor: default;
}

.nd-nav__menu {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nd-anchor-caret {
  display: none;
  margin-left: 0.5rem;
  transform-origin: center;
  transition: transform 0.3s ease;
}

.nd-anchor-caret path {
  stroke: currentColor;
  stroke-width: 1;
  fill: none;
}

/* HAMBURGER MENU */
.nd-nav__toggle {
  display: grid;
}

.nd-nav__hamburger {
  padding: 0;
  position: relative;
  cursor: pointer;
  width: 1.5rem;
  /* 24px; */
  border: none;
  background-color: transparent;
}

.nd-nav__hamburger::after {
  --hit-expand: 2rem;
  --half-hit-expand: calc(var(--hit-expand) / 2);
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(var(--half-hit-expand) * -1);
  left: calc(var(--half-hit-expand) * -1);
  width: calc(100% + var(--hit-expand));
  height: calc(100% + var(--hit-expand));
}

.nd-nav__hamburger-line {
  height: 2px;
  background-color: var(--c-bg-dark, #333333);
  display: block;
  margin-bottom: 6px;
  transition: transform 0.3s ease;
  transform: none;
}

.nd-nav__hamburger-line:last-child {
  margin-bottom: 0;
}

body.open-dropdown {
  overflow-y: hidden;
}

/* Add a darkened background behind the mobile nav */
.open-dropdown .header-container-wrapper::before {
  content: "";
  position: fixed;
  top: 0;
  z-index: 99;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  animation: 0.5s menu-fade;
}

.open-dropdown .nd-nav__hamburger span:nth-child(2) {
  transform: scale(0);
}

.open-dropdown .nd-nav__hamburger span:first-child {
  transform: rotate(45deg) translate(6px, 6px);
}

.open-dropdown .nd-nav__hamburger span:last-child {
  transform: rotate(135deg) translate(-5px, 5px);
}

.open-dropdown .nd-menu-item {
  line-height: 1.5;
}

/* /HAMBURGER MENU */

.open-dropdown .nd-nav__menu {
  display: block;
  position: absolute;
  opacity: 1;
  color: var(--header-mobile-txt);
  background-color: var(--header-mobile-bg);
  padding: 0 var(--container-h-pad);
  width: 100%;
  max-width: var(--container-max-width);
  left: calc(calc(100% - var(--container-max-width)) / 2);
  top: var(--header-primary-height);
  /* height: calc(var(--svh) - var(--header-primary-height)); */
  max-height: calc(var(--svh) - var(--header-primary-height));
  overflow-y: auto;
}

/* Menu item formatting on mobile */
.open-dropdown .nd-menu-depth-1>.nd-menu-group {
  display: none;
}

.open-dropdown .nd-menu-item--open>.nd-menu-group {
  display: block;
}

.open-dropdown .nd-menu-depth-1:not(:first-of-type) {
  margin-top: 1rem;
}

.open-dropdown .nd-menu-depth-1>.nd-menu-item__anchor {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Add underline when menu expanded on mobile */
.open-dropdown .nd-menu-depth-1>.nd-menu-item__anchor::after {
  content: "";
  display: block;
  background-color: rgba(255, 255, 255, 0.3);
  margin-top: 0.4em;
  width: 100%;
  height: 1px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: 0%;
  transition: transform 0.4s ease;
}

.open-dropdown .nd-menu-depth-1.nd-menu-item--open>.nd-menu-item__anchor::after {
  opacity: 1;
  transform: scaleX(1);
}

.open-dropdown .nd-anchor-caret {
  display: inline-block;
}

.open-dropdown .nd-menu-item--open .nd-anchor-caret {
  transform: rotate(90deg);
}

.open-dropdown .nd-menu-depth-3 {
  margin-top: 0.5rem;
}

/* Desktop styles */
@media (min-width: 992px) {
  .nd-nav__toggle {
    display: none;
  }

  .nd-nav__menu {
    opacity: 1;
    display: block;
  }

  .nd-nav__cta-lockup {
    display: grid;
    grid-auto-flow: column;
    column-gap: 1rem;
    align-items: center;
  }

  .nd-nav__cta .btn {
    min-width: unset;
    font-size: 0.875rem;
    padding: 0.5625rem 1.5rem;
  }

  .nd-menu-group--toplevel {
    grid-auto-flow: column;
    column-gap: var(--header-menu-gap);
  }

  .nd-menu-depth-3 .nd-menu-group {
    padding-left: 0;
    /* border-left: 2px solid var(--c-gray); */
  }

  .nd-menu-item__anchor:focus {
    outline: none;
  }

  .nd-menu-item__anchor:focus .nd-anchor-content {
    outline: auto;
    outline-offset: 2px;
  }

  .nd-menu-item--no-link>.nd-menu-item__anchor b {
    font-weight: 500;
    opacity: 0.5;
  }

  /* The underline effect for top level anchor items */
  .nd-menu-depth-1>.nd-menu-item__anchor::after,
  .nd-nav__login a::after {
    content: "";
    position: absolute;
    z-index: 999;
    bottom: -0.1875rem;
    left: 0;
    width: 100%;
    height: 0.125rem;
    /* 2px */
    background-color: #8ed500;
    transform-origin: 0 0;
    transition: transform 0.4s ease;
    transform: scaleX(0);
  }

  /** The arrow menu indicator */
  .nd-menu-item--open>.nd-menu-item__anchor::before {
    content: "";
    position: absolute;
    display: block;
    margin-top: 0.125rem;
    top: calc(calc(var(--header-primary-height) / 2) - calc(var(--header-dropdown-arrow-height) / 2) - var(--header-dropdown-offset));
    left: calc(50% - calc(var(--header-dropdown-arrow-width) / 2));
    width: var(--header-dropdown-arrow-width);
    height: var(--header-dropdown-arrow-height);
    background-color: var(--header-dropdown-bg);
    -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  }

  /** The ul which should be hidden as a popout */
  .nd-menu-group--popout {
    display: none;
    position: absolute;
    left: 50%;
    top: calc(var(--header-primary-height) - var(--header-dropdown-offset));
    transform: translateX(-50%);
    grid-auto-columns: 1fr;
    max-width: var(--container-max-width);
    grid-auto-flow: column;
    column-gap: 1rem;
    row-gap: 1rem;
    padding: var(--header-dropdown-inner-padding);
    background-color: var(--header-dropdown-bg);
    box-shadow: var(--header-shadow);
  }

  /* The menu hover and focus effects */
  .nd-menu-item--open .nd-menu-group--popout {
    display: flex;

  }

  /* Add spacing between groups on desktop */
  .nd-menu-depth-3:not(:first-of-type) {
    margin-top: 0.5rem;
  }
}

/* Animate the underline out */
.nd-menu-item--open>.nd-menu-item__anchor::after {
  transform: scaleX(1);
}

.nd-menu-action-item {
  display: inline-block;
  text-align: center;
  margin-top: 0.2rem;
  font-weight: 700;
  background-color: #8ED500;
  color: #006142;
  border-radius: 12px;
  min-width: unset;
  /* font-size: 0.875rem; */
  padding: 0.75rem 1rem;
  line-height: 1;
  letter-spacing: 0;
}

/* Add a chevron */
/* .nd-menu-action-item::after {
  content: " \00BB";
  font-size: 1.1em;
} */
/* /Menu items */

/* Additional breakpoints */
@media (min-width: 576px) {
  :root {
    --header-primary-height: 5rem;
    /* 80px; */
  }

  .nd-nav__logo img {
    max-width: 11rem;
    /* flex-basis: 195px; */
  }
}

@media (min-width: 768px) {
  :root {
    --header-primary-height: 6rem;
    /* 96px; */
  }

  .nd-nav__logo img {
    max-width: 12.1875rem;
    /* flex-basis: 195px; */
  }
}

@media (min-width: 992px) {
  :root {
    --container-h-pad: 15px;
    --container-max-width: 960px;
  }
}

@media (min-width: 1200px) {
  :root {
    --container-max-width: 1170px;
  }
}

@keyframes menu-fade {
  from {
    opacity: 0%;
  }

  to {
    opacity: 100%;
  }
}

:root {
  --container-h-pad: 20px;
  --container-max-width: 100%;
}

@media (min-width: 576px) {
  :root {
    --container-max-width: 540px;
  }
}

@media (min-width: 768px) {
  :root {
    --container-max-width: 720px;
  }
}

@media (min-width: 992px) {
  :root {
    --container-h-pad: 15px;
    --container-max-width: 960px;
  }
}

@media (min-width: 1200px) {
  :root {
    --container-max-width: 1170px;
  }
}

/* Support for mobile svh units to size mobile nav scrolling */
:root {
  --svh: 100vh;
}

@supports (height: 100vh) {
  :root {
    --svh: 100svh;
  }
}

/* Begin shrinking header at 390px wide - 80px high at 300px wide */