/*
** Mobile menu
*/
.mobile-sidebar {
  background: $primary;
  bottom: 0;
  display: block;
  height: auto;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  padding-right: inherit;
  position: fixed;
  top: 70px;
  visibility: visible;
  z-index: 40;

  &.collapse {
    width: 0;
  }

  &.collapse.show {
    width: 100%;
  }

  &.collapsing-out {
    transition: visibility 0s .4s linear;
  }

  .search-form-wrapper {
    padding-bottom: 10px;
    padding-top: 10px;
  }

  .dropdown-toggle::after {
    display: none;
  }

  .dropdown-menu {
    position: relative;
    top: 0;
    z-index: 0;
    display: block;
    float: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: $primary;
  }

  .active > a {
    transition: height 0.3s 0.3s ease-out, opacity 0.3s 0s ease-out,
    background-color 0.2s 0.6s ease-out, color 0.2s 0.6s ease-out,
    color 0.2s 0.6s ease-out, border-color 0s ease-out;
  }

  // top level
  .nav > li > a {
    color: $white;
  }

  .nav a {
    color: $primary-darker;
    overflow: hidden;
    padding: 0 15px;
    text-overflow: ellipsis;
    line-height: 20px;
    cursor: pointer;
    transition: height 0.3s 0s ease-out, opacity 0.3s 0s ease-out,
    background-color 0.2s ease-out;

    &[aria-expanded="true"] {
      color: $white;
    }

    &:hover,
    &[aria-expanded="true"] {
      background: $primary-darker;
    }
  }

  .nav-level-2 {
    .row-level-2 {
      display: none;
    }

    &.show .row-level-2 {
      display: block;
      border-bottom: 1px solid $gray-300;
      position: static !important;
      transform: none !important;
    }
  }

  .page-head__top-menu {
    overflow: visible;
  }

  .row-level-3 {
    list-style: none;
  }

  // Search form.
  input[type="submit"] {
    display: none;
  }

  .navbar-nav {
    @include cachet(400);
    margin: 0 -15px;
  }

  .nav-level-2 a {
    padding-top: 25px;
    padding-bottom: 25px;
  }

  .nav-level-2.show,
  .row-level-2 {
    background-color: $white;
  }

  .nav-level-3 a {
    text-transform: uppercase;
  }

  .dropdown-menu > li > a:hover,
  .dropdown-menu > li > a:focus {
    background: none;
  }
}

.toolbar-vertical {
  .mobile-sidebar {
    top: 117px;
  }
}

.mobile-menu {
  &.menu-in .navbar-toggler-icon {
    background-image: escape-svg($navbar-dark-toggler-icon-close);
  }
}
