.navbar-brand {
  margin-left: 15px;
  height: 90px;
  width: 180px;
  background: url('../img/logo.svg') no-repeat left center;
  background-size: 180px;
  @media (max-width: 767px) {
    height: 66px;
    background-size: 144px;
  }
}

.navbar-fixed-top {
  border-width: 0;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
  .glyphicon {
    color: @color-text-dark;
  }
  @media (max-width: @screen-xs-max) {
    position: relative;
    margin-bottom: 0;
  }
}

.navbar-toggle {
  border: none;
  margin-top: 0;
  margin-bottom: 0;
  /*.icon-bar {
    background-color: #fff;
  }*/
}

.navbar-collapse {
  max-height: 100%;
}

.dropdown-menu {
  border-radius: 0;
  min-width: 80px;
  border: none;

  padding: 0;
  & > li {
    & > a {
      color: @color-text-dark;
      padding: 13px 20px;
      border-bottom: 1px solid @color-background;
    }
    &.active > a,
    & > a:active,
    & > a:focus,
    & > a:hover {
      background-color: @color-background;
    }
  }
}

// --------------------- //
#main-menu {
  font-size: @font-size-small;
  margin-left: -@grid-gutter-width-half;

  & > li > a {
    &:hover {
      background-color: @navbar-default-link-hover-bg;
    }
  }
  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
    li {
      a {
        padding-left: 12px;
        padding-right: 12px;
      }
    }
    & > li:first-child a {
      padding-left: @grid-gutter-width-half;
    }
  }
}

header {
  background-color: white;
  height: 90px;
}
#logo {
  background: white;
  height: 90px;
  margin-left: -10000px;
  padding: 0 0 0 10000px;
  min-width: 1250px;
  width: calc(25% + 10000px);
  .navbar-brand {
    margin-left: @grid-gutter-width-half;
    @media (min-width: @screen-xl-min) {
      margin-left: @grid-gutter-width-half-xl;
    }
  }
  img {
    width: 180px;
  }
  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
    min-width: 1230px;
  }
  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
    min-width: 1200px;
    width: calc(33.3333% + 10000px);
    width: -webkit-calc(33.3333% + 10000px);
    width: -moz-calc(33.3333% + 10000px);
  }
}
.header-menu {
  float: right;
  margin-top: 25px;
  & > li {
    float: left;
    font-size: 14px;
    height: 34px;
    line-height: 34px;
    padding-left: 10px;
    & > a, &.open > a {
      padding: 0;
      background: transparent;
      color: @color-text-dark;
      &:active,
      &:focus,
      &:hover {
        background-color: transparent !important;
      }
    }
    &.active a {
      color:@color-colored;
      background-color: transparent !important;
    }
    // @since 2.0.7
    &.active > a {
      color: @color-text-dark;
      font-weight: @font-weight-bold;
    }
    &.divider {
      padding-left: 10px;
      color: @color-text-dark;
      &:after {
        content: '|';
      }
    }
    &.text-hidden {
      margin-left: 6px;
    }
    .glyphicon {
      //color: @color-text-dark;
      font-size: 22px;
      top: 4px;
      width: auto;
    }
    span.h4 {
      display: block;
    }
  }
  .dropdown-menu {
    font-size: 14px;
  }
}

// --------------------- //
// SUBMENU FULL SIZE
// -> needs class .submenu-full-width
//
@media (min-width: @screen-sm-min) {
  .submenu-full-width {
    .navbar-collapse {
      .nav {
        & > li.dropdown {
          position: initial;
        }
        li.dropdown {

          &.open > ul.dropdown-menu {

            width: 100vw;
            left: 0;

            padding: 40px calc((100vw - (@container-xl - @grid-gutter-width)) / 2);
            @media (min-width: @screen-lg-min) and (max-width: @screen-lg-max) {
              padding: 40px calc((100vw - (@container-lg - @grid-gutter-width)) / 2);
            }
            @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
              padding: 40px calc((100vw - (@container-md - @grid-gutter-width)) / 2);
            }
            @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
              padding: 40px calc((100vw - (@container-sm - @grid-gutter-width)) / 2);
            }

            // ------------------------------ //
            // Solution COLUMNS
            //
            column-count: auto;
            column-width: @mega-menu-column-width;


            // submenu 2nd level
            & > li {
              // prevent submenu from flowing into next column
              display: inline-block; // working add to elemnt which you do not want to break
              min-width: @mega-menu-column-width;
              border-top: 1px solid @color-text-dark;
              font-size: 16px;

              & > a {
                padding: 10px 0;
                font-weight: 600;
                border-bottom: none;

                &:active,
                &:focus,
                &:hover {
                  text-decoration: underline; // @since 2.0.1
                  background-color: transparent !important;
                  color: @color-text-dark;
                }
              }
            }

            ul.dropdown-menu {
              position: relative;
              display: inline-block;
              float: none;
              box-shadow: none;
              // submenu 3rd level
              li {
                font-size: 16px;

                & > a {
                  background-color: transparent;
                  border: none;
                  padding: 10px 0;
                  &:active,
                  &:focus,
                  &:hover {
                    text-decoration: underline; // @since 2.0.1
                    background-color: transparent !important;
                    color: @color-text-dark;
                  }
                }

                &:last-child {
                  margin-bottom: 20px;
                }
              }
            }
            // ------------------------------ //
          }
        }
        ul.dropdown-menu {
          li {
            &, & a {
              color: @color-text-dark;
              background-color: transparent;
            }
            &.active,
            &.active > a {
              color: @color-text-dark;
            }

            a {
              max-width: @mega-menu-column-width;
              white-space: break-spaces;
            }
          }
        }
      }
    }
  }
}



// --------------------- //
// MAIN MENU MOBILE
//
@media (max-width: @screen-xs-max) {

  #logo {
    min-width: 100vw !important;
    max-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .navbar-brand {
      margin-left: 23px; // same as logo icon height
    }
  }

  .search {
    color: @color-colored;
    margin-right: 90px;
    margin-top: 5px;
    .glyphicon {
      font-size: 22px;
      width: auto;
    }
  }

  .container .navbar-header {
    margin-left: -@grid-gutter-width-half-xs;
    margin-right: -@grid-gutter-width-half-xs;
  }
  .navbar-collapse {
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
  }

  .navbar-default {
    .header-menu {
      margin-top: 0;
      background-color: white;
      margin-left: -@grid-gutter-width-half;
      padding-left: @grid-gutter-width-half;
      margin-right: -@grid-gutter-width-half;
      padding-right: @grid-gutter-width-half;
      padding-bottom: @grid-gutter-width-half;
      float: none;
      
      .navbar-nav {
        &, .open {
          li {
            &, a {
              color: @color-text-dark;
            }

            a {
              &:active,
              &:focus,
              &:hover {
                color: @color-text-dark;
              }
            }

            &.text-hidden {
              float: left;
            }
          }
        }
      }
    }
  }

  // reset all active|hover |focus
  .navbar-nav {
    li.active a,
    .open > a,
    a:active, a:hover, a:focus {
      background-color: transparent !important;
    }
    .dropdown-menu, li {
      margin-top: 0;
      margin-bottom: 0;
      padding-top: 0;
      padding-bottom: 0;
      ul {
        li {
          font-size: 16px;
          a {
            padding: 5px 15px 5px 25px;
          }
        }
      }
    }

    .hwk-open > a > .caret {
      transform: scaleY(-1);
    }
  }

  .navbar-default {

    header {
      height: @header-height-xs;
      //height: auto;
      #logo {
        padding: 0;
        margin: 0;
        height: 66px;
        width: 100%;
        img {
          width: 144px;
        }
      }
    }

    .navbar-toggle {
      position: relative;
      top: -((@header-height-xs + @header-navbar-height-xs) / 2);
      border: none;
      padding: 0;
      margin: 0;
      right: 23px + 5; // see logo margin left

      .icon-bar {
        background-color: @color-text-dark !important;
      }

      &:active,
      &:focus,
      &:hover {
        background-color: transparent !important;
      }

      // hamburger animation to cross
      transition: all 0.3s linear, background-color 0s;
      width: @hamburger-width;
      height: @hamburger-width;

      .icon-bar {
        // hide others icon bars
        display: none;
        // show pnly one
        &:last-child {
          display: block;
          margin-top: 0;
        }

        &, // middle line
        &::before, // top line
        &::after { // bottom line
          position: absolute;
          width: @hamburger-width;
          height: @hamburger-line-height;
          background-color: @hamburger-line-color;
          left: 0;
        }

        &::before {
          content: '';
          bottom: (@hamburger-width / 2)-(@hamburger-line-height * 2) - 2;
        }

        &::after {
          transition: all 0.3s linear, background-color 0s;
          content: '';
          top: (@hamburger-width / 2)-(@hamburger-line-height * 2) - 2;
        }
      }
    }

    .container .navbar-collapse {
      max-height: calc(100vh - @header-height-xs);
      position: absolute;
      width: 100%;
      top: @header-height-xs;
      background-color: @color-background;
      overflow-x: hidden;
      margin-left: -@grid-gutter-width-half-xs;
      margin-right: -@grid-gutter-width-half-xs;
      padding-left: @grid-gutter-width-half-xs;
      padding-right: @grid-gutter-width-half-xs;

      #main-menu {  // ul
        margin-top: 0;
        margin-bottom: 0;

        // style dropdown mobile
        .dropdown-menu {
          position: static;
          float: none;
          width: auto;
          margin-top: 0;
          background-color: transparent;
          border: 0;
          box-shadow: none;
          & > li > a {
            white-space: normal;
          }
        }
        
        .active {
          & > a {
            color: @color-text-dark;
          }
        }

        // first level
        & > li {
          font-size: @font-size-base-p;
          font-weight: @font-weight-bold;
          border-top: 1px solid #fff;
          &:first-child {
            border-top: none;
          }
          & > a {
            padding-top: 16px;
            padding-bottom: 16px;
          }
          &.dropdown {
            // always hide when bs class is used
            // crazy js problems as it was automatically shown again after hiding ?
            &.open > .dropdown-menu {
              display: none;
            }
            // use hwk-open
            &.hwk-open > .dropdown-menu {
              display: block;
            }

            // second level
            & > .dropdown-menu { // ul
              background-color: @color-background;
              & > li {
                border-bottom: 1px solid #fff;
                &:last-child {
                  border-bottom: none;
                }
                & > a {
                  font-size: 18px;
                  font-weight: @font-weight-bold;
                  color: @color-text-dark;
                  padding: 16px 15px 16px 40px;
                }
                &.dropdown {
                  & > a::after {
                    content: '';
                    display: inline-block;
                    width: 0;
                    height: 0;
                    margin-left: 6px;
                    vertical-align: middle;
                    border-color: @color-text-dark;
                    border-top: @caret-width-base dashed;
                    border-top: @caret-width-base solid ~"\9"; // IE8
                    border-right: @caret-width-base solid transparent;
                    border-left: @caret-width-base solid transparent;
                  }
                  &.hwk-open > a::after {
                    transform: scaleY(-1);
                  }

                  &.hwk-open {
                    border-bottom: none;
                  }
                  &.hwk-open >  .dropdown-menu { // ul
                    display: block;
                  }
                  // third level
                  .dropdown-menu { // ul
                    background-color: #fff;
                    & > li {
                      border-bottom: 1px solid @color-background;

                      & > a {
                        font-size: 18px;
                        font-weight: @font-weight-normal;
                        color: @color-text-dark;
                        padding: 16px 15px 16px 70px;
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  *[data-navbar-toggle="open"] {

    & .navbar-default, &.navbar-default {
      // menu open
      .navbar-toggle:not(.closed) {
        width: @hamburger-width + (@hamburger-line-height * 2);

        .icon-bar {
          width: @hamburger-width + (@hamburger-line-height * 2);
          //top: 10px;
          top: calc(50%);
          left: 5px;
          transform: rotate(-45deg);
          // adjust properties on the after pseudo element
          &::after {
            top: 0px;
            left: 0px;
            transform: rotate(90deg);
            width: @hamburger-width + (@hamburger-line-height * 2);
          }

          // hide top line by scaling it to 0
          &::before {
            transform: scale(0);
          }
        }
      }
    }
  }
}

// --------------------- //
// 3. NAV LEVEL classic
//
#header-nav-3 {
  display: none;
  //display: flex;    // added by js
  justify-content: center;

  position: relative;
  z-index: 2;
  margin-top: -40px;
  padding-top: 30px;
  padding-bottom: 30px;
  margin-bottom: 40px;
  width: 100%;
  background: #fff;
  box-shadow: 3px 3px 6px rgba(@gray-dark, .2);

  h1, .h1 {
    font-size: @font-size-h3;
    color: @color-colored !important;
    margin: 0;
    padding: 0;
  }
  ul {
    list-style: none;
    li {
      &, a {
        color: @color-text-dark;
        font-weight: @font-weight-normal;
      }
      &.active > a,
      a:hover, a:focus, a:active {
        //color: @color-colored;
        font-weight: @font-weight-bold;
      }
    }
  }
  & > .row {
    margin-left: auto;
    margin-right: auto;
    @media (min-width: @screen-xl-min) {
      width: @container-xl;
    }
    @media (min-width: @screen-lg-min) and (max-width: @screen-lg-max) {
      width: @container-lg;
    }
    @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
      width: @container-md;
    }
    @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
      width: @container-sm;
    }
    @media (max-width: @screen-xs-max) {
      width: 100%;
    }
  }
  // not mobile | tablet
  @media (min-width: @screen-md-min) {

    #nav-level-3 {
      align-self: flex-end;
      ul {
        display: flex;
        margin: 0;
        // @since 2.0.6
        flex-wrap: wrap;
        li {
          margin: 0 0 2px 30px;
        }
      }
    }
    .col-md-12 {
      float: none;
      display: flex;
      justify-content: space-between;
      .clearfix, hr {
        position: absolute;
        display: none;
      }
    }
  }

  // mobile | tablet
  @media (max-width: @screen-sm-max) {
    margin-top: -30px;
    padding-left: @grid-gutter-width-half-xs;
    padding-right: @grid-gutter-width-half-xs;
    #nav-level-3 {
      margin-top: 20px;
      ul {
        li {
          margin-top: 10px;
          float: none;
        }
      }
    }
    hr {
      display: none;
    }
  }

  @media (max-width: @screen-xs-max) {
    top: -20px;
  }
}
// --------------------- //