// Menu
.main-nav {
  width: 100%;
  background-color: $primary-color;
}

.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: 100%;
    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 {
  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;

      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;

    > a {
      font-weight: 700;
      background-color: transparent;
      color: #fff;
      padding: 1.15rem 2.25rem;
      letter-spacing: .01rem;
    }
  }

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

        &::before {
          position: absolute;
          bottom: 0;
          left: 50%;
          width: 0;
          height: 0;
          margin-left: -10px;
          border-width: 0 10px 7px;
          border-style: solid;
          border-color: transparent transparent #fff;
          content: '';
          opacity: 0;
          visibility: hidden;
        }
      }
    }

    .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: #fff;
      background-color: $primary-color-2;
    }
  }

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