$navbar-min-height: 50px;
$navbar-max-height: 50px;
$navbar-padding: 0 15px;
$navbar-border-radius: 0 0 15px 15px;
$navbar-z-index: 9000;

.navbar {
  width: 100%;
  position: relative;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: $navbar-padding;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  min-height: $navbar-min-height;
  max-height: $navbar-max-height;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: stretch;
  background-color: $white;
  color: $darkestGray;
  border-radius: $navbar-border-radius;
  z-index: $navbar-z-index;
  transition: all 0.4s ease;

  @each $color, $value in $colors {
    &.#{$color} {
      background-color: $value;
      color: get-contrast($value);

      &.shadow {
        box-shadow: 0 5px 50px 0 rgba($value, 0.25);
      }

      .navbar-item.active::after {
        background-color: get-contrast($value);
      }
    }

    &.line-#{$color} {
      .navbar-item.active::after {
        background-color: $value;
      }
    }
  }

  .navbar-left,
  .navbar-center,
  .navbar-right {
    display: flex;
    align-items: center;
  }

  .navbar-left {
    .navbar-burger-icon {
      display: none;
    }
  }

  .navbar-brand {
    font-size: 1.15rem;
    color: inherit;
    font-weight: 600;
  }

  .navbar-item {
    color: inherit;
    padding: 15px;
    font-weight: 600;
    transition: all 0.25s ease, color 0s;
    opacity: 0.7;
    position: relative;
    height: 100%;
    font-size: 0.9rem;

    &:hover {
      opacity: 1;
    }

    &.active {
      opacity: 1;

      &::after {
        content: "";
        height: 2px;
        background-color: $dark;
        display: block;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
      }
    }
  }

  &.square {
    border-radius: 0 !important;
  }

  &.not-line {
    .navbar-item {
      &.active {
        &::after {
          display: none;
        }
      }
    }
  }

  &.shadow {
    box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.15);
  }
}

@media (max-width: $lg) {
  .navbar {
    flex-direction: column;
    justify-content: start;
    overflow: hidden;

    &.active {
      min-height: 100%;
      max-height: 100%;
    }

    .navbar-left {
      min-height: $navbar-min-height;
      align-items: center;

      .navbar-burger-icon {
        height: $navbar-min-height;
        width: $navbar-min-height;
        position: relative;
        display: flex;
        margin-left: auto;

        span {
          background-color: $darkestGray;
          display: block;
          height: 1px;
          left: calc(50% - 8px);
          position: absolute;
          transform-origin: center;
          transition-duration: 86ms;
          transition-property: background-color, opacity, transform;
          transition-timing-function: ease-out;
          width: 16px;

          &:first-child {
            top: calc(50% - 6px);
          }

          &:nth-child(2) {
            top: calc(50% - 1px);
          }

          &:nth-child(3) {
            top: calc(50% + 4px);
          }
        }
      }
    }

    .navbar-center {
      flex-direction: column;
      justify-content: start;
      align-items: stretch;
    }
    .navbar-item.dropdown {
      display: flex;
      flex-direction: column;
      height: $navbar-max-height;

      &.open {
        height: 100%;

        .dropdown-content {
          display: block;
          height: 100%;
        }
      }

      :not(.dropdown-content) {
        height: $navbar-max-height;
      }

      .dropdown-content {
        display: block;
        padding-top: 0;
        height: 0;
        position: relative;
        transform: none !important;

        .dropdown-menu {
          height: 100%;
          background-color: transparent;
          box-shadow: none;
          padding: 0;

          .dropdown-title {
            display: none;
          }

          .dropdown-item {
            display: flex;
            align-items: center;
          }
        }
      }
    }
  }
}
