@import "../variables";
@import "../mixin";
@import "../buttons/buttons";

/*===========================
  NAVBAR css 
===========================*/
.navbar-toggler:focus {
  box-shadow: none;
}

.mb-100 {
  margin-bottom: 100px;
}

/*===== NAVBAR SIX =====*/

.navbar-six {
  background-color: var(--light-2);

  @media #{$md, $xs} {
    padding: 10px 0;
  }

  & .navbar {
    position: relative;
    padding: 0;
  }

  & .navbar-toggler {
    & .toggler-icon {
      width: 30px;
      height: 2px;
      background-color: var(--black);
      margin: 5px 0;
      display: block;
      position: relative;
      @include transition(0.3s);
    }

    &.active {
      & .toggler-icon {
        &:nth-of-type(1) {
          @include transform(rotate(45deg));
          top: 7px;
        }

        &:nth-of-type(2) {
          opacity: 0;
        }

        &:nth-of-type(3) {
          @include transform(rotate(135deg));
          top: -7px;
        }
      }
    }
  }

  & .navbar-collapse {
    @media #{$md, $xs} {
      position: absolute;
      top: 116%;
      left: 0;
      width: 100%;
      background-color: var(--light-2);
      z-index: 8;
      padding: 10px 16px;
    }
  }

  & .navbar-nav {
    margin-right: 24px;

    @media #{$md, $xs} {
      margin-right: 0;
    }

    & .nav-item {
      position: relative;

      & a {
        display: flex;
        align-items: center;
        padding: 10px 16px;
        color: var(--black);
        text-transform: capitalize;
        position: relative;
        border-radius: 5px;
        @include transition(0.3s);
        font-weight: 500;
        margin: 22px 6px;
        border: 1px solid transparent;

        @media #{$md, $xs} {
          padding: 10px;
          display: block;
          border: 0;
          margin: 0;

          &.active {
            i {
              color: var(--white);
            }
          }
        }

        &.active {
          opacity: 1;
          background-color: var(--primary);
          color: var(--white);

          @media #{$md, $xs} {
            border: 0;
          }
        }

        &:hover {
        }

        i {
          font-size: 14px;
          font-weight: 700;
          padding-left: 8px;
        }
      }

      &:hover {
        & > a {
          background-color: var(--primary);
          color: var(--white);

          @media #{$md, $xs} {
            border: 0;
          }
        }
      }

      .sub-nav-toggler {
        @media #{$md, $xs} {
          display: inline-block;
          position: absolute;
          top: 0;
          right: 0;
          padding: 10px 14px;
          font-size: 16px;
          background: none;
          border: 0;
          color: var(--black);
        }
      }

      & .sub-menu {
        position: absolute;
        left: 0;
        top: 100%;
        width: 260px;
        background-color: var(--white);
        border-radius: 5px;
        opacity: 0;
        visibility: hidden;
        @include transition(0.3s);
        z-index: 99;
        @include box-shadow(0 2px 6px 0 rgba(0, 0, 0, 0.16));
        padding: 10px;

        @media #{$md, $xs} {
          position: relative !important;
          width: 100% !important;
          left: 0 !important;
          top: auto !important;
          opacity: 1 !important;
          visibility: visible !important;
          right: auto;
          @include transform(translateX(0%));
          @include transition(none);
          @include box-shadow(none);
          text-align: left;
          border-top: 0;
          height: 0;
        }

        &.collapse:not(.show) {
          height: auto;
          display: block;

          @media #{$md, $xs} {
            height: 0;
            display: none;
          }
        }

        &.show {
          @media #{$md, $xs} {
            height: auto;
          }
        }

        & li {
          position: relative;
          margin-bottom: 6px;

          &:last-child {
            margin-bottom: 0px;
          }

          & .sub-nav-toggler {
            color: var(--black);
            @include transition(0.3s);
          }

          & a {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 24px;
            position: relative;
            color: var(--black);
            @include transition(0.3s);
            border-radius: 0;
            margin: 0 0;
            opacity: 1;
            border: 0;
            border-radius: 5px;

            & .sub-nav-toggler {
              color: var(--black);
            }

            & i {
              font-weight: 700;
              font-size: 14px;

              @media #{$md, $xs} {
                display: none;
              }
            }

            &.active {
              color: var(--white);

              i {
                color: var(--white);
              }
            }

            & .sub-nav-toggler {
              & i {
                display: inline-block;
              }
            }

            &::after,
            &::before {
              display: none;
            }
          }

          & .sub-menu {
            right: auto;
            left: 100%;
            top: 0;
            opacity: 0;
            visibility: hidden;
            @include transition(0.3s);

            @media #{$laptop,$desktop} {
              margin-left: 10px;
            }

            @media #{$md, $xs} {
              padding-left: 30px;
            }

            &.show {
              @media #{$md, $xs} {
                visibility: visible;
                height: auto;
                position: relative;
              }
            }
          }

          &:hover {
            & .sub-menu {
              opacity: 1;
              visibility: visible;
            }

            & .sub-nav-toggler {
              color: var(--white);
            }

            & > a {
              background: var(--primary);
              color: var(--white);

              &::before {
                opacity: 1;
              }
            }
          }
        }
      }

      &:hover {
        & .sub-menu {
          opacity: 1;
          visibility: visible;
        }
      }
    }
  }

  & .navbar-btn {
    @media #{$md} {
      position: absolute;
      right: 70px;
      top: 50%;
      @include transform(translateY(-50%));
    }

    @media #{$xs} {
      position: absolute;
      right: 60px;
      top: 50%;
      @include transform(translateY(-50%));
    }

    .primary-btn {
      @extend %primary-btn;
      font-weight: 500;

      @media #{$lg} {
        padding: 12px 20px;
      }
    }
  }
}
