@import "../../pfe-sass/pfe-sass";
@import "../../pfe-layouts/src/pfe-layouts";

$nav-link-color: $pfe-color--black !default;
$nav-button-color: $pfe-color--white;


:host {
  display: block;
  position: relative;

  @media screen and (min-width: $emp-lg) {
    position: static;
  }

  .nav__link {
    color: $nav-link-color;
  }
}

:host([theme="empirix"]) {
  $nav-background-color--mobile: $empirix--black-pure;
  $nav-background-color--desktop: $empirix--purple-brown;

  height: 0;

  .nav {
    background: $nav-background-color--mobile;
    clear: both;
    overflow: hidden;
    padding-bottom: 3em;
    position: relative;
    transition: height 0.25s;
    transition-delay: overflow 0.25s;

    @media screen and (min-width: $emp-lg) {
      background: rgba($nav-background-color--desktop, 0.7);
      display: block;
      overflow: visible;
      padding: 0;
    }

    &--open {
      overflow: visible;
      transition: height 0.25s;
    }
  }

  .nav__list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
  }

  .nav__button {
    background-color: transparent;
    border: 0;
    cursor: pointer;
    height: 31px;
    position: absolute;
    right: 15px;
    top: -45px;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
    width: 31px;


    span {
      display: block;
      position: absolute;
      height: 4px;
      width: 100%;
      background: $nav-button-color;
      border-radius: 9px;
      opacity: 1;
      left: 0;
      transform: rotate(0deg);
      transition: .25s ease-in-out;

      &:nth-child(1) {
        top: 0px;
      }

      &:nth-child(2),
      &:nth-child(3) {
        top: 12px;
      }

      &:nth-child(4) {
        top: 24px;
      }

    }

    &.open span:nth-child(1) {
      top: 18px;
      width: 0%;
      left: 50%;
    }

    &.open span:nth-child(2) {
      transform: rotate(45deg);
    }

    &.open span:nth-child(3) {
      transform: rotate(-45deg);
    }

    &.open span:nth-child(4) {
      top: 18px;
      width: 0%;
      left: 50%;
    }

    @media screen and (min-width: $emp-lg) {
      display: none;
    }
  }

  .nav__item {
    display: inline-block;
    margin: 0 10px;

    &:first-child {
      margin-left: 0;
    }
  }

  ::slotted([slot="navSearch"]) {
    @media screen and (min-width: $emp-lg) {
      display: none;
    }
  }

  ::slotted(li) {
    margin: 2px 0;

    @media screen and (min-width: $emp-lg) {
      margin: 0 10px;
      display: inline-block;
    }
  }

  ::slotted(li:first-of-type) {
    @media screen and (min-width: $emp-lg) {
      margin-left: -20px;
    }
  }
}