// Header
.header {
  .container-fluid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: none;
  }

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

  form {
    margin-bottom: 0;
  }
}

.home.header {
  border-bottom: 1px solid #eee;
}

form {
  background-color: white;
  border-radius: 4px;
}

.submit-wrapper {
  display: flex;

  .form-control {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-right: none;
    border-radius: 4px 0 0 4px;
    height: 35px;
    width: 192px;
    margin-bottom: 0;
    padding: 8px 13px;
    color: #747474;
    font: 600 1.1rem $font-family;
    letter-spacing: 0.003em;

    &:focus {
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-right: none;
    }
  }

  .btn {
    border-radius: 0 4px 4px 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-left: none;
    background-color:  white;
    height: 35px;
    min-width: unset;
    padding: 0 10px;
    font-size: 12px;
  }
}

.header-top, 
.header-bottom {
  display: flex;
  align-items: center;
}

.header-top { 
  background-color: $primary-color;

  .menu>li {
    >a {
      color: white;

      &:hover,
       {
        color: white;
        text-decoration: underline;
      }
    }

    &:active a,
    &.show a,
    &.active a,
    &:hover a,
    &:focus a {
      color: white;
    }
  }
}

.header-left {
  padding-top: 8px;
  padding-bottom: 8px;
}

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

.header-bottom {
  height: 125px;
  background-color: white;

  .main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .container {
    justify-content: center;
  }

  .menu {
    margin-right: 0;
  }

  .menu>li {
    >a {
      font-size: 14px;
      font-weight: 400;
      color: #111;
      padding: 10px 16px;

      &.sf-with-ul {
        padding-right: 30px;

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

      &:hover,
      &.active,
      &.show {
        background-color: white;
        color: $primary-color;
      }
    }

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

.logo {
  display: block;
  margin: 0 3.5rem;

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

.header-contacts {
  display: flex;
  align-items:  center;
  margin-right: 2rem;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.header-contact {
  margin-right: 1.8rem;
  color: #999;
  font: 400 12.6px $font-family;

  i {
    margin-right: .6rem;
    font-size: 1rem;
  }
}

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

  .search-toggle {
    display: inline-block;
    font-size: 1.3rem;
    line-height: 1;
    margin-left: -1rem;
    min-width: 2.5rem;
    padding: 1rem 0;
    font-weight: 700;
    color: $secondary-color;
    text-align: center;

    i {
      display: inline-block;
      color: #444;
      font-size: 12.6px;
      transition: none;
    }

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

  .submit-wrapper {
    display: flex;
  }
}

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

      &::after {
        content: '';
        width: 20px;
        height: 20px;
        background-color: white;
        border: none;
        transform: rotate(45deg);
        position: absolute;
        top: -9px;
        right: 40px;
      }
  }

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

  .dropdown-toggle {
    display: flex;
    align-items: center;
    position: relative;
    text-decoration: none;
    font: 400 1.4rem $second-font-family;
    text-transform: uppercase;
    letter-spacing: 0;
    color: white;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 0 8px 2rem;

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

    .cart-count {
      font-weight: 600;
      margin-right: 5px;
    }

    i {
      font-size: 24px;
      line-height: 35px;
    }

    .minicart-icon {
      width: 14px;
      height: 11px;
      border: 2px solid white;
      border-radius: 0 0 5px 5px;
      background-color: white;
      position: relative;
      opacity: .9;
      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: -7px;
      margin-left: -4px;
      width: 8px;
      height: 9px;
    }

    &::after {
      border: none;
    }
  }

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

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

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

    &::before {
      content :'';
    }

    &: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-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.6rem;
    color: #999999;
    font: normal 1.2rem 'Open Sans';

    &::after {
      display: inline-block;
      position: absolute;
      top: 50%;
      right: 0;
      transform: translateY(-50%);
      font-family: 'porto';
      font-size: 1.8rem;
      line-height: 1;
      content: '\e81c';
    }
  
  }

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

    &:hover,
    &:focus {
      text-decoration: 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);
}

.mobile-menu-toggler {
  border: 0;
  background: $primary-color;
  color: white;
  padding: 1rem 1rem;
  font-size: 2.5rem;
  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;
  border-radius: 4px;

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

@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('lg', 'max') {
  .header-bottom .main-nav,
  .header-top .main-nav {
    display: none;
  }

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

  .header-bottom {
    height: auto;

    .container { 
      justify-content: space-between;
      padding-top: 2rem;
      padding-bottom: 2rem;
    }
  }
}

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

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

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

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

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

@media (max-width: 600px) {
  .header-contacts:first-child {
    display: none;
  }
}

@media (max-width: 800px) {
  .header-search {
    width: 200px;
  }
}

@media (max-width: 400px) {
  .header-search {
    width: 150px;
  }

  .cart-dropdown .dropdown-toggle {
    border-left: none;
  }
}