// Header
.header {
  background-color: #333;

  .container,
  .container-fluid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
  }

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

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

.header-left,
.header-right {
  flex: 2;
}

.header-right {
 justify-content: flex-end;
}

.header-middle {
  padding-top: 2.05rem;
  padding-bottom: 2.05rem;

  .container,
  .container-fluid {
    position: relative;
  }
}

.logo {
  display: block;

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

.header-dropdown {
  position: relative;
  text-transform: uppercase;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .01rem;

  > a {
    color: #fff;
    position: relative;
    padding-right: 1.4rem;
    display: inline-flex;
    align-items: center;
    letter-spacing: .025rem;

    &:after {
      position: absolute;
      top: 50%;
      right: 0;
      content: '';
      margin-top: -2px;
      width: 0;
      height: 0;
      border-style: solid;
      border-width: 4px 3px 0 3px;
      border-color: #fff transparent transparent transparent;
    }
  }

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

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

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

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

  ul {
    margin: 0;
    padding: 0;
    list-style: none;

    li {
      margin: 0;
    }

    a {
      font-weight: 400;
      color: #696969;
      display: flex;
      align-items: center;
      padding: 2px 9px;
      white-space: nowrap;
    }
  }

  a {
    color: inherit;

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

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

.header-dropdowns {
  display: flex;
  align-items: center;
  margin-right: 3.5rem;
  z-index: 999;

  .header-dropdown {
    & + .header-dropdown,
    & + .dropdown {
      margin-left: 2rem;
    }
  }
}

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

  &:before,
  &:after {
    display: block;
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    content: '';
  }

  &:before {
    top: -9px;
    left: 15px;
    border-width: 0 10px 9px;
    border-color: transparent transparent #f0f0f0;
  }

  &:after {
    top: -7px;
    left: 16px;
    border-width: 0 9px 8px 9px;
    border-color: transparent transparent #fff;
  }
}

.cart-dropdown {
  .dropdown-toggle {
    text-decoration: none;
    display: block;
    position: relative;
    padding-right: 2.3rem;

    .cart-count {
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 1.6rem;
      height: 1.6rem;
      position: absolute;
      right: 1.4rem;
      line-height: 1;
      top: -.1rem;
      border-radius: 50%;
      font-size: 1rem;
      font-weight: 600;
      color: #fff;
      background-color: #ed7e63;
    }

    &:before {
      display: inline-block;
      content: '\e87f';
      font-family: 'porto';
      font-size: 2.3rem;
      line-height: 1;
      margin: 2px 0 0;
      color: #fff;
    }

    &:after {
      display: inline-block;
      content: '\e81c';
      font-family: 'porto';
      font-size: 1.4rem;
      position: absolute;
      right: 0;
      top: 1rem;
      width: auto;
      margin: 0;
      height: auto;
      color: #fff;
      margin: 0;
      border: 0;
      line-height: 0;
      transition: all .3s;
    }

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

  .dropdown-menu {
    display: block;
    right: 0;
    left: auto;
      top: 100%;
      width: 300px;
      padding-top: 9px;
      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;
    font-family: $font-family;

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

  .dropdownmenu-wrapper {
    padding: 1.6rem 1.9rem;
    
      &:before {
        left: auto;
      right: 23px;
      }

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

  .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;

    a:after {
      display: none !important;
    }
  }

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

  .product-details {
    font-weight: 400;
    font-size: 1.3rem;
    color: #696969;
    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);
    }
  }

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

.dropdown-cart-total {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: end;
  align-items: flex-end;
  margin-bottom: 1.1rem;
  padding: .7rem 1rem;
  color: #474747;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;

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

.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 {
    min-width: 110px;
    padding: 1.25rem 1rem;
    border-radius: 0;
    border-color: #141a1f;
    background-color: #141a1f;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: .025rem;
    text-transform: uppercase;

    &:hover,
    &:focus {
      border-color: #2e2e2e;
      background-color: #2e2e2e;
      color: #fff;
    }
  }
}

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

  .header-search-wrapper {
    display: none;
    align-items: stretch;
    overflow: visible;
    border: 5px solid #dbe0e2;
    border-radius: 0;
    position: relative;
    min-width: 250px;
    background-color: #fff;
    position: absolute;
    right: -80px;
    top: 100%;
    margin-top: .3rem;
    border-width: 5px;
    width: 450px;
    z-index: 102;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .075);
    @include clearfix;

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

    &.show {
        display: flex;
    }
  }

  form {
    margin: 0;
  }

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

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

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

  .form-control {
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    padding: 4px 22px;
    border: 0;
    border-radius: 20px 0 0 20px;
    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;
    }
  }

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

  .search-toggle {
    display: inline-block;
    font-size: 1.3rem;
    line-height: 1;
    min-width: 2.5rem;
    padding: 1rem 0;
    font-weight: 400;
    color: #fff;
    text-align: center;

    i {
      display: inline-block;
      margin-bottom: 2px;
    }
  }

  .btn {
    flex: 0 0 50px;
    min-width: 0;
    max-width: 50px;
    height: 38px;
    margin: 0;
    padding: 0 3px 0 0;
    border: 0;
    border-left: 1px solid #dbe0e2;
    border-radius: 0 20px 20px 0;
    background: transparent;
    background-color: transparent;
    color: #606669;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;

    i {
      margin-right: -3px;
      margin-top: -2px;
      &:before {
        margin: 0;
      }
    }

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

  }
}

.header-contact {
  position: relative;
  color: #fff;
  letter-spacing: 0;
  font-size: 1.6rem;
  line-height: 1.4;
  font-weight: 500;
  padding-right: 3rem;
  margin-right: 2.3rem;

  &:after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    display: block;
    width: 1px;
    height: 33px;
    margin-top: -16.5px;
    background-color: #d1deea;
    opacity: .5;
  }

  a {
    color: inherit;

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

.mobile-menu-toggler {
  border: 0;
  background: transparent;
  color: #fff;
  padding: .5rem .5rem;
  font-size: 2.1rem;
  line-height: 1;
  display: none;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin-right: 1.5rem;
  cursor: pointer;

  i {
    margin-top: -1px;
    &:before {
      margin: 0;
    }
  }
}

@include mq(sm) {
}

@include mq(md) {
}

@include mq(lg) {
}

@include mq(xxl) {
  .header-search {
    margin-right: 6rem;
  }

  .header-dropdowns {
    margin-right: 4.2rem;

    .header-dropdown {
      & + .header-dropdown,
      & + .dropdown {
        margin-left: 4rem;
      }
    }
  }

  .header-contact {
    padding-right: 3.6rem;
    margin-right: 2.9rem;
  }
}

@include mq(xl, max) {
  .header-contact {
    display: none;
  }
}

@include mq(lg, max) {
  .mobile-menu-toggler {
    display: flex;
    margin-right: 1.8rem;
  }

  .header-dropdowns {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
  }

  .header-search {
    margin-right: 1.5rem;
  }
}

@include mq(md, max) {
  .header-search  {
    margin-right: 1.5rem;
    .header-search-wrapper {
      width: 380px;
      right: -50px;

      &:before {
        right: 47px;
      }
    }

    .select-custom {
      flex: 0 0 132px;
    }

    .btn {
      flex: 0 0 40px;
    }
  }

  .header-dropdowns {
    display: none;
  }

  .mobile-menu-toggler {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }
}

@include mq(sm, max) {
  .header-dropdowns {
    .header-dropdown {
      & + .header-dropdown,
      & + .dropdown {
        margin-left: 1rem;
      }
    }
  }

  .mobile-menu-toggler {
    margin-right: 1rem;
  }
}

@include mq(xs, max) {
  .header-search {
    margin-right: 1rem;
    .header-search-wrapper {
      width: 320px;
    }
  }

  .logo {
    max-width: 90px;
  }

  .cart-dropdown{
     .dropdown-toggle {
       padding-right: 1.2rem;

       .cart-count {
         right: .4rem;
       }
     }

     .dropdownmenu-wrapper {
        &:before {
        right: 13px;
        }

        &:after {
        right: 14px;
        }
    }
  }
}

@media (max-width: 360px) {
  .header-search  {
    .header-search-wrapper {
      width: 240px;
    }

    .select-custom {
      display: none;
    }
  }

  .cart-dropdown {
    .dropdown-menu {
      width: 260px;
    }

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

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