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

@navigation-prefix: ~'@{ant-prefix}-navigation';

@item-font-size: 16px;
@item-font-size-small: 14px;
@item-line-height-small: 32px;
@item-line-height-large: 36px;
@item-selected-background: #ebf8fe;
@text-line-height: 20px;

.nav-item-attributes() {
  display: flex;
  flex-grow: 1;
  align-items: center;
  max-width: 100%;
  height: 42px;
  margin: 0 10px;
  padding: 0 8px;
  padding-right: 16px;
  padding-left: 12px;
  color: #5F5F5F;
  font-weight: 600;
  font-size: @item-font-size;
  line-height: @item-line-height-large;
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s ease-out;
  appearance: none;

  &:hover,
  &:active {
    color: @primary-color;
    text-decoration: none;
    background-color: #fff;
    border-left: 3px solid @primary-color;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  @media (min-width: @screen-md-min) {
    font-weight: 600;
    font-size: @item-font-size;
    line-height: @item-line-height-small;
  }
  &::-moz-focus-inner {
    border: 0;
  }
}

.nav-item-icon-attributes() {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;

  svg {
    fill: @text-color;
  }

  .@{navigation-prefix}-item:hover & {
    svg {
      fill: @primary-color;
    }
  }

  .@{navigation-prefix}-item-selected &,
  .@{navigation-prefix}-item-selected:hover &,
  .@{navigation-prefix}-sub-navigation-active &,
  .@{navigation-prefix}-sub-navigation-active:hover & {
    
    svg {
      fill: @primary-color;
    }
  }
}

.nav-list-item-attributes() {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  .@{navigation-prefix}-rollup-section &,
  .@{navigation-prefix}-secondary-navigation & {
    opacity: 1;
  }

  .loop(@counter) when (@counter<=12) {
    .loop(@counter + 1);
    &:nth-child(@{counter}) {
      animation-delay: (@counter - 1) * 50ms;
    }
  }

  .loop(0);
}

.nav-item-text-attributes() {
  flex: 1 1 auto;
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: @item-font-size-small;
  line-height: @text-line-height;

  @media (min-width: @screen-md-min) {
    margin-top: 6px;
    margin-bottom: 6px;
  }

  @media (max-width: @screen-sm-max) {
    font-size: 15px;
    line-height: 19px;
  }
}
