// Menu
.main-nav {
  display: none;
  margin-right: 5.2rem;
}

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

.menu {
  @include clearfix;

  li {
    position: relative;

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

  > li {
    float: left;
  }

  ul,
  .megamenu {
    display: none;
    position: absolute;
    top: 100%;
    font-family: $font-family;
    z-index: 999;
  }

  ul {
    left: 0;

    ul {
      top: -1.1rem;
      left: 100%;
    }
  }
  .megamenu {
    left: 1.5rem;
    right: 1.5rem;

    &.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 {
  li {
    padding-right: 1rem;
    padding-left: 1rem;

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

    .menu-title {
      color: #161616;
      margin-bottom: 0;
      text-transform: uppercase;
      letter-spacing: -.01rem;
      margin-top: 1.25rem;

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

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

  > li {
    padding-right: 0;
    padding-left: 0;

    > a {
      font-size: 1.4rem;
      font-weight: 400;
      background-color: transparent;
      color: #161616;
      padding: 1.65rem .5rem;
      letter-spacing: .01rem;
    }

    & + li {
      margin-left: 2.1rem;
    }
  }

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

        &::before {
          content: '';
          position: absolute;
          display: block;
          z-index: 100;
          width: 12px;
          height: 12px;
          background-color: #fff;
          border-top: 1px solid #efeeee;
          border-left: 1px solid #efeeee;
          left: 50%;
          bottom: 0;
          margin-bottom: -6px;
          margin-left: -6px;
          transform: rotate(45deg);
          opacity: 0;
          visibility: hidden;
          }
      }
    }

    .sf-with-ul {
      position: relative;

      &::after {
        display: inline-block;
        position: absolute;
        top: 50%;
        right: 0;
        margin-top: -1px;
        -webkit-transform: translateY(-50%);
        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;
    border: 1px solid #efeeee;
    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;
      border: 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 {
      background-color: transparent;
      color: $primary-color;
    }
  }

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

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

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

  &::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;}
  }
}

@include mq('lg') {
  .main-nav {
    display: block;
  }
}