/*------------------------------------------------------------
PRODUCTS
====================================*/

.product-box-container {
  display: flex;
  position: relative;
  flex-direction: column;
  flex: 1;
  margin-bottom: $product-box-margin-bottom;
  border-bottom: $product-box-border-width solid $product-box-border-color;
  transition: 0.3s;
  img {
    max-height: 100%;
    width: auto;
  }
  &:hover {
    border-bottom-color: $product-box-border-color-hover;
    .product-box-image-wrapper {
      img {
        transform: scale(1.1);
      }
      .img-hover {
        opacity: 1;
      }
      picture + picture {
        opacity: 1;
      }
    }
  }

  &.horizontal {
    .product-box-image-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
      }
    }
  }
}

.product-box-tag {
  position: absolute;
  top: 1.5rem;
  z-index: 1;
  .badge {
    float: left;
    clear: left;
    margin-bottom: 0.2rem;
  }
}

.product-box-image-wrapper {
  display: block;
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  img {
    transition: 0.3s;
  }
  picture {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: $white;
    transition: 0.3s;
  }
  picture + picture {
    z-index: 1;
    opacity: 0;
  }
  .img-hover {
    display: block;
    opacity: 0;
  }
  &.disabled {
    opacity: 0.5;
  }
}

.product-box-text-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem;
}
.product-box-name {
  display: flex;
  flex-direction: column-reverse;
  margin-bottom: 0.5rem;
  text-decoration: none;
}
.product-box-complementary-name {
  font-family: $product-brand-font-family;
  font-weight: $product-brand-font-weight;
  font-size: $product-brand-font-size-mobile;
  text-transform: uppercase;
  color: $body-color;
  line-height: $headings-line-height;
  margin-bottom: $headings-margin-bottom;
}
.product-box-title {
  font-family: $product-title-font-family;
  font-weight: $product-title-font-weight;
  font-size: $product-title-font-size-mobile;
}

.product-box-review {
  display: none;
}

.product-box-price-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* RESPONSIVE */
/***************************************/
@include media-breakpoint-up(lg) {
  .product-box-tag {
    top: 2rem;
  }

  .product-box-text-wrapper {
    padding: 2rem 1rem;
  }
  .product-box-name {
    margin-bottom: 2.5rem;
  }
  .product-box-complementary-name {
    font-size: $product-brand-font-size-desktop;
  }
  .product-box-title {
    font-size: $product-title-font-size-desktop;
  }

  .product-box-review {
    display: flex;
    margin-top: auto;
    text-decoration: none;
  }
  .product-box-review-nb {
    margin-left: 0.9rem;
    color: $product-box-review-nb-color;
  }


  .product-box-review + .product-box-price-wrapper {
    margin-top: 0;
  }
  .product-box-price-wrapper {
    display: block;
  }

  .product-box-container.horizontal {
    flex-direction: row;
    padding-bottom: 2rem;
    width: 100%;
    .product-box-tag {
      top: 1rem;
    }
    .product-box-image-wrapper {
      width: 10rem;
      padding: 0;
      margin-right: 1rem;
    }
    .product-box-text-wrapper {
      padding: 0;
    }
  }
}
