@import (multiple, reference, optional) '../../theme.config';

@type: extra;
@element: custom;

@borderSize: 2px;
@borderWidth: 1px;
@border: @borderWidth solid @borderColor;
@boxShadow: @subtleShadow;

[hidden] {
  display: none !important;
}

.styled-navigationBlock.styled-with-bg.full-width {
  padding: 0;
}

.industrial-site-style {
  .navigation-block .ui.menu {
    border: none;
    margin-bottom: 0;
  }
}

div#view .navigation-block .ui.container > .ui.menu,
div#view .navigation-block .ui.container > .underline-menu {
  margin-bottom: 0;
}

.navigation-block {
  border: @border;
  box-shadow: @boxShadow;

  > .menu-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    margin: -1px !important;

    > .underline-menu {
      padding: @relative11px @relative14px;
    }
  }
}

.navigation-block .ui.menu {
  @textColor: var(--text-color, @blue);
  overflow: hidden !important;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;

  .item {
    padding: @relative11px @relative14px;
    border: none !important;
    margin-bottom: 0 !important;

    a {
      color: @textColor;
      font-weight: bold;

      &:hover {
        .darkenFilter(0.9);
      }
    }

    &::before {
      display: none;
    }

    &.active {
      background: transparent;

      &::before {
        position: absolute;
        top: calc(100% - @borderSize);
        display: block;
        width: 100%;
        height: @borderSize;
        background-color: @textColor;
        content: '';
      }
    }

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

  > .item:first-child {
    border-radius: @defaultBorderRadius 0px 0px 0px;
  }
}

.navigation-block .ui.underline-menu {
  @textColor: var(--text-color, @blue);
  color: @textColor;
  font-weight: bold;

  .item {
    padding: @relative11px @relative14px;
    border: none !important;
    margin-bottom: 0 !important;

    a {
      color: @textColor;

      &:hover {
        .darkenFilter(0.9);
      }
    }
  }

  &.pointing.dropdown > .menu {
    right: 0px;
    left: auto;
    margin-top: 0px;

    &::after {
      right: 20px;
      left: auto;
    }
  }
}

.type-1 {
  > .navigation-block {
    border: none;
    box-shadow: none;
  }

  > .navigation-block .ui.menu {
    @textColor: var(--text-color, @blue);
    height: 100%;
    border: 0;
    border-radius: 2em;
    box-shadow: @boxShadow;

    .item {
      flex: 1;
      justify-content: center;
      padding: 0;
      border: 1px solid @textColor !important;
      margin: 0;
      margin-top: 0 !important;
      margin-right: 0 !important;
      margin-bottom: 0 !important;
      margin-left: 0 !important;
      background: #fff;
      border-radius: 0;
      transition: background-color 0.2s ease-in-out;

      a {
        display: inline-block;
        width: 100%;
        padding: @relative11px @relative14px;
        text-align: center;
        transition: color 0.2s ease-in-out;
      }

      &:first-child {
        border-radius: 2em 0 0 2em;
      }

      &:last-child {
        border-radius: 0 2em 2em 0;
      }

      &.active {
        background-color: @textColor;

        a {
          color: #fff;
        }

        &::before {
          display: none;
        }

        &:hover {
          background-color: @textColor !important;
        }
      }
    }
  }
}
