.side-nav {
  flex-direction: column;
  flex-wrap: nowrap;
  padding: 20px 0;
  background-color: $blue-grey-700;
  font-size: $size-x-small;
  position: relative;
  transition: width 0.3s;
  z-index: 101;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  @include mq($from: tablet) {
    display: flex;
    position: relative;
    padding-right: 20px;
  }

  &--open {
    width: 220px;
    @include mq($from: wide) {
      width: 300px;
    }

    & .side-nav__button {
      & i {
        transform: rotate(0deg);
      }
    }
  }

  &--close {
    width: 0;
    @include mq($from: tablet) {
      width: 20px;
    }

    .side-nav__button {
      & i {
        transition: transform 0.3s;
        transform: rotate(180deg);
      }
    }

    .side-nav__wrapper {
      .side-nav__block {
        flex: 0 1 0;
        display: none;
      }

      .side-nav__list {
        flex: 0 1 0;
        display: none;
      }
    }
  }

  &--mobile {
    display: inline-block;
    padding-bottom: 50px;
    @include mq($from: tablet) {
      display: none;
    }
  }

  &__wrapper {
    position: sticky;
    top: 0;
  }

  &__block {
    display: inline-block;
    width: 100%;
    margin: 20px 0;
    text-align: left;
    @include mq($from: tablet) {
      display: flex;
      flex-direction: column;
    }
  }

  &__block-heading {
    font-size: $size-xx-small;
    font-weight: 700;
    text-transform: uppercase;
    color: $grey;
    letter-spacing: $x-small-space;
    padding: 0 25px 2px;
    margin-bottom: 10px;
  }

  &__list {
    @extend %list;
  }

  &__list-link {
    display: inline-block;
    width: 100%;
    padding: 10px 20px;
    color: $white;
    border-left: 5px solid $blue-grey-700;

    &:hover {
      color: $primary-color;
      text-decoration: none;
      background-color: darken($blue-grey-700, 4%);
      border-color: darken($blue-grey-700, 4%);
    }

    &.current {
      color: $primary-color;
      font-weight: 700;
      border-color: $primary-color;
    }
  }

  &__button {
    position: absolute;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    width: 20px;
    height: 100%;
    top: 0;
    right: 0;
    background-color: rgba($black, 0.2);
    color: $white;
    cursor: pointer;

    & i {
      position: sticky;
      top: 100px;
      right: 0;
    }
    @include mq($from: tablet) {
      display: flex;
    }
  }
}

.responsive-nav {
  display: none;
  height: 100%;
  width: 100%;
  z-index: 999;
  position: absolute;
  top: 60px;
  overflow-y: auto;
  background-color: $blue-grey-700;
  padding-bottom: 30px;

  &.open {
    display: block;
  }
}

#menu-button {
  width: 24px;
  height: 20px;
  position: relative;
  top: 12px;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
  cursor: pointer;

  & span {
    display: block;
    position: absolute;
    height: 4px;
    width: 100%;
    background: $white;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;

    &:nth-child(1) {
      top: 0;
      transform-origin: left center;
    }

    &:nth-child(2) {
      top: 8px;
      transform-origin: left center;
    }

    &:nth-child(3) {
      top: 16px;
      transform-origin: left center;
    }
  }

  &.open {
    & span {
      &:nth-child(1) {
        transform: rotate(45deg);
        top: 0;
        left: 3px;
      }

      &:nth-child(2) {
        width: 0;
        opacity: 0;
      }

      &:nth-child(3) {
        transform: rotate(-45deg);
        top: 17px;
        left: 3px;
      }
    }
  }
}

.multilevelmenu {
  position: relative;
  width: 250px;
  height: 300px;
  background: white;
  padding: 0 20px;

  ul {
    list-style: none;
    padding: 0;
    li {
      text-align: left;
    }
  }

  &__backlink {
    line-height: 50px;
    cursor: pointer;
    text-align: left;
  }

  &__sidemenu {
    position: absolute;
    background: white;
    top: 50px;
    width: 200px;
    height: calc(100% - 50px);
    &--show {
      margin-left: 0 !important;
      transition: all 0.5s ease;
    }

    &--hide {
      margin-left: -200px;
      transition: all 0.5s ease;
    }
  }
}
