.nav.dropdown-menu {
  background-color: $dark-blue;
  border: 1px solid $white;
}

.nav-home {
  li.dropdown {
    position: static;
    visibility: inherit;

    &.open {

    }
  }

  .dropdown-menu {
    position: absolute;
    bottom: auto;
    overflow: auto;
    top: auto;
  }
}


.sidebar {
  position: fixed;
  top: 70px;
  bottom: 0;
  z-index: 40;
  display: block !important;
  visibility: visible;
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: auto;
  //padding-top: 9px;
  padding-right: inherit;
  height: auto;
  background: $blue;
  -webkit-overflow-scrolling: touch;

  &.collapse {
    width: 0 !important;
  }

  &.collapse.in {
    width: 100% !important;
  }

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

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

    input[type="search"] {
      @include input-placeholder {
        font-size: 18px;
      }
    }
  }

  .caret {
    margin-left: 7px;
  }

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

  .active > a {
    -webkit-transition: height .3s .3s ease-out,opacity .3s 0s ease-out,background-color .2s .6s ease-out,color .2s .6s ease-out,color .2s .6s ease-out,border-color 0s ease-out;
    -moz-transition: height .3s .3s ease-out,opacity .3s 0s ease-out,background-color .2s .6s ease-out,color .2s .6s ease-out,color .2s .6s ease-out,border-color 0s ease-out;
    -ms-transition: height .3s .3s ease-out,opacity .3s 0s ease-out,background-color .2s .6s ease-out,color .2s .6s ease-out,color .2s .6s ease-out,border-color 0s ease-out;
  }

  .nav a {
    overflow: hidden;
    padding: 0 15px;
    text-overflow: ellipsis;
    line-height: 20px;
    cursor: pointer;
    -webkit-transition: height .3s 0s ease-out,opacity .3s 0s ease-out;
    -moz-transition: height .3s 0s ease-out,opacity .3s 0s ease-out;
    -ms-transition: height .3s 0s ease-out,opacity .3s 0s ease-out;
    -o-transition: height .3s 0s ease-out,opacity .3s 0s ease-out;
    transition: height .3s 0s ease-out,opacity .3s 0s ease-out;
  }

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

    &.open {
      .row-level-2 {
        display: block;
        border-bottom: 1px solid $medium-grey;
      }
    }
  }

  .nav-stacked > li {
    margin: 0;
    + li {
      margin: 0;
    }
  }

  .page-head__main-menu {
    padding-top: 9px;
  }

  .page-head__top-menu {
    overflow: visible;
    padding-bottom: 5px;
    padding-top: 5px;

    li {
      a {
        padding-top: 10px;
        padding-bottom: 10px;
      }
    }
  }

  .row-level-3 {
    display: none;
  }

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

  .navbar-nav {
    margin: 0 -15px;
  }

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

  .nav-level-2.open,
  .row-level-2 {
    background-color: $dark-blue;
  }

  .navbar-nav .open .dropdown-menu > li > a,
  .navbar-nav .open .dropdown-menu .dropdown-header {
    padding: 12px 15px 12px 23px;
  }

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

  .section-icon {
    display: none;
  }
}

.goog-te-menu-frame.open {
  left: 0;
  top: 150px;
}

.viewport {

  .page-head__top-menu {
    @include breakpoint($screen-lg-desktop) {
      padding-right: 15px;
    }
  }

  @media (min-width: 768px) {
    .secondary_menu {
      max-height: 100px;
      float: right;
      nav {
        display: inline-block !important;
      }
    }
  }

  @include breakpoint($screen-md) {
    .secondary_menu {
      align-items: center;
      display: flex;
      float: right;

      nav, .openy-gtranslate {
        display: inline-block;
      }
    }
  }

  .page-head__main-menu {

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

    .nav-level-3 {
      padding-top: 25px;

      > a {
        min-height: 34px;
        display: inline-block;
        padding: 0;
        position: relative;

        @include breakpoint($screen-lg-desktop) {
          display: block;
          min-height: 134px;
        }
      }


      .section-icon {
        display: none;
        margin-bottom: 15px;
        text-align: center;

        @include breakpoint($screen-lg-desktop) {
          display: block;
        }

        img {
          width: 50px;
        }
      }
    }

    .row-level-2 {
      padding: 2px 25px 37px 41px;
    }
  }

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

      @include breakpoint($screen-lg-desktop) {
        padding: 10px 20px 25px 20px;
      }

      &:hover,
      &:focus {
        background: none;
      }
    }

    &.open {
      background-color: $dark-blue;
      border-top: 1px solid $light-grey;
      border-left: 1px solid $light-grey;
      border-right: 1px solid $light-grey;
      border-bottom: 1px solid $dark-blue;
      margin-top: -1px;

      > .dropdown-menu {
        margin-top: -1px;
      }

      > a,
      > a:focus {
        position: relative;
        z-index: 1001;
        padding: 10px 14px 24px 14px;
        background: $dark-blue;

        @include breakpoint($screen-lg-desktop) {
          padding: 10px 19px 24px 19px;
        }
      }
    }
  }

  .row-level-3,
  .nav-level-4 {
    list-style: none;
    padding-left: 0;
  }

  .nav-level-4 {
    padding: 2px 0;

    a {
      font-size: 14px;
      line-height: 20px;
      text-transform: none;
    }
  }
}

.tiny-header .viewport .openy-gtranslate .goog-te-gadget-simple .goog-te-menu-value {
  line-height: 51px;
}

@include breakpoint($screen-tablet $screen-sm-max) {
  .navbar-nav > li {
    float: none;
  }
}

@include breakpoint($screen-desktop $screen-md-max) {
  .row-level-2 {
    > li {
      &:nth-child(4n + 1) {
        clear: both;
      }
    }
  }
}

@include breakpoint($screen-md-max) {
  .row-level-2 {
    > li {
      &:nth-child(6n + 1) {
        clear: both;
      }
    }
  }
}

@include breakpoint($screen-desktop) {
  .row-level-2 {
    left: 0;
    right: 0;
  }
}

.section-icon {
  background-position: 33% 50%;
  background-size: contain;
  background-repeat: no-repeat;
  height: 50px;

  img {
    display: none;
  }

  // Section icons are set via UI and simple_menu_icons module.
}

@include breakpoint($screen-tablet $screen-desktop) {
  .navbar-nav {
    float: none;
  }
}

.page-head__main-menu {
  .nav-level-2 {
    .fa-caret-up {
      display: none;
    }

    &.open {
      .fa-caret-up {
        display: inline;
      }
      .fa-caret-down {
        display: none;
      }
    }
  }
}

// Overriding Bootstrap text decoration.
.nav > li > a:hover {
  text-decoration: underline;
}
