@import 'variables';

.nav-primary {
  @extend %clearfix;
  position: relative;
  width: 320px;

  @include media-query-small {
    width: auto;
    position: static;
  }
}

.prevent-scrolling {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.nav-primary--wrapper {
  min-height: 0;

  @include media-query-small {
    @include rem('min-height', 37px);
  }
}

.nav-primary__section {
  @include rem('padding-bottom', 44px);
  background: $color__brand--white;
  border-right: solid 1px $color__brand--light-grey;
  border-bottom: solid 1px $color__brand--light-grey;
  height: 100vh;
  overflow-y: scroll;
  padding-top: 10px;
  padding-bottom: 0;
  position: absolute;
  top: 0;
  transform: translate3d(-100%, 0, 0);
  width: 100%;
  z-index: $z-lightbox;

  @include media-query-small {
    background: none;
    display: block;
    height: auto;
    padding: 0;
    position: inherit;
    transition: none;
    border-right: none 0 transparent;
    border-bottom: solid 5px $color__brand--black;
    transform: none;
    transition: none;
  }

  .no-csstransforms3d & {
    transform: translate(-100%, 0);

    @include media-query-small {
      transform: none;
    }
  }

  &.is-active {
    transform: translate3d(0, 0, 0);

    @include media-query-small {
      transform: none;

      .no-csstransforms3d & {
        transform: none;
      }
    }

    .no-csstransforms3d & {
      transform: translate(0, 0);
    }
  }

  &.is-active-add,
  &.is-active-remove {
    transition: transform .3s ease-in;

    @include media-query-small {
      transition: none;
    }
  }

  &.is-active-add-active {
    transform: translate3d(0, 0, 0);

    @include media-query-small {
      transform: none;

      .no-csstransforms3d & {
        transform: none;
      }
    }

    .no-csstransforms3d & {
      transform: (0, 0);
    }
  }

  &.is-active-remove-active {
    transform: translate3d(-100%, 0, 0);

    @include media-query-small {
      transform: none;

      .no-csstransforms3d & {
        transform: none;
      }
    }

    .no-csstransforms3d & {
      transform: (-100%, 0);
    }
  }

  &.is-level2-active {
    transition: transform .3s ease-in;
    transform: translate3d(-100%, 0, 0);

    @include media-query-small {
      transition: none;
      transform: none;

      .no-csstransforms3d & {
        transform: none;
      }
    }

    .no-csstransforms3d & {
      transform: (-100%, 0);
    }
  }

}

.nav-primary__list {
  list-style: none;

  @include media-query-small {
    @include wrapper($screen-lg);
    @include justify-content(space-around);
    display: flex;
    padding: 0;
    position: relative;
    z-index: $z-navigation;

    .no-flexbox & {
      display: table;
      width: 100%;
    }

    > li {
      @include flex-grow(1);
      text-align: center;

      .no-flexbox & {
        display: table-cell;
      }

    }
  }

  > li {
    display: block;

    &.nav-primary__list-item--style {
      display: none;

      @include media-query-small {
        display: block;
      }
    }
  }

}

.nav-primary__list--mobile {
  background: $color__brand--background-grey;
  border-top: 1px solid $color__brand--light-grey;
  border-bottom: 1px solid $color__brand--light-grey;
  padding-top: 2rem;
  padding-bottom: 2rem;
  margin-bottom: 100px;

  @include media-query-small {
    display: none;

    .no-flexbox & {
      display: none;
    }
  }
}

.nav-primary__menu-icon {
  position: absolute;
  margin-left: -2rem;
}

.nav-primary__bag-count::before { content: '\0028'; }

.nav-primary__bag-count::after { content: '\0029'; }

.nav-primary__menu-link {
  @include rem('font-size', 14px);
  color: $color__brand--dark-grey;
  display: inline-block;
  font-size: 15px;
  line-height: 32px;
  text-decoration: none;

  @include media-query-small {
    @include rem('font-size', 12px);
    @include rem('padding', 0 5px);
    font-family: $font__mns-london--bold;
    width: 100%;

    @include media-query-medium {
      @include rem('padding', 0 10px);
      text-transform: uppercase;
    }

    @include media-query-large {
      @include rem('font-size', 14px)
    }

    &.prominent {
      color: $color__brand--red;
    }

    &.is-active {
      background-color: $color__brand--white;
      color: $color__brand--green;
    }
  }

  &::before {
    padding-right: 1rem;
  }
}

.nav-primary__menu-link--no-menu {

  &:hover {
    background-color: $color__brand--white;
    color: $color__brand--green;
  }
}

.nav-primary__list--style {
  @include media-query-small {
    display: none;

    .no-flexbox & {
      display: none;
    }
  }
}

.nav-primary__header {
  @include rem('padding', 10px 15px 5px);
  @include rem('font-size', 15px);
  margin: 0;
  text-transform: uppercase;

  @include media-query-small {
    display: none;
  }
}

.nav-primary__submenu-container {
  background: $color__brand--white;
  border-right: 1px solid $color__brand--light-grey;
  border-bottom: 1px solid $color__brand--light-grey;
  position: absolute;
  width: 100%;
  top: -1px;
  min-height: 100vh;
  z-index: $z-lightbox;
  height: 100vh;
  display: none;
  overflow-y: scroll;

  @include media-query-small {
    @include wrapper($screen-lg);
    min-height: 0;
    top: 0;
    left: 0;
    position: relative;
    border: none;
    background: none;
    min-width: 0;
    overflow-y: visible;
    height: auto;
  }

  &.is-active-add,
  &.is-active-remove {
    transition: transform .3s ease-in;
    display: block;

    @include media-query-small {
      transition: none;
    }
  }

  &.is-active-add {
    transform: translate3d(-100%, 0, 0);

    @include media-query-small {
      transform: none;
    }
  }

  &.is-active-remove {
    transform: translate3d(0, 0, 0);

    @include media-query-small {
      transform: none;
    }
  }

  &.is-active-add-active {
    transform: translate3d(0, 0, 0);

    @include media-query-small {
      transform: none;
    }
  }

  &.is-active-remove-active {
    transform: translate3d(-100%, 0, 0);

    @include media-query-small {
      transform: none;
    }
  }

  &.is-active {
    transform: translate3d(0, 0, 0);
    display: block;

    @include media-query-small {
      transform: none;
    }

    .nav-primary__submenu {
      @include rem('padding-bottom', 89px);
      box-sizing: border-box;
      overflow-y: scroll;
      height: 100vh;

      @include media-query-small {
        @include rem('padding', 10px 25px 5px 0);
        background-color: $color__brand--white;
        box-sizing: border-box;
        left: 0;
        top: 0;
        z-index: $z-navigation;
        box-shadow: 0 19px 27px $nav-shadow;
        height: auto;
        position: absolute;
      }
    }
  }
}

.nav-primary__submenu {
  @extend %clearfix;
  display: none;
}

.nav-primary__overlay {
  background-color: $color__brand--black;
  display: none;
  height: 100%;
  left: 0;
  position: absolute;
  opacity: 0;
  top: 0;
  width: 100%;
  z-index: $z-navigation-overlay;

  &.is-active-add {
    display: block;
    transition: opacity .3s ease-in;
    opacity: 0;

    .touch & {
      transition: none;
    }
  }

  &.is-active-add-active {
    opacity: .1;
  }

  &.is-active {
    display: block;
    opacity: .1;
  }
}




