.sidebar-nav {
  height: 100vh;
  width: $sidebar-width;
  background-color: $color-bright-gray;
  float: left;
  //padding: rem-calc(10) rem-calc(20);
  position: relative;

  .sidebar-header {
    padding-top: 30px;
    img {
      width: 40px;
    }
    h4 {
      color: $color-white;
      font-size: rem-calc(18);
      font-weight: 600;
      margin: rem-calc(10) 0 0;
      padding: 0 rem-calc(10);
      line-height: rem-calc(26);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .shop-link {
      font-size: $font-size-xxx-small;
      color: $color-gray-chateau;
      margin-bottom: rem-calc(16);
      display: inline-block;
      max-width: 100%;
      text-overflow: ellipsis;
      overflow: hidden;
      @include transition(transform 0.2s ease);
      &:hover {
        color: $color-white;
        i {
          color: $color-white;
        }
      }
      i {
        font-size: rem-calc(12);
        margin-right: 5px;
        color: $color-pale-sky;
        vertical-align: middle;
      }
    }
  }

  @include breakpoint(md down) {
    &:not(.no-resize) {
      position: fixed;
      transform: translate3d(-$sidebar-width, 0, 0);
      height: 100%;
      @include transition(transform 0.2s ease);
    }
  }

  .monit-user {
    display: block;
    text-align: center;
    padding: rem-calc(10);
    background-color: $color-golden-grass;
    color: $color-white;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  &.show-monit-user {
    #sidebarNav {
      section.animation-container {
        height: calc(100vh - 220px);
      }
    }
  }

  #sidebarHeader {
    //position: relative;
    padding: $sidebar-head-space 0;
    margin: 0px $sidebar-space;
    border-top: 1px solid $color-mako;
    background-color: $color-bright-gray;

    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    #headerSettings {
      display: flex;
      align-items: center;
      position: relative;

      .account-settings {
        position: relative;
        width: 100%;

        a {
          @extend .flex-container;

          margin: 0;
          font-size: $font-size-x-small;
          color: $color-gray-chateau;
          font-weight: 600;
          text-decoration: none;

          i {
            padding-right: rem-calc(10);
          }
        }
      }
    }

    .dropup {
      position: relative;

      button {
        cursor: pointer;
        border: 0;
        background: none;
        color: $color-white;
        transition: 0.2s;
        padding: rem-calc(5);
        font-size: rem-calc(8);
      }

      @include create-nav();
      .dropdown-menu {
        padding: 10px 5px;
        min-width: 180px;
      }
      ul {
        opacity: 0;
        visibility: hidden;
        padding: rem-calc(10) 0;
        margin-top: rem-calc(0);
        border: 1px solid rgba($color-bright-gray, 0.02);
        left: rem-calc(-8);
        transition: all 0.2s linear;
        bottom: 150%;

        li {
          border-radius: 3px;
          position: relative;
          a {
            color: $color-outer-space;
            font-weight: 400;
            border-radius: 3px;
            display: block;
            padding: 6px 10px;
            line-height: 20px;
            i {
              color: $color-pale-sky;
              vertical-align: middle;
              height: 19px;
              margin-right: rem-calc(10);
            }
          }

          &:hover {
            background-color: $color-catskill-white;
          }
          &:last-child {
            margin-bottom: 0;
          }
        }
      }

      &.show {
        ul {
          opacity: 1;
          visibility: visible;
        }
      }
    }
  }

  #sidebarNav {
    margin: 0 $sidebar-space 0px $sidebar-space;

    h3 {
      margin: $sidebar-nav-space-top 0 rem-calc(6);
      padding-left: $sidebar-nav-space-around;
      padding-right: $sidebar-nav-space-around;
      font-size: $sidebar-head-font-size-h3;
      font-weight: 600;
      color: $color-pale-sky;
      text-transform: uppercase;
    }

    .main-menu {
      margin-top: rem-calc(20);

      h3 {
        margin-top: rem-calc(23);
      }
      .apps {
        li {
          &.menu-app-item {
            a {
              min-height: rem-calc(30);
              .logo {
                margin-right: 14px;
                max-height: 20px;
                max-width: 20px;
                border-radius: 2px;
              }
              .name {
                line-height: rem-calc(16);
                padding: rem-calc(4) 0;
              }
            }
          }
        }
      }
    }

    .menu-wrap {
      overflow: hidden;
    }

    section.animation-container {
      height: calc(100vh - 170px);
      overflow-y: auto;
      overflow-x: hidden;
      width: rem-calc(220);

      & > section {
        overflow: auto;
        max-width: rem-calc(190);
      }
    }

    section {
      & > a.toggle-settings,
      & > a.toggle-account,
      & > a.toggle-sites {
        display: flex;
        align-items: center;
        padding-top: rem-calc(10);
        padding-left: $sidebar-nav-space-around;
        padding-right: $sidebar-nav-space-around;
        font-size: rem-calc(14);
        font-weight: 600;
        color: $color-pale-sky;
        text-transform: uppercase;
        line-height: rem-calc(36);
        cursor: pointer;
        i {
          margin-right: rem-calc(14);
        }
      }
    }
    @include create-nav();

    ul {
      li {
        position: relative;
        &.back-to-menu {
          line-height: rem-calc(22);
          a {
            padding-top: rem-calc(4);
            padding-bottom: rem-calc(4);
          }
        }

        a {
          color: $color-gray-chateau;
          position: relative;
          text-decoration: none;
        }

        &.selected,
        &:hover {
          > a {
            background-color: $color-outer-space;
            color: $color-white;
          }
        }
      }
    }
  }

  .counter {
    border-radius: rem-calc(4);
    position: absolute;
    right: rem-calc(12);
    display: inline-block;
    padding: 0 5px;
    min-width: rem-calc(16);
    font-size: $font-size-xxx-small;
    color: $color-white;
    text-align: center;
    white-space: normal;
    line-height: rem-calc(17);
    font-weight: 600;
    top: 7px;
    opacity: 0;

    &:not(.label-background) {
      background-color: #333745;
    }
    &.hide {
      opacity: 0;
    }

    &.dashboard {
      border-radius: 50%;
      width: rem-calc(8);
      height: rem-calc(8);
      padding: 0;
      min-width: auto;
      background: $color-mandy;
      left: rem-calc(23);
      top: rem-calc(5);
    }

    &.news-bubble {
      left: rem-calc(10);
      top: 0;
    }

    &.bell-bubble {
      left: rem-calc(18);
      top: rem-calc(7);
    }
  }

  #shoploLogo {
    margin: 0px $sidebar-space;
    border-bottom: 1px solid $color-mako;

    .shoplo-logo {
      display: block;
      width: 100%;
      text-align: left;
      padding-top: rem-calc(20);
      padding-bottom: rem-calc(17);
      //position: absolute;
      //bottom: 0;
      //left: 0;
      //right: 0;
    }
  }
}

.sidebar {
  .animation-container {
    .main-menu,
    .settings-menu,
    .sites-menu,
    .editor-menu,
    .account-menu {
      transition: height 0.2s ease-out, opacity 0.25s linear;
    }
    .settings-menu,
    .sites-menu,
    .editor-menu,
    .account-menu {
      max-height: 0;
      opacity: 0;
      visibility: hidden;
    }
  }

  &.settings {
    .settings-menu {
      max-height: rem-calc(1000);
      visibility: visible;
      opacity: 1;
      transition: height 0.2s ease-out, opacity 0.25s linear;
    }
    .main-menu,
    .sites-menu,
    .editor-menu,
    .account-menu {
      max-height: 0;
      opacity: 0;
      visibility: hidden;
    }
  }

  &.sites {
    .sites-menu {
      max-height: rem-calc(1000);
      visibility: visible;
      opacity: 1;
      transition: height 0.2s ease-out, opacity 0.25s linear;
    }
    .main-menu,
    .settings-menu,
    .editor-menu,
    .account-menu {
      max-height: 0;
      opacity: 0;
      visibility: hidden;
    }
  }

  &.account {
    .account-menu {
      max-height: rem-calc(1000);
      visibility: visible;
      opacity: 1;
      transition: height 0.2s ease-out, opacity 0.25s linear;
    }
    .main-menu,
    .settings-menu,
    .editor-menu,
    .sites-menu {
      max-height: 0;
      opacity: 0;
      visibility: hidden;
    }
  }

  &.editor {
    .editor-menu {
      margin-top: rem-calc(10);
      max-height: rem-calc(1000);
      visibility: visible;
      opacity: 1;
      transition: height 0.2s ease-out, opacity 0.25s linear;

      li {
        &.search {
          margin-top: rem-calc(20);
          margin-bottom: rem-calc(13) !important;
        }
      }

      .upload-file-button {
        justify-content: flex-start;
        background-color: transparent;
        border: 0;
      }

      ul.files {
        display: none;
        padding-bottom: 0 !important;
        li.add {
          a {
            position: relative;
          }
          input {
            opacity: 0;
            filter: alpha(opacity=0);
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            cursor: pointer;
            height: rem-calc(32);
            line-height: rem-calc(32);
          }
        }
      }
    }
    .main-menu,
    .settings-menu,
    .sites-menu {
      max-height: 0;
      opacity: 0;
      visibility: hidden;
    }
  }
  #mainSidebar {
    @include breakpoint(lg down) {
      display: none;
    }
  }
}
