#mainNav {
  .navbar-collapse {
    overflow: auto;

    max-height: 75vh;
    .navbar-nav {
      .nav-item {
        .nav-link {
          cursor: pointer;
        }
      }
    }
    .navbar-sidenav {
      .nav-link-collapse:after {
        float: right;

        content: '\f107';

        font-family: 'FontAwesome';
      }
      .nav-link-collapse.collapsed:after {
        content: '\f105';
      }
      .sidenav-second-level,
      .sidenav-third-level {
        padding-left: 0;
        > li > a {
          display: block;

          padding: 0.5em 0;
          &:focus,
          &:hover {
            text-decoration: none;
          }
        }
      }
      .sidenav-second-level > li > a {
        padding-left: 1em;
      }
      .sidenav-third-level > li > a {
        padding-left: 2em;
      }
    }
    .sidenav-toggler {
      display: none;
    }
    .navbar-nav > .nav-item.dropdown {
      > .nav-link {
        position: relative;

        min-width: 45px;
        &:after {
          float: right;

          width: auto;

          content: '\f105';

          border: none;

          font-family: 'FontAwesome';
        }
        .new-indicator {
          position: absolute;
          top: 0;
          right: 25px;

          font-size: 1.1rem;
          .number {
            position: absolute;
            top: 6px;
            left: 0;

            width: 22.625px;

            text-align: center;

            color: white;

            font-size: 0.5rem;
          }
        }
      }
      &.show > .nav-link:after {
        content: '\f107';
      }
      .dropdown-menu > .dropdown-item > .dropdown-message {
        overflow: hidden;

        max-width: none;

        text-overflow: ellipsis;
      }
    }
  }
  @media (min-width: 992px) {
    .navbar-brand {
      width: $sidenav-base-width;
    }
    .navbar-collapse {
      overflow: visible;

      max-height: none;
      .navbar-sidenav {
        position: absolute;
        top: 0;
        left: 0;

        overflow-x: hidden;
        overflow-y: auto;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;

        margin-top: $navbar-base-height;

        > .nav-item {
          width: $sidenav-base-width;
          padding: 0;
          > .nav-link {
            padding: 1em;
          }
          .sidenav-second-level,
          .sidenav-third-level {
            padding-left: 0;

            list-style: none;

            > li {
              width: $sidenav-base-width;
              > a {
                padding: 1em;
              }
            }
          }
          .sidenav-second-level > li > a {
            padding-left: 2em;
          }
          .sidenav-third-level > li > a {
            padding-left: 3em;
          }
        }
      }
      .navbar-nav > .nav-item.dropdown {
        > .nav-link {
          min-width: 0;
          &:after {
            width: 24px;

            text-align: center;
          }
        }
        .dropdown-menu > .dropdown-item > .dropdown-message {
          max-width: 300px;
        }
      }
    }
  }
}

// Color support for .navbar-dark

#mainNav.navbar-dark {
  .navbar-collapse {
    .navbar-sidenav {
      .nav-link-collapse:after {
        color: $gray-600;
      }
      > .nav-item {
        > .nav-link {
          color: $gray-600;
          &:hover {
            color: $gray-500;
          }
        }
        .sidenav-second-level,
        .sidenav-third-level {
          > li > a {
            color: $gray-600;
            &:focus,
            &:hover {
              color: $gray-500;
            }
          }
        }
      }
    }
    .navbar-nav > .nav-item.dropdown > .nav-link:after {
      color: $gray-500;
    }
  }
  @media (min-width: 992px) {
    .navbar-collapse {
      .navbar-sidenav {
        background: $gray-800;
        li {
          &.active {
            a {
              color: white !important;
              background-color: $gray-700;
              &:focus,
              &:hover {
                color: white;
              }
            }
          }
        }
        > .nav-item {
          .sidenav-second-level,
          .sidenav-third-level {
            background: $gray-800;
          }
        }
      }
    }
  }
}

// Color support for .navbar-light

#mainNav.navbar-light {
  .navbar-collapse {
    .navbar-sidenav {
      .nav-link-collapse:after {
        color: fade-out($black, 0.5);
      }
      > .nav-item {
        > .nav-link {
          color: fade-out($black, 0.5);
          &:hover {
            color: fade-out($black, 0.3);
          }
        }
        .sidenav-second-level,
        .sidenav-third-level {
          > li > a {
            color: fade-out($black, 0.5);
            &:focus,
            &:hover {
              color: fade-out($black, 0.3);
            }
          }
        }
      }
    }
    .navbar-nav > .nav-item.dropdown > .nav-link:after {
      color: fade-out($black, 0.5);
    }
  }
  @media (min-width: 992px) {
    .navbar-collapse {
      .navbar-sidenav {
        background: $gray-100;
        li {
          &.active {
            a {
              color: $black !important;
              background-color: $gray-200;
              &:focus,
              &:hover {
                color: $black;
              }
            }
          }
        }
        > .nav-item {
          .sidenav-second-level,
          .sidenav-third-level {
            background: $gray-100;
          }
        }
      }
    }
  }
}
