@import '../../style/index';

@menu-cls: ~'@{brick-prefix}-menu';

.@{menu-cls} {
  user-select: none;
  ul,
  ol {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  &-hidden {
    display: none;
  }
  &-item,
  &-submenu-title {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 4px;
    padding: 20px 36px 20px 26px;
    overflow: hidden;
    color: @universal-color-second;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s background-color;
  }
  &-item-link {
    padding: 0;
    padding-left: 0 !important;
    > a {
      display: block;
      flex: 1;
      padding: 20px 36px 20px 26px;
      color: @universal-color-second;
    }
  }
  &-item-active,
  &-submenu-active {
    background: @universal-bg-first;
  }
  &-title-icon {
    width: 26px;
    margin-right: 16px;
    text-align: center;
  }
  &-item {
    &-divider {
      width: 100%;
      height: 1px;
      margin: 20px 0;
      background-color: @universal-bg-third;
      &:last-child {
        margin-bottom: 0;
      }
      & + .@{menu-cls}-item {
        margin-top: 0;
      }
    }
    &-selected {
      background-color: @universal-bg-first;
    }
  }
  &-submenu {
    border-radius: 8px;
    transition: 0.3s background-color;
    &-expand-icon {
      position: absolute;
      top: 50%;
      right: 36px;
      width: 10px;
      color: #333;
      transform: translateY(-50%);
      transition: transform 0.3s ease-in-out;
      &::before,
      &::after {
        position: absolute;
        width: 10px;
        height: 1.5px;
        background-color: currentColor;
        border-radius: 2px;
        transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out,
          top 0.3s ease-in-out, color 0.3s ease-in-out;
        content: '';
      }
      &::before {
        transform: rotate(-45deg) translateX(4px);
      }
      &::after {
        transform: rotate(45deg) translateX(-4px);
      }
    }
    &-open &-expand-icon {
      transform: translateY(-3px);
      &::after {
        transform: rotate(-45deg) translateX(-4.5px);
      }
      &::before {
        transform: rotate(45deg) translateX(4.5px);
      }
    }
    &-open {
      background-color: @universal-bg-first;
    }
    .@{menu-cls}-item {
      padding-left: 66px !important;
    }
  }
}
