.h-menu {
  width: 100%;
  display: block;
  margin: 0;
  padding: 0;
  outline: none;
  list-style: none;
  position: relative;
  line-height: 1;
  &-other-levels {
    .h-func-list-style();
  }
  &-li {
    position: relative;
    list-style: none;
  }
  &-show {
    position: relative;
    padding: 15px 26px;
    cursor: pointer;
    text-overflow: clip;
    white-space: nowrap;
    transition: padding 0.2s;
    font-size: 14px;
    &-expand {
      right: 20px;
      .middle();
    }
    &-desc {
      transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
      opacity: 1;
    }
    &-count {
      transition: right 0.2s;
      z-index: 2;
      right: 60px;
      .middle();
    }
    &-icon {
      margin-right: 5px;
    }
  }
  & &-li .h-menu-link {
    display: block;
    color: inherit;
    font-weight: inherit;
    text-decoration: inherit;
  }
}

.h-menu-mode-vertical {
  .h-menu-other-levels {
    max-height: 0;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    overflow: hidden;
  }
  .h-menu-li {
    margin-bottom: 4px;
    .h-menu-li {
      .h-menu-show {
        padding-left: 50px;
      }
      .h-menu-li .h-menu-show {
        padding-left: 70px;
      }
    }
  }
  .h-menu-li-opened > .h-menu-other-levels {
    max-height: 10000px;
    transition: max-height 0.8s ease-in-out;
  }
  .h-menu-li-opened > .h-menu-show .h-menu-show-expand > i {
    transform: rotate(0deg);
  }
  .h-menu-show {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color @transition-time;
    &-expand {
      > i {
        transition: transform @transition-time;
        transform: rotate(-90deg);
      }
    }
  }
}

.h-menu-dark {
  background: @menu-dark-color;
  color: darken(@white-color, 30%);
  .h-menu {
    &-show {
      border-right: 0px solid transparent;
      &:hover {
        color: @white-color;
      }
    }
    &-other-levels {
      background: darken(@menu-dark-color, 5%);
    }
    &-li {
      &-selected {
        background: @primary-color;
        color: @white-color;
      }
    }
  }
}

.h-menu-white {
  background: @white-color;
  .h-menu-show:hover {
    color: @primary-color;
  }
  .h-menu-other-levels {
    background: @white-color;
  }
  .h-menu-li {
    position: relative;
    .h-menu-show:after {
      position: absolute;
      content: '';
      top: 0;
      right: 0;
      bottom: 0;
      width: 0px;
      background: @primary-color;
    }
    .h-menu-li-selected {
      background-color: @menu-white-background-color;
      color: @primary-color;
      &:after {
        width: 5px;
        transition: @transition-time;
      }
    }
  }
}

.h-menu.h-menu-mode-collapse {
  .h-menu-first-level > .h-menu-show {
    padding-left: 26px;
    padding-right: 26px;
    .h-menu-show-icon {
      margin-right: 0px;
      font-size: 17px;
    }
    .h-menu-show-desc {
      visibility: visible;
      opacity: 0;
      display: inline-block;
      width: 0;
      text-overflow: clip;
    }
    .h-menu-show-count {
      right: 10px;
    }
    .h-menu-show-expand {
      display: none;
    }
  }
}

.h-menu.h-menu-mode-collapse,
.h-menu.h-menu-mode-half-collapse {
  .h-menu-other-levels {
    padding: 5px 0;
    margin-left: 5px;
    left: 100%;
    top: 0;
    width: 150px;
    border-radius: 4px;
    overflow: hidden;
    position: absolute;
    max-width: 0;
    transition: 0.2s cubic-bezier(0.78, 0.17, 0.43, 1);
    white-space: nowrap;
    display: inline-block;
    overflow: hidden;
    opacity: 0.8;
    transform: scale(0.8);
    transform-origin: left;
    .h-menu-show {
      padding-left: 20px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .h-menu-show-expand {
      right: 10px;
    }
  }
  .h-menu-show-expand i {
    transform: rotate(-90deg);
  }
  .h-menu-li:hover {
    > .h-menu-other-levels {
      max-width: 250%;
      opacity: 1;
      transform: scale(1);
      overflow: visible;
      &:before {
        content: '';
        position: absolute;
        height: 100%;
        top: 0;
        left: -10px;
        width: 10px;
      }
    }
  }
}

.h-menu-mode-horizontal {
  &:after {
    content: '';
    display: table;
    clear: both;
  }
  .h-menu-li {
    display: inline-block;
  }

  .h-menu-first-level {
    > .h-menu-show {
      .h-menu-show-count {
        position: initial;
        margin-left: 10px;
        transform: none;
      }
    }
  }

  .h-menu-other-levels {
    padding: 5px 0;
    left: 0;
    top: 100%;
    width: 150px;
    opacity: 0.8;
    max-height: 0;
    margin-top: 5px;
    border-radius: 4px;
    transition: 0.1s cubic-bezier(0.78, 0.17, 0.43, 1);
    transform-origin: top;
    opacity: 0.8;
    transform: scale(0.8);
    visibility: hidden;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    display: inline-block;
    .h-menu-li {
      display: block;
      .h-menu-other-levels {
        padding: 5px 0;
        left: 100%;
        margin-left: 5px;
        opacity: 0.8;
        top: 0;
        width: 150px;
        border-radius: 4px;
        visibility: hidden;
        position: absolute;
        max-height: 0;
        transition: 0.1s cubic-bezier(0.78, 0.17, 0.43, 1);
        transform-origin: top;
        opacity: 0.8;
        transform: scale(0.8);
        white-space: nowrap;
        display: inline-block;
      }
    }
    .h-menu-show {
      overflow: hidden;
      text-overflow: ellipsis;
      transition: color @transition-time;
      &-expand {
        > i {
          transition: transform @transition-time;
          transform: rotate(-90deg);
        }
      }
    }
  }

  .h-menu-show-expand {
    right: 10px;
    i {
      transform: rotate(-90deg);
    }
  }
  .h-menu-li:hover,
  .h-menu-li-hovered {
    > .h-menu-other-levels {
      max-height: 10000px;
      transform: scale(1);
      opacity: 1;
      visibility: visible;
      overflow: visible;
      &:before {
        content: '';
        position: absolute;
        width: 100%;
        top: -10px;
        left: 0;
        height: 10px;
      }
      &:after {
        content: '';
        position: absolute;
        height: 100%;
        top: 0;
        left: -10px;
        width: 10px;
      }
    }
  }
}

.h-menu-white.h-menu-mode-horizontal {
  .h-menu-first-level {
    > .h-menu-show.h-menu-li-selected {
      &:after {
        width: 100%;
        height: 2px;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
      }
    }
  }
}

.h-menu-mode-horizontal.h-menu-dark {
  .h-menu-li {
    .h-menu-show {
      &.h-menu-li-selected {
        background-color: @primary-color;
        color: #ffffff;
        &:after {
          display: none;
        }
      }
    }
  }
}
