/*
  @project: monepi/administrateur
  @create: 2 Nov 2020
  @description: Product Stylesheet
*/

/* ----------------------------------------------------------------------------- == SUMMARY */
/*
  1. Product
    1.a new
    1.1. Product-description
      1.1.1. Product-description-content
        1.1.1.a. is-hidden
        1.1.1.1. Product-description-tooltip
        1.1.1.2. Product-description-name
        1.1.1.3. Product-description-text
        1.1.1.4. Product-description-inline
    1.2. Product-metadata
      1.2.1. Product-illustration
      1.2.2. Product-label
        1.2.2.1. Product-name
        1.2.2.2. Product-packaging
        1.2.2.3. Product-loose
      1.2.3. Product-metadataEntry
        1.2.3.a supplier
        1.2.3.1. Product-metadataEntryIcon
        1.2.3.2. Product-metadataEntryContent
    1.5. Product-footer
      1.5.1. Product-stock
      1.5.2. Product-prices
        1.5.2.1. Product-unitaryPrice
        1.5.2.2. Product-quantityPrice
      1.5.3. Product-CTA
        1.5.3.a. disabled
        1.5.3.b. blue
        1.5.3.1. Product-CTALabel
        1.5.3.2. Product-CTAWidget
          1.5.3.2.1. Product-CTAWidgetButton
          1.5.3.2.2. Product-CTAWidgetLabel
      
*/

/* ----------------------------------------------------------------------------- == Product */
.Product {
  align-items: center;
  background-color: var(--white);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  overflow: hidden;
  padding: 35px 10px 10px 10px;
  position: relative;
}

.Product.new:before {
  background-color: var(--red-500);
  border-radius: 0 0 6px 6px;
  color: var(--white);
  content: "Nouveauté";
  font-weight: bold;
  left: 0;
  padding: 2px 9px;
  position: absolute;
  text-transform: uppercase;
  top: 80px;
  transform: rotate(-90deg) translateX(-100%);
  transform-origin: top left;
  z-index: 1;
}

/* ----------------------------------------------------------------------------- == Product-description */
.Product-description-tooltip {
  appearance: none;
  background: none;
  border: none;
  color: var(--grey-600);
  padding: 9px 8px;
  position: absolute;
  right: 0;
  top: 0;
}

.Product-description-tooltip svg {
  height: 25px;
  width: 25px;
}

.Product-description-content {
  background-color: var(--green-500);
  bottom: 49px;
  color: var(--white);
  left: 0;
  padding: 40px 25px;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 250ms var(--ease-out);
  z-index: 10;
}
.Product-description-content.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition-duration: 600ms;
  transition-timing-function: var(--ease-in);
}
.Product-description-content:not(.is-hidden) ~ .Product-description-tooltip {
  display: none;
}

.Product-description-content > .Product-description-tooltip {
  color: var(--white);
}

.Product-description-name {
  font-family: var(--font-base);
  font-size: 1.16rem;
  font-weight: 900;
  margin-bottom: 16px;
  text-transform: inherit;
}

.Product-description-item {
  border-bottom: thin solid #ffffff7f;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.Product-description-item:nth-child(3) {
  border-bottom: none;
  max-height: 30%;
  overflow-y: auto;
}

.Product-description-item:nth-child(4) {
  border-top: thin solid #ffffff7f;
  padding-top: 1.5rem;
}

.Product-description-text {
  font-size: 0.92rem;
  line-height: 1.5em;
}

.Product-description-inline {
  align-items: center;
  display: flex;
  flex-direction: row;
}

.Product-description-notation-stars {
  align-items: center;
  display: flex;
  list-style: none;
  margin-bottom: 10px;
  padding-left: 0;
}

.Product-description-notation-stars svg {
  height: 25px;
  min-width: 25px;
  width: 25px;
}

.Product-description-notation-details {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: -1.5rem;
}

/* ----------------------------------------------------------------------------- == Product-metadata */
.Product-metadata {
  flex: 1;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.Product-metadataEntry {
  align-items: center;
  color: var(--grey-600);
  display: flex;
}

.Product-metadataEntry:not(:last-child) {
  margin-bottom: 10px;
}

.Product-metadataEntry > a {
  align-items: center;
  color: inherit;
  display: inherit;
  text-decoration: none;
  transition: color 200ms var(--ease-in);
}

.Product-metadataEntry > a:hover {
  color: var(--green-500);
}

.Product-metadataEntryIcon {
  height: 25px;
  margin-right: 16px;
  width: 25px;
}

.Product-metadataEntryContent {
  flex: 1;
  margin: 0;
}

.Product-metadataEntry.supplier {
  margin-top: 10px;
}

.Product-metadataEntry.supplier .Product-metadataEntryContent {
  text-transform: lowercase;
}

.Product-metadataEntry.supplier .Product-metadataEntryContent::first-letter {
  text-transform: uppercase;
}

/* ----------------------------------------------------------------------------- == Product-illustration */
.Product-illustration {
  height: 180px;
  width: 180px;
  object-fit: contain;
  position: relative;
  margin: auto;
}

.Product-illustration[data-toggle] {
  cursor: pointer;
}

.Product-illustration[alt]::before {
  align-items: center;
  background-color: var(--grey-100);
  border-radius: 6px;
  display: flex;
  font-family: var(--font-base);
  height: 100%;
  padding: 5px;
  text-align: center;
  width: 100%;
}

/* ----------------------------------------------------------------------------- == Product-label */
.Product-label {
  display: flex;
  flex-direction: column;
  max-width: 250px;
}

.Product-name {
  font-family: var(--font-base);
  text-transform: inherit;
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--grey-900);
  text-align: center;
  overflow: hidden;
  margin: 0;
}

.Product-packaging {
  font-size: 1.08rem;
  color: var(--grey-800);
  letter-spacing: -0.06px;
  text-align: center;
  white-space: nowrap;
  margin: 0;
}

.Product-loose {
  background-color: var(--grey-800);
  border-radius: 100vw;
  color: var(--white);
  display: inline-block;
  font-size: 0.8rem;
  margin: 0 auto;
  margin-left: 3px;
  padding: 2px 10px 1px 10px;
  text-align: center;
  transform: translateY(-2px);
}

/* ----------------------------------------------------------------------------- == Product-footer */
.Product-footer {
  border-top: thin solid #c8c8c8;
  display: flex;
  flex-direction: column;
  margin-top: 34px;
  padding-top: 9px;
  position: relative;
  width: 100%;
}

.Product-stock {
  background-color: var(--white);
  border: thin solid var(--grey-600);
  border-radius: 100vw;
  color: var(--grey-600);
  display: inline-block;
  font-size: 0.9rem;
  left: 50%;
  line-height: 1.8em;
  margin: 0 auto;
  padding: 0 11px;
  position: absolute;
  text-align: center;
  top: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.Product-stock:empty {
  display: none;
}

.Product-prices {
  color: var(--grey-800);
  padding: 11px 0;
  text-align: center;
}

.Product-unitaryPrice {
  font-family: var(--font-base);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.Product-quantityPrice {
  font-family: var(--font-base);
  font-size: 1.08rem;
  margin: 0;
  text-transform: inherit;
}

.Product-CTA {
  align-items: center;
  background-color: var(--orange-500);
  border-radius: 6px;
  color: var(--white);
  display: flex;
  font-family: var(--font-emphase);
  font-size: 1.08rem;
  font-weight: 600;
  padding: 2px 9px;
}

.Product-CTA.blue {
  background-color: var(--blue-500);
}

.Product-CTA.disabled {
  background-color: var(--grey-400);
  color: #ffffff7f;
  pointer-events: none;
}

.Product-CTALabel {
  flex: 1;
  margin: 0;
  text-align: center;
}

.Product-CTAWidget {
  align-items: center;
  display: flex;
  position: relative;
}

.Product-CTAWidgetButton {
  appearance: none;
  background: none;
  border: none;
  color: currentColor;
  margin: 0;
  padding: 2.5px;
}

.Product-CTAWidgetButton:first-child {
  padding-right: 10px;
}
.Product-CTAWidgetButton:last-child {
  padding-left: 10px;
}

.Product-CTAWidgetButton > svg {
  height: 25px;
  width: 25px;
}

.Product-CTAWidgetLabel {
  left: 50%;
  margin: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
