@use "../abstracts/" as *;

/* Menu
-------------------------------------------------------------- */
.header__logo-mobile {
  display: none;
  padding: 20px 15px;

  img {
    height: 42px;
  }
}

#main-nav-mobi {
  @include translateY0;
  display: none;
  flex-direction: column-reverse;
  justify-content: flex-end;
  margin: 0 auto;
  width: 280px;
  left: 0;
  z-index: 99999;
  box-shadow: 0 0 50px 10px rgb(0 0 0 / 10%);
  -webkit-box-shadow: 0 0 50px 10px rgb(0 0 0 / 10%);
  -moz-box-shadow: 0 0 50px 10px rgba(0, 0, 0, 0.3);
  padding-left: 0;
  position: fixed;
  top: 0;
  overflow-y: auto;
  background: #0e0e0e;
  height: calc(100vh + 10px);

  ul {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;

    li {
      margin: 0;
      cursor: pointer;
      padding: 0;
      border-top: 1px solid rgba(2, 14, 40, 0.2);
      position: relative;
    }

    li > ul > li:first-child {
      border-top: 1px solid rgba(2, 14, 40, 0.2);
    }
  }

  ul > li {
    padding: 0 20px;
    &:last-child {
      > a {
        border: none;
      }
    }
    > a {
      @include transition3;
      display: block;
      padding: 12px 0;
      position: relative;
      font-family: $font-1;
      font-weight: 700;
      font-size: 16px;
      line-height: 26px;
      color: $white;
      border-bottom: 1px solid rgba(200, 200, 200, 0.1);
    }
  }

  .sub-menu li a {
    padding-left: 40px;

    &.current-item {
      color: $color-main;
    }
  }

  ul li:first-child {
    border-top: 0px;
  }

  ul ul li.current-item a,
  ul > li.current-menu-item > a,
  ul > li > a:hover {
    color: $color-main;
  }

  .menu-item-has-children .arrow {
    @include transition3;
    cursor: pointer;
    display: inline-block;
    font-size: 20px;
    line-height: 48px;
    position: absolute;
    right: 15px;
    text-align: center;
    top: 2px;
    width: 48px;
  }

  .menu-item-has-children .arrow:before {
    font-family: "Font Awesome 5 Pro";
    content: "\f107";
  }

  .menu-item-has-children.current-menu-item .arrow:before {
    color: $color-main;
  }
}

/* Mobile Menu Button */
.icon-menu {
  @include transition3;
  position: absolute;
  width: 26px;
  height: 26px;
  top: 50%;
  right: 0;
  background-color: transparent;
  cursor: pointer;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);

  &:before,
  &:after,
  span {
    background-color: #fff;
    -webkit-transition: all ease 0.3s;
    -moz-transition: all ease 0.3s;
    transition: all ease 0.3s;
  }

  &:before,
  &:after {
    content: "";
    position: absolute;
    top: 0;
    height: 2px;
    width: 100%;
    left: 0;
    top: 50%;
    -webkit-transform-origin: 50% 50%;
    -ms-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
  }

  span {
    position: absolute;
    width: 100%;
    height: 2px;
    left: 0;
    top: 50%;
    overflow: hidden;
    text-indent: 200%;
  }

  &:before {
    -webkit-transform: translate3d(0, -7px, 0);
    -moz-transform: translate3d(0, -7px, 0);
    transform: translate3d(0, -7px, 0);
  }

  &:after {
    -webkit-transform: translate3d(0, 7px, 0);
    -moz-transform: translate3d(0, 7px, 0);
    transform: translate3d(0, 7px, 0);
  }

  &.active span {
    opacity: 0;
  }

  &.active:before {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    -moz-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
  }

  &.active:after {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    -moz-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
  }
}

.home2 {
  .mobile-button {
    right: 15px;
  }
}

.mobile-button {
  display: none;
  @include transition3;
  position: absolute;
  width: 26px;
  height: 26px;
  top: 50%;
  right: 0;
  background-color: transparent;
  cursor: pointer;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);

  &.style2 {
    &:before,
    &:after,
    span {
      background-color: $white;
    }
  }

  &:before,
  &:after,
  span {
    background-color: $color-3;
    -webkit-transition: all ease 0.3s;
    -moz-transition: all ease 0.3s;
    transition: all ease 0.3s;
  }

  &:before,
  &:after {
    content: "";
    position: absolute;
    top: 0;
    height: 3px;
    width: 100%;
    left: 0;
    top: 50%;
    -webkit-transform-origin: 50% 50%;
    -ms-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
  }

  span {
    position: absolute;
    width: 100%;
    height: 3px;
    left: 0;
    top: 50%;
    overflow: hidden;
    text-indent: 200%;
  }

  &:before {
    -webkit-transform: translate3d(0, -7px, 0);
    -moz-transform: translate3d(0, -7px, 0);
    transform: translate3d(0, -7px, 0);
  }

  &:after {
    -webkit-transform: translate3d(0, 7px, 0);
    -moz-transform: translate3d(0, 7px, 0);
    transform: translate3d(0, 7px, 0);
  }

  &.active span {
    opacity: 0;
  }

  &.active:before {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    -moz-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
  }

  &.active:after {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    -moz-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
  }
}

/* Sub Menu */
#main-nav .sub-menu {
  padding: 28px 40px;
  margin: 0 auto;
  @include flex(flex-start, flex-start);
  flex-wrap: wrap;

  > li {
    width: 25%;
  }

  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: 100%;
  max-height: 500px;
  overflow-y: auto;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-transform: translateY(15px);
  -moz-transform: translateY(15px);
  -ms-transform: translateY(15px);
  -o-transform: translateY(15px);
  transform: translateY(15px);
  background: $white;
  box-shadow: 0px 10px 25px 0px #2b344a1f;

  li {
    margin-right: 0 !important;

    a {
      padding: 10px 20px;
      opacity: 1;
    }

    &:hover .sub-menu {
      z-index: 9;
      opacity: 1;
      visibility: visible;
      -webkit-transform: translateY(0);
      -moz-transform: translateY(0);
      -ms-transform: translateY(0);
      -o-transform: translateY(0);
      transform: translateY(0);
    }
  }

  li {
    a {
      text-align: left;
      text-underline-offset: 10px;
      text-decoration-color: transparent;
      display: block;
      color: $color-3;
    }

    a:hover,
    a.current-item {
      color: $color-main;
      opacity: 1;
      text-decoration-line: underline;
      text-underline-offset: 6px;
      text-decoration-color: $color-main;
      text-decoration-thickness: 3px;
    }
  }
}

#main-nav .sub-menu li a:hover,
#main-nav .sub-menu li a.current-item {
  text-decoration-color: $color-main;
}
