 /*------------------------------------*\
     #PRIMARY NAVIGATION
 \*------------------------------------*/

 /**
  * Primary navigation existing in the header and maybe the footer
  */
.search-active {
  .c-primary-nav {
    @media all and (min-width: 60em) {
      transform: translate3d(72px, 31px, 0);
    }
  }
  &.stuck {
    .c-primary-nav {
      /*transform: translate3d(-180px, 0, 0) scale(.8);*/
    }
  }
}

.c-primary-nav {
  transition-duration: .3s;
  @media all and (min-width: 32em) {
    margin-left: auto;
  }

  + .c-preheader__item {
    @media all and (max-width: 751px) {
      display: none;
    }
  }
}

.c-primary-nav__list {
  @media all and (min-width: 47em) {
    align-items: center;
    display: flex;
  }
}

.c-primary-nav__item {
  position: relative;

  @media all and (min-width: 47em) {
    margin-right: 1rem;
  }

  @media all and (min-width: 70em) {
    margin-right: 2rem;
  }

  &:nth-last-child(2) ul.c-primary-nav__childlist {
    left: auto;
    right: -10px;

    &::after,
    &::before {
      left: auto;
      right: 10%;
    }
  }

  &.current > a {
    color: var( --color-primary-nav-current);
  }

  > a {
    color: var(--color-neutral-gray-53);

    &:hover,
    &:focus {
      color: var(--color-neutral-gray-53);
    }

    &:active {
      color: var(--color-neutral-gray-53);
    }
  }
}

.c-preheader-for-professionals + .hanger-header-wrapper .c-primary-nav__item.current a {
  color: var(--color-brand-blue-dark);
}

.hanger-primary-nav {
  margin-top: 8px;

  @media all and (min-width: 47em) {
    margin-top: 0;
  }

  .c-primary-nav__item {
    color: var(--color-neutral-gray-53);

    &:hover {
      > a {
        color: var(--color-neutral-white);
        transition: color .05s ease-in .05s;
      }

      @media all and (max-width: 751px) {
        a {
          color: var(--color-neutral-white);
        }
      }

      &::before {
        background-color: var(--bg-primary-nav-before);
        background-position: 100% 0;
        color: var(--color-neutral-white);
        transform: scale(1);
      }
    }

    &::before {
      background-color: transparent;
	  background-image: var(--bg-gradiant-nav-before-hover);
      background-size: 300% 100%;
      bottom: -8px;
      content: '';
      display: block;
      left: 10px;
      position: absolute;
      right: -5px;
      top: -8px;
      transform: scale(.95);
      transition: background .2s ease-in-out, transform .15s ease-in-out;
      width: auto;
      z-index: 1;

      @media all and (min-width: 47em) {
        border-radius: 4px;
      }

      @media all and (min-width: 60em) {
        bottom: 5px;
        top: 5px;
      }

      @media all and (min-width: 70em) {
        left: 0;
        right: -13px;
      }
    }

    a {
      position: relative;
      z-index: 2;
      display: block;

      @media all and (max-width: 751px) {
        outline: none;
      }
    }
  }
}

.c-primary-nav__link {
  color: var(--color-neutral-gray-53);
  cursor: pointer;
  display: block;
  font-size: var(--font-size-large);
  font-weight: 700;
  line-height: 1;
  padding: 14px var(--tap-target);
  text-decoration: none;
  transition: background var(--sticky-speed), font-size var(--sticky-speed);

  @media all and (min-width: 47em) {
    font-size: var(--font-size-sm-2);
    padding: 0;
    white-space: nowrap;
  }

  @media all and (min-width: 70em) {
    font-size: var(--font-size-med-1);
  }

  @media all and (min-width: 90em) {
    font-size: var(--font-size-med-3);
  }

  &[aria-expanded="true"] .c-primary-nav__icon {
    transform: rotate(180deg);
  }

  &:hover {
    color: var(--color-neutral-white);
    text-decoration: none;
    transition: background var(--sticky-speed), font-size var(--sticky-speed);
  }

  &.has-submenu {
    white-space: nowrap;
  }
}

.c-primary-nav__icon.c-icon {
  float: right;
  height: 24px;
  margin-top: 4px;
  pointer-events: none;
  transition: transform .15s;
  width: 24px;

  @media all and (min-width: 47em) {
    float: none;
    height: 10px;
    margin-left: 4px;
    margin-top: 0;
    width: 10px;
  }

  @media all and (min-width: 70em) {
    margin-bottom: 2px;
  }
}

ul.c-primary-nav__childlist {
  box-shadow: 0 5px 10px rgba(var(--color-neutral-black), .2);
  display: none;
  position: relative;

  @media all and (min-width: 47em) {
    background-color: var(--color-neutral-white);
    left: -16px;
    position: absolute;
    top: 46px;
    width: 200px;
    z-index: 1;
  }

  @media all and (min-width: 60em) {
    width: 310px;
  }

  @media all and (min-width: 70em) {
    width: 370px;
  }

  .c-primary-nav__childitem {
    border-bottom: 1px solid #eee;

    &:last-child {
      border-bottom: 0;
    }
  }
}

.has-submenu {
  &[aria-expanded="true"] + ul {
    display: block;
  }

  .c-primary-nav__link {
    white-space: nowrap;
  }
}

.c-primary-nav__childlink {
  color: var(--dark);
  display: block;
  font-size: 1rem;
  padding: 4px 54px;
  text-decoration: none;

  @media all and (min-width: 47em) {
    font-size: 1rem;
    line-height: 2;
    padding: 4px 1rem;
  }

  @media all and (min-width: 70em) {
    font-size: 1rem;
    line-height: 2;
    padding: 4px 1rem;
  }

  &:hover,
  &:focus {
    @media all and (min-width: 47em) {
      background-color: var(--color-neutral-gray-04);
      color: var(--color-neutral-black);
    }
  }
}
