/*------------------------------------------------------------
HEADER
====================================*/

/* Variables Custom */
$header-top-height: 3.8rem !default;
$header-top-font-size: 1.3rem !default;

$header-height-mobile: 5rem !default;
$header-height-desktop: 10rem !default;

$header-bg: $white !default;
$header-box-shadow-mobile: 0 0.3rem 0.6rem rgba($black, 0.3) !default;
$header-box-shadow-desktop: none !default;

$header-link-font-size: 1.2rem !default;
$header-link-font-weight: $font-weight-normal !default;

$cart-bullet-width: 1.56rem !default;
$cart-bullet-height: 1.56rem !default;
$cart-bullet-font-size: 1rem !default;
$cart-bullet-font-weight: $font-weight-bold !default;
$cart-bullet-color: $white !default;
$cart-bullet-bg: $primary !default;

$header-simple-height-desktop: 8rem !default;
$simple-header-color: $black !default;
$simple-header-phone-number-color: $primary !default;

/***************************************/

.header-desktop {
  display: none;
}

.header-container {
  position: relative;
  z-index: 11;
  background: $header-bg;
}

// Structure
.header-content {
  & > .container > .row {
    display: flex;
    height: $header-height-mobile;
  }
}

// Logo
.header-logo-wrapper {
  align-self: center;
}

// Links
.header-links-wrapper {
  display: flex;
  align-self: center;
}

.header-link {
  align-self: center;
  text-align: center;
  text-decoration: none;
  font-size: $header-link-font-size;
  font-weight: $header-link-font-weight;
  border: none;
  background: none;

  svg {
    width: auto;
    height: 2.6rem;
  }
}
.header-link-search {
  svg {
    height: 2.3rem;
  }
}

.icon-cart-wrapper {
  display: inline-block;
  position: relative;

  .bullet {
    position: absolute;
    right: -0.6rem;
    top: -0.3rem;
    width: $cart-bullet-width;
    height: $cart-bullet-height;
    font-weight: $cart-bullet-font-weight;
    font-size: $cart-bullet-font-size;
    color: $cart-bullet-color;
    background: $cart-bullet-bg;
    border-radius: 100%;
  }
}

// Rollover
.rollover-container {
  display: none;
}

// header simple
.simple-header-container {

  .header-contact-wrapper {
    align-self: center;
  }

  .contact-block {
    margin: 0;
    line-height: 1.4;
    font-size: 1.2rem;
  }

  .number-phone {
    font-weight: $font-weight-bold;
    color: $simple-header-phone-number-color;
    font-size: 1.4rem;
  }
}

// Recherche
.autocomplete-results {
  padding: 2rem 1.5rem 0;
  margin-top: 0;
  border-top: 0;
}

/* RESPONSIVE */
/***************************************/
@include media-breakpoint-down(md) {
  .header-container {
    margin-bottom: 2rem;
  }
  .header-content {
    box-shadow: $header-box-shadow-mobile;
  }

  // Logo
  .header-logo img {
    width: auto;
    height: $header-height-mobile;
  }

  // Links
  .header-links-wrapper {
    padding-left: 0;
  }
  .header-link {
    width: 5rem;
  }

  // Recherche mobile
  .header-search-wrapper {
    position: absolute;
    z-index: -1;
    padding: 0;
    top: 0;
    left: 0;
    right: 0;
    transition: 0.3s;

    &:before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      z-index: 4;
      height: $header-height-mobile;
      background: $header-bg;
    }

    &.active {
      padding-top: $header-height-mobile;
    }
  }

  // header simple
  .header-contact-wrapper {
    padding-left: 0;
  }
}

@include media-breakpoint-up(lg) {
  .header-desktop {
    display: block;
  }
  .header-mobile {
    display: none;
  }

  // Structure
  .header-content {
    & > .container > .row {
      align-items: center;
      height: $header-height-desktop;
    }
  }

  // Top bar
  .header-top {
    display: block;
    font-size: $header-top-font-size;
    color: $white;
    background: $dark;

    & > .container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: $header-top-height;
    }

    p {
      margin: 0;
    }

    ul {
      display: flex;
      list-style: none;
      margin: 0;
    }

    li {
      & + li {
        &:before {
          content: '|';
          margin: 0 0.8rem;
        }
      }
    }

    a {
      font-weight: $font-weight-normal;
      text-decoration: none;
      color: $white;

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

  // Links
  .header-links-wrapper {
    justify-content: flex-end;
  }
  .header-link {
    color: $dark;

    & + .header-link {
      margin-left: 3.5rem;
    }
  }
  .header-link-text {
    height: 1.6rem;
    margin-top: 0.7rem;
    text-align: center;
    line-height: 1.1;
  }
  .header-link-search {
    svg {
      height: 2.6rem;
    }
  }

  // Rollover
  .rollover-container {
    position: absolute;
    z-index: 1;
    right: 0;
    padding-top: 2rem;
  }
  .header-link:hover > .rollover-container {
    display: block;
  }
  .rollover-wrapper {
    min-width: 27.2rem;
    padding: 1.5rem;
    text-align: left;
    background: $white;
    border: 0.1rem solid $gray-300;
    .item {
      display: flex;
      justify-content: space-between;
      margin-top: 1rem;
      line-height: 1.1;
    }
    .item-price-wrapper{
      display: flex;
      justify-content: space-between;
      width: 40%;
      margin-left: 1rem;
      flex-shrink: 0;
    }
    .item-qty {
      margin-right: 1rem;
    }
    .item-options {
      margin-top: 0.3rem;
    }
    .total {
      padding-top: 1rem;
      margin-bottom: 2rem;
      border-top: 0.2rem solid $gray-300;
    }
    .btn-wrapper {
      .btn {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        & + .btn {
          margin-top: 2rem;
        }
      }
    }
  }
  .rollover-items {
    min-width: 32rem;
    .items {
      max-height: 15rem;
    }
    .simplebar-content-wrapper {
      padding-right: 0;
    }
    .simplebar-content-wrapper[style*=scroll] {
      padding-right: 1.8rem;
    }
    .item-price-wrapper {
      text-align: right;
      .product-price-old, .price {
        display: block;
      }
      .product-price-old, .price, .product-price span {
        font-size: 1.2rem;
        font-weight: $font-weight-normal;
      }
    }
  }

  // header simple
  .header-account-wrapper {
    font-size: 1.3rem;
    font-weight: $font-weight-bold;
    color: $simple-header-color;
    display: block;
  }

  // header simple
  .simple-header-container {
    margin-bottom: 5rem;
    border-bottom: 0.1rem solid $gray-200;
    .header-content {
      & > .container > .row {
        height: $header-simple-height-desktop;
      }
    }
    .contact-block {
      font-size: 1.6rem;
    }

    .number-phone {
      font-size: 1.8rem;
      font-weight: $font-weight-bold;
      color: $simple-header-phone-number-color;
    }
  }
}
