// Header
.header {
  position: relative;
  height: 120px;
  font-family: $second-font-family;

  .container,
  .container-fluid {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: space-between;
  }

  &.header-transparent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1040;
  }

  .btn-remove {
    &::before {
      display: none;
    }
  }

  .menu>li {
    padding: 0;
    margin-right: 4rem;
    position: relative;

    .megamenu {
      left: 0;
      width: max-content;
      border-top: none;

      img {
        height: 100%;
        object-fit: cover;
      }

      >.row.row-sm {
        padding-left: 0;

        [class*='col-']:not(:last-child) {
          padding: 1rem;
        }
      }
    }

    >a {
      color: black;
      font: 700 12px $font-family;
      padding: 2rem 0;
      transition: none;

      &.sf-with-ul {
        padding-right: 2rem;
        margin-right: -2rem;

        &::after {
          font-size: 14px;
          right: 5px;
        }
      }
    }

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

  .menu {
    margin-right: 0;

    .megamenu {
      width: 800px;
      top: 100%;
    }

    &.sf-arrows ul {
      border-top: none;
    }

    .menu-item {
      background-color: $primary-color;
      cursor: pointer;

      >a {
        color: white;

        i {
          font-size: 1.6rem;
          margin-right: 5px;
        }
      }

      &:hover>a {
        color: white;
        background-color: $primary-color;
      }
    }
  }
}

.header-left,
.header-center,
.header-right {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
}

.header-right {
  margin-left: auto;
}

.header-middle {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}


.header-user {
  display: flex;
  align-items: center;
  margin-right: 10px;
  margin-bottom: 2px;
  cursor: pointer;

  i {
    font-size: 20px;
    color: black;
  }

  &:hover i {
    color: $primary-color;
  }
}

.porto-icon {
  font-size: 22px;
  margin-right: 10px;
  margin-bottom: 2px;
  color: black;
}

.logo {
  display: block;
  margin-right: 6rem;

  img {
    display: block;
    max-width: none;
    height: auto;
    width: auto;
  }
}

.header-dropdowns {
  display: flex;
  align-items: center;
}

.header-dropdown {
  position: relative;
  text-transform: uppercase;
  font-family: $font-family;
  margin: 0 2rem;

  &:last-child {
    margin-right: 0;
  }

  > a {
    display: -ms-inline-flexbox;
    display: inline-flex;
    position: relative;
    -ms-flex-align: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
    cursor: default;

    &::after {
      margin-left: 5px;
      font-family: 'porto';
      font-size: 1.2rem;
      line-height: 1;
      content: '\e81c';
    }
  
    &:hover {
      color: $primary-color;
    }
  }

  a {
    img {
      display: inline-block;
      max-width: 16px;
      height: auto;
      margin-right: .6rem;
    }

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

.header-menu {
  position: absolute;
  top: 140%;
  left: 0;
  min-width: 100%;
  padding-top: .4rem;
  padding-bottom: .4rem;
  transition: all .25s;
  border: 1px solid #ccc;
  background-color: #fff;
  box-shadow: 0 0 2px rgba(0, 0, 0, .1);
  opacity: 0;
  visibility: hidden;
  z-index: 20;

  .header-dropdown:hover > & {
    opacity: 1;
    visibility: visible;
  }

  ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;

    li {
      position: relative;
      margin: 0;
    }

    a {
      display: -ms-flexbox;
      display: flex;
      -ms-flex-align: center;
      align-items: center;
      padding: 2px 9px;
      white-space: nowrap;
    }
  }

  a {
    color: $primary-color-dark;
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: 0;

    &:hover,
    &:focus {
      background-color: #ccc;
      color: #fff;
    }
  }
}

.header {
  .btn-remove {
    &::before {
      display: none;
    }
  }
}

.dropdownmenu-wrapper {
  position: relative;
    background-color: #fff;
    padding: 2rem;
    border-radius: 0;
    border: 1px solid #f0f0f0;
    box-shadow: 0 29px 28px rgba(0, 0, 0, 0.1);
}

.cart-dropdown,
.compare-dropdown {
  .dropdown-menu {
    display: block;
      left: 0;
      top: 100%;
      width: 300px;
      padding-top:10px;
      z-index: 100;
      font-size: 1.1rem;
      color: #777;
      border: 0;
      margin: 0;
      background-color: transparent;
      box-shadow: none;
      visibility: hidden;
      opacity: 0;
      transition: all .25s;

      &.show {
        opacity: 1;
        visibility: visible;
      }
  }

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

.compare-dropdown,
.cart-dropdown {
  .dropdown-toggle {
    text-decoration: none;

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

.compare-dropdown {
  .dropdown-toggle {
    text-transform: uppercase;

    i {
      margin-top: -.2rem;
      margin-right: .2rem;

      &::before {
        margin: 0;
      }
    }

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

.compare-products {
  margin: 0;
  padding: 0;
  list-style: none;

  .product {
    position: relative;
    margin: 0;
    padding: .5rem 0;
    box-shadow: none !important;

    &:hover {
      box-shadow: none;
    }
  }

  .product-title {
    margin: 0;
    color: #696969;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .btn-remove {
    display: -ms-flexbox;
    display: flex;
    position: absolute;
    top: 50%;
    right: 0;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    margin-top: -1.2rem;
    padding: .5rem 0;
    color: #777;
    font-size: 1.3rem;
    line-height: 1;
    text-align: center;
    overflow: hidden;
  }
}

.compare-actions {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  margin-top: 2rem;

  .action-link {
    display: inline-block;
    color: #777;
    font-size: 1.1rem;
    text-transform: uppercase;
  }

  .btn {
    min-width: 110px;
    margin-left: auto;
    padding: .9rem 1rem;
    border: 0;
    border-radius: .2rem;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: .025rem;
    text-align: center;
    text-transform: uppercase;
  }
}

.minicart-icon {
  width: 23px;
  height: 20px;
  border: 2px solid #222529;
  border-radius: 0 0 5px 5px;
  position: relative;
  opacity: .9;
  top: 1.2rem;
  display: block;
}

.minicart-icon::before {
  content: '';
  position: absolute;
  border: 2px solid;
  border-color: inherit;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  left: 50%;
  top: -8px;
  margin-left: -7.5px;
  width: 15px;
  height: 11px;
}

.cart-dropdown {
  font-family: $font-family;

  .dropdown-toggle {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 4px;

    i {
      font-size: 22px;
    }

    .cart-count {
      font: 600 1.1rem $font-family;
      letter-spacing: 0.01em;
      margin-left: -2px;
    }

    &::after {
      border: none;
    }
  }

  .dropdown-menu {
    right: 0;
    left: auto;
    padding-top: 8px;
  }

  .dropdownmenu-wrapper {
    padding: 1.6rem 1.9rem;

    &::before {
      right: 28px;
      left: auto;
    }

    &::after {
      right: 29px;
      left: auto;
    }
  }

  .product {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    margin: 0 !important;
    padding: 1.6rem 1rem;
    border-bottom: 1px solid #e6ebee;
    box-shadow: none !important;
  }

  .product-image-container {
    position: relative;
    max-width: 80px;
    margin: 0;
    margin-left: auto;
    border: 1px solid #ededed;

    img {
      object-fit: none;
    }

    a::after {
      display: none;
    }
  }

  .product-title {
    margin-bottom: .2rem;
    color: #696969;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: left;
  }

  .product-details {
    color: #696969;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: left;
  }

  .btn-remove {
    display: flex;
    position: absolute;
    top: -1rem;
    right: -1rem;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #fff;
    color: #474747;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);

    &:hover,
    &:focus {
      color: $primary-color;
      box-shadow: 0 3px 7px rgba(0, 0, 0, .3);
    }
  }
}

.dropdown-cart-header,
.dropdown-cart-total {
  padding: .7rem 1rem;
  display: flex;
  align-items: flex-end;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #474747;
}

.dropdown-cart-total {
  margin-bottom: 1.1rem;

  .cart-total-price {
    margin-left: auto;
    font-size: 1.5rem;
  }
}

.dropdown-cart-header {
  border-bottom: 1px solid #e6ebee;
  margin-bottom: 0;
  padding-top: 0;
  
  a {
    color: inherit;
    margin-left: auto;
    font-size: 1.2rem;
  }
}

.dropdown-cart-action {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: .2rem 1rem 1.5rem;

  .btn {
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: .05rem;
    text-transform: uppercase;
    color: #fff;
    border-color:$secondary-color;
    background-color: $secondary-color;
    border-radius: .2rem;
    min-width: 110px;
    padding: 1.25rem 1rem;
    font-family: $font-family;

    &:hover,
    &:focus {
      color: #fff;
      border-color: lighten($secondary-color, 5%);
      background-color: lighten($secondary-color, 5%);
    }
  }
}

// Header Search
.header-search {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0;
  line-height: 1;
  margin-right: 10px;

  .header-search-wrapper {
    position: absolute;
    right: 1100%;
    align-items: center;
    overflow: visible;
    border: none;
    width: 100%;
    z-index: 999;
    display: none;
    @include clearfix;

    &.show {
      display: flex;
    }

    &::before {
      display: none;
      position: absolute;
      top: -20px;
      right: -280px;
      width: 20px;
      height: 20px;
      border: 10px solid transparent;
      border-bottom-color: #dbe0e2;
      content: '';
    }
  }

  form {
    margin: 0;
  }

  .select-custom {
    flex: 0 0 152px;
    margin: 0;

    &::after {
      right: 1.8rem;
      color: #8d8d8d;
      font-size: 1.4rem;
    }
  }

  .form-control,
  select {
    height: 50px;
    font: 400 1.3rem/1.5 $font-family;
    background-color: #f4f4f4;
    margin: 0;
    border: none;
  }

  .form-control {
    font-size: 1.4rem;
    flex: 1 1 auto;
    width: 320px;
    height: 50px;
    margin: 0;
    padding: 4px 22px;
    border-right: none;
    border-radius: 30px 0 0 30px;
    color: #8d8d8d;
    line-height: 20px;
    box-shadow: none;

    &::-webkit-input-placeholder {
      color: #8d8d8d;
    }

    &::-moz-placeholder {
      color: #8d8d8d;
    }

    &:-ms-input-placeholder {
      color: #8d8d8d;
    }

    &::-ms-input-placeholder {
      color: #8d8d8d;
    }

    &::placeholder {
      color: #8d8d8d;
    }

    &:focus {
      border-color: #e7e7e7;
      background-color: #f4f4f4;
    }
  }

  select {
    width: 100%;
    border-left: 1px solid #e7e7e7;
    line-height: 36px;
    color: #8d8d8d;
    padding: 1px 20px 1px 15px;
    padding-left: 25px;
    border-radius: 0;
    -moz-appearance: none;
    -webkit-appearance: none;

    &:focus {
      outline: none;
    }
  }

  .btn {
    flex: 0 0 65px;
    height: 50px;
    min-width: 0;
    color: white;
    font-weight: 400;
    font-size: 2.4rem;
    line-height: 1;
    border: none;
    border-left: 2px solid #e7e7e7;
    padding: 0 3px 0 0;
    margin: 0;
    cursor: pointer;
    border-radius: 0 30px 30px 0;
    background-color: $primary-color-dark;

    i {
      &::before {
        margin: 0;
      }
    }

    &:hover,
    &:focus {
      color: $primary-color;
    }

  }

  .search-toggle {
    display: inline-block;
    line-height: 1;
    min-width: 2.5rem;
    padding: 1rem 0;
    font-weight: 700;
    color: black;
    text-align: center;

    i {
      display: inline-block;
      font-size: 20px;
      transition: none;
    }

    &:hover,
    &:hover i {
      color: $primary-color;
    }
  }
}

.header-contact {
  color: #777;
  letter-spacing: 0.01em;
  font-size: 1.2rem;
  font-weight: 500;
  margin-right: 2rem;

  span {
    display: block;
    font-size: 1.1rem;
    text-transform: uppercase;
  }

  &.phone {
    margin-right: 5rem;

    a {
      color: $primary-color;
      font-weight: 700;
      font-size: 1.8rem;

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

.header-bottom {
  background-color: transparent;
  margin-left: 3.125%;
  z-index: 2;
  position: relative;
  width: fit-content;

  .menu>li {
    padding: 0;
    margin: 0;
    position: relative;

    >a {
      color: $primary-color-dark;
      font: 600 14px $second-font-family;
      letter-spacing: 0.005em;
      padding: 0 0 1.5rem;
      transition: none;
      text-transform: none;

      &.sf-with-ul {
        &::after {
          font-size: 14px;
          right: 5px;
          bottom: 1.5rem;
          top: unset;
          transform: none;
          content: '\e81a';
        }
      }
    }

    &:not(:last-child) {
      border-bottom: 1px solid rgba($primary-color-dark, 0.07);
      margin-bottom: 1.5rem;
    }

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

  .menu {
    &.sf-arrows ul {
      top: -1.5rem;
      left: 100%;
    }

    margin-right: 0;
    display: flex;
    flex-direction: column;
    width: 250px;

    .megamenu {
      left: 100%;
      width: 800px;
      top: -1.5rem;
    }

    .menu-item {
      background-color: $primary-color;
      cursor: pointer;

      >a {
        color: white;

        i {
          font-size: 1.6rem;
          margin-right: 5px;
        }
      }

      &:hover>a {
        color: white;
        background-color: $primary-color;
      }
    }
  }
}

.mobile-menu-toggler {
  border: 0;
  background: transparent;
  color: $primary-color-dark;
  padding: 1rem .5rem;
  font-size: 3rem;
  line-height: 1;
  display: none;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin-right: 2rem;
  cursor: pointer;

  i {
    &::before {
      margin: 0;
    }
  }
}

@media (max-width: 991px) {
  .mobile-menu-toggler {
    display: flex;
  }

  .header-middle .main-nav {
    display: none;
  }
}

@include mq('lg') {
  .dropdown-expanded {
    > a {
      display: none;
    }

    .header-menu {
      position: static;
      top: auto;
      right: auto;
      left: auto;
      padding: 0;
      border: 0;
      background-color: transparent;
      box-shadow: none;
      opacity: 1;
      visibility: visible;

      ul {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-align: center;
        align-items: center;

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

        li + li::before {
          position: absolute;
          top: 50%;
          left: -14px;
          height: 11px;
          margin-top: -5.5px;
          border-right: 1px solid;
          content: '';
          opacity: .8;
        }

        a {
          padding: 0;
        }
      }

      a {
        color: inherit;

        &:hover,
        &:focus {
          background-color: transparent;
          color: #999;
          text-decoration: underline;
        }
      }
    }
  }
}

@include mq('md', 'max') {
  .cart-dropdown {
    .dropdown-toggle {

      &::before {
        font-size: 2.3rem;
      }
    }
  }
}

@include mq('sm', 'max') {
  .header-middle .logo {
    margin-right: 2rem;
  }

  header .header-search .header-search-wrapper {
    width: 240px;
    left: -700%;
    right: unset;

    &::before {
      right: 40px;
    }

    .select-custom {
      display: none;
    }
  }

  .compare-dropdown {
    display: none;
  }
}

@media (max-width: 480px) {
  .cart-dropdown,
  .compare-dropdown {
    .dropdown-menu {
      width: 260px;
    }

    .dropdownmenu-wrapper {
      padding: 1rem 1.4rem;
    }
  }

  .dropdown-cart-action .btn {
    min-width: 100px;
  }
}
