// Header
.header {
  border-top: .3rem solid $primary-color;
  border-bottom: .1rem solid #f3f3f3;
  background-color: #fff;

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

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

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

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

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

.header-top {
  font-size: 1.1rem;
  line-height: 1.5;
  letter-spacing: .025rem;
  color: #999;
  border-bottom: 2px solid #e7e7e7;
  padding-top: .4rem;
  padding-bottom: .4rem;

  a {
    padding-top: .5rem;
    padding-bottom: .5rem;
    color: inherit;
  }
}

.welcome-msg {
  display: none;
  position: relative;
  margin: .3rem 2rem .3rem 0;
  text-transform: uppercase;

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

.header-middle {
  padding-top: 3rem;
  padding-bottom: 1.9rem;

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

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

.logo {
  display: block;

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

.header-dropdown {
  position: relative;
  text-transform: uppercase;

  > a {
    display: -ms-inline-flexbox;
    display: inline-flex;
    position: relative;
    -ms-flex-align: center;
    align-items: center;
    padding-right: 1.1rem;

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

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

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

.header-menu {
  position: absolute;
  top: 100%;
  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-right & {
    right: 0;
    left: auto;
  }

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

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

    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: inherit;

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

.header-dropdowns {
  .header-dropdown {
    & + .header-dropdown,
    & + .dropdown {
      margin-left: 20px;

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

.dropdownmenu-wrapper {
  position: relative;
    background-color: #fff;
    padding: 2rem;
    border-radius: 0;
    border: 1px solid #f0f0f0;
    border-top-width: 2px;
    border-top-color: $primary-color;
    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: 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;

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

.cart-dropdown {
  .dropdown-toggle {
    display: block;
    position: relative;
    padding-right: 2.4rem;

    .cart-count {
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 1.6rem;
      height: 1.6rem;
      position: absolute;
      right: 1.9rem;
      line-height: 1;
      top: -.2rem;
      border-radius: 50%;
      padding-bottom: 2px;
      font-size: 1rem;
      font-weight: 600;
      color: #fff;
      background-color: #fa4a4a;
      box-shadow: 0 7px 8px rgba(0,0,0, .05);
    }

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

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

  .dropdown-menu {
    right: 0;
    left: auto;
  }

  .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;
    box-shadow: none !important;

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

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

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

  .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: 0.025rem;
    text-transform: uppercase;
    color: #fff;
    border-color: #000;
    background-color: #000;
    border-radius: .2rem;
    min-width: 110px;
    padding: 1.25rem 1rem;

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

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

  .header-search-wrapper {
    display: none;
    align-items: stretch;
    overflow: visible;
    border: 1px solid #eee;
    border-radius: 20px;
    position: relative;
    width: 100%;
    min-width: 250px;
    background-color: #fff;
    @include clearfix;

    &.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;
    font: 400 1.3rem/1.5 $font-family;
    background-color: #eeeeee;
    margin: 0;
  }

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

    &:focus {
      background-color: #eeeeee;
    }

    &::-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%;
    border: 0;
    border-left: 2px solid #fff;
    line-height: 36px;
    color: #8d8d8d;
    padding: 1px 20px 1px 15px;
    padding-left: 10px;
    border-radius: 0;
    -moz-appearance: none;
    -webkit-appearance: none;
  }

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

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

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

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

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

  }
}

.header-contact {
  position: relative;
  color: #333333;
  letter-spacing: 0;
  font-size: 1.8rem;
  line-height: 1.4;
  padding-right: 2.6rem;
  margin-right: 3.2rem;

  &::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    display: block;
    width: 2px;
    height: 43px;
    margin-top: -21.5px;
    background-color: #efefef;
  }

  span {
    display: block;
    color: #787d7f;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
  }

  a {
    color: inherit;

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

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

  .logo,
  .cart-dropdown {
    display: none;
  }

  .logo {
    margin-right: 2.5rem;

    img {
      width: auto;
      max-height: 32px;
    }
  }

  .cart-dropdown {
    order: 2;
    margin-left: auto;

    .dropdown-toggle {
      padding-right: 1.6rem;

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

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

    .dropdownmenu-wrapper::before {
      right: 15px;
    }

    .dropdownmenu-wrapper::after {
      right: 16px;
    }
  }
}

.mobile-menu-toggler {
  border: 0;
  background: transparent;
  color: #333333;
  padding: 1rem .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 {
    &::before {
      margin: 0;
    }
  }
}

@include mq('sm') {
  .welcome-msg  {
    display: block;
  }
}

@include mq('md') {
  .welcome-msg  {
    margin-right: 3rem;
  }
}

@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;
        }
      }
    }
  }

  .header-search {
    .search-toggle {
      display: none;
    }

    form {
        width: 360px;
    }

    .header-search-wrapper {
      display: flex;
    }
  }
}
@include mq('xl') {
  .header-search {
    form {
      width: 450px;
    }
  }
}

@include mq('lg', 'max') {
  .header-search {
    margin-left: 5px;

    .header-search-wrapper {
      position: absolute;
      left: -45px;
      top: 100%;
      margin-top: .3rem;
      border-width: 5px;
      width: 450px;
      border-radius: 24px;
      z-index: 99;
      border-color: #dbe0e2;
      box-shadow: 0 4px 12px rgba(0, 0, 0, .075);

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

  .cart-dropdown {
    .dropdown-toggle::before {
      font-size: 2.6rem;
    }
  }

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

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

  .header-contact {
    padding-right: 1.8rem;
    margin-right: 2.4rem;
  }

  .header-bottom {
    display: none;
  }

  .mobile-menu-toggler {
    display: flex;
  }
}

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

  .header-search  {
    .header-search-wrapper {
      width: 380px;
    }

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

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

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

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

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

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

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

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

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

  .compare-dropdown {
    display: none;
  }
}

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

    .select-custom {
      display: none;
    }
  }

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

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

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