/* Menu */

@custom-media --hiq-lower-font-range (min-width: 460px);
@custom-media --hiq-upper-font-range (min-width: 900px);

.navbar-menu {
  display: none;
  flex: 1 1 100%;
  order: 1;
  flex-direction: column;

  .menu-open & {
    display: flex;
  }

  > ul {
    display: flex;
    flex-direction: column;

    > li {
      position: relative;
      display: inline-block;
      margin-inline-start: 0;

      > a {
        display: inline-block;
        padding: .2rem 0;
        color: var(--hiq-text-color);
      }
    }

    > li.active > a,
    > li > a:hover {
      margin-bottom: -2px;
      border-bottom: 2px solid var(--hiq-color-primary);
    }
  }

  @media (--hiq-upper-font-range) {
    display: flex;
    flex-direction: row;
    order: 0;

    > ul {
      flex-direction: row;
      align-items: center;

      > li {
        margin-inline-start: 1.125rem;
      }
    }
  }

  .mod-menu__sub {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    z-index: 3;
    display: none;
    min-width: 12rem;
    padding: .5rem 0;
    margin: 0;
    list-style: none;
    background-color: var(--hiq-dropdown-background-color);
    background-clip: padding-box;
    border: 1px solid var(--hiq-dropdown-border-color);
    border-radius: var(--hiq-border-radius);

    li {
      margin: 0;
    }

    a { /* stylelint-disable-line */
      display: block;
      padding: .5rem 1.5rem;
      line-height: 1.2;
      color: var(--hiq-text-color);

      &:hover {
        background-color: var(--hiq-dropdown-item-hover-background-color);
      }
    }
  }

  .mod-menu__sub:hover,
  li a:hover + .mod-menu__sub {
    display: block;
  }

  @media (--hiq-upper-font-range) {
    .navbar-end {
      margin-inline-start: auto;
      margin-inline-end: 2rem;
    }
  }
}

.navbar-menu-toggle {
  display: flex;
  align-items: center;
  flex: 1 0 auto;
  max-width: 38px;
  width: 38px;
  height: 40px;
  margin-top: 12px;
  margin-bottom: 20px;
  margin-inline-start: auto;
  margin-inline-end: 20px;

  &:hover {
    cursor: pointer;
  }

  span {
    position: relative;
    display: block;

    &::before,
    &::after {
      content: "";
      position: absolute;
      inset-inline-start: 0;
      top: -12px;
    }

    &::after {
      top: 12px;
    }
  }

  span,
  span::after,
  span::before {
    width: 100%;
    height: 5px;
    background-color: var(--hiq-text-color);
    transition: all .3s;
    backface-visibility: hidden;
    border-radius: 2px;
  }

  .menu-open & {
    span {
      background-color: transparent;

      &::before {
        transform: rotate(45deg) translate(9px, 9px);
      }

      &::after {
        transform: rotate(-45deg) translate(8px, -8px);
      }
    }
  }

  @media (--hiq-upper-font-range) {
    display: none;
  }
}

.nav-item {
  position: relative;
}
