// Menu
.main-nav {
  width: 100%;
  margin-left: -1rem;
}

.menu,
.menu * {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu {
  @include clearfix;

  li {
    position: relative;

    &.megamenu-container {
      position: static;
    }
  }

  > li {
    float: left;
  }

  ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99;

    ul {
      top: -1rem;
      left: 100%;
    }
  }

  .megamenu {
    display: none;
    position: absolute;
    top: auto;
    width: 900px;
    right: 1.5rem;
    left: 1.5rem;
    z-index: 999;

    &.megamenu-fixed-width {
      right: auto;
      left: 0;
      width: 640px;
    }
  }

  a {
    display: block;
    position: relative;
    text-decoration: none;
  }
}

.menu li:hover > ul,
.menu li.show > ul,
.menu li:hover > .megamenu,
.menu li.show > .megamenu  {
  display: block;
}

// Menu Skin
.menu {
  line-height: 1.8;
  li {
    padding-right: 1rem;
    padding-left: 1rem;

    a {
      display: block;
      padding: .7rem 1rem;
      transition: background .25s;
      color: #696969;
      font-size: 1.2rem;
      font-weight: 600;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .menu-title {
      margin-top: 1.25rem;
      margin-bottom: 0;
      color: #434d53;
      letter-spacing: -.01rem;
      text-transform: uppercase;
      font-weight: 700;
      font-family: $second-font-family;

      a {
        padding: .7rem 2rem;
        color: #434d53;
        font-size: 1.3rem;
        font-weight: 700;

        &:hover,
        &:focus {
          text-decoration: underline;
        }
      }
    }
  }

  > li {
    padding-right: 0;
    padding-left: 0;
    margin: 1.4rem 1.5rem 1rem 0;

    > a {
      font-weight: 700;
      font-size: 1.3rem;
      font-family: $font-family;
      background-color: transparent;
      color: black;
    }

    &.special-effect {
      > a {
        color: $primary-color;
      }
    }

    &.buy-effect {
      margin-right: -1rem;
    }
  }

  &.sf-arrows {
    > li {
      > a.sf-with-ul {
        padding-right: 2.8rem;
      }
    }

    .sf-with-ul {
      position: relative;

      &::after {
        display: inline-block;
        position: absolute;
        top: 50%;
        right: 1.5rem;
        margin-top: -1px;
        transform: translateY(-50%);
        font-family: 'porto';
        font-size: 1.3rem;
        line-height: 1;
        content: '\e81c';
      }
    }

    ul {
      .sf-with-ul {
        &::after {
          right: 1rem;
          content: '\e81a';
        }
      }
    }
  }

  .megamenu,
  ul {
    background-color: #fff;
    box-shadow: 0 29px 29px rgba(0, 0, 0, .1);
  }

  ul {
    min-width: 240px;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .megamenu {
    padding: 1rem;

    ul {
      display: block;
      position: static;
      top: auto;
      right: auto;
      bottom: auto;
      left: auto;
      min-width: 0;
      margin: 0 0 1.25rem;
      padding: 0;
      box-shadow: none;
    }

    .banner {
      width: 100%;
      height: 100%;
      margin-bottom: 0;
      background-color: transparent;

      a {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
      }

      img {
        position: absolute;
        height: 100%;
      }
      
      img.product-promo {
        padding: 1rem;
      }
    }
  }
}

.menu {
  li:hover,
  li.show,
  li.active {
    > a {
      background-color: #f4f4f4;
      color: #696969;
    }
  }

  > li:hover,
  > li.show,
  > li.active {
    > a {
      color: $primary-color;
      background-color: transparent;
    }
  }

  &.sf-arrows {
    > li.show {
      > a.sf-with-ul::before {
        opacity: 1;
        visibility: visible;
      }
    }
  }

  .show > ul,
  .show > .megamenu {
    opacity: 1 !important;
  }
}

.tip {
  color: #fff;
  position: relative;
  display: inline-block;
  font-size: 1rem;
  font-family: $font-family;
  font-weight: 400;
  padding: .3rem .4rem;
  z-index: 1;
  border-radius: .2rem;
  line-height: 1;
  margin: -2px 0 0 1rem;
  vertical-align: middle;
  text-transform: uppercase;

  &::before {
    position: absolute;
    top: 50%;
    right: 100%;
    left: auto;
    margin-top: -3px;
    border: 3px solid transparent;
    content: '';
  }

  &.tip-new {background-color: #0fc567;}

  &.tip-new::before {border-right-color: #0fc567;}

  &.tip-hot {background-color: #eb2771;}

  &.tip-hot::before {border-right-color: #eb2771;}
}

.menu > li > a {
  .tip {
    position: absolute;
    top: -4px;
    right: 22px;
    margin: 0;

    &::before {
      position: absolute;
      top: 100%;
      left: 3px;
      width: 3px;
      height: 3px;
      margin: 0;
      border-color: transparent;
    }

    &.tip-new::before {border-top-color: #0cc485;}

    &.tip-hot::before {border-top-color: #eb2771;}
  }
}