/**
 * Amour Parfum Signature 6.0.8 — Related Product Equaliser
 * Loaded last. Scope is deliberately limited to related and upsell merchandising
 * on single-product pages. The homepage, category pages, product composition,
 * cart/checkout and importer are unchanged.
 */

body.single-product :is(.related.products, .upsells.products) ul.products {
  align-items: stretch !important;
}

body.single-product :is(.related.products, .upsells.products) ul.products li.product {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 100% !important;
}

/* Keep the linked media/content stack consistent from card to card. */
body.single-product :is(.related.products, .upsells.products) ul.products li.product > a.woocommerce-LoopProduct-link {
  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  color: inherit !important;
  text-decoration: none !important;
}

body.single-product :is(.related.products, .upsells.products) ul.products li.product a img,
body.single-product :is(.related.products, .upsells.products) ul.products li.product img.woocommerce-placeholder {
  flex: 0 0 230px !important;
  width: 100% !important;
  height: 230px !important;
  min-height: 230px !important;
  max-height: 230px !important;
  margin: 0 0 16px !important;
  padding: 22px !important;
  box-sizing: border-box !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #f0ede7 !important;
}

body.single-product :is(.related.products, .upsells.products) ul.products li.product .amour-loop-brand {
  min-height: 1.35em !important;
  margin: 0 0 6px !important;
}

body.single-product :is(.related.products, .upsells.products) ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box !important;
  height: 2.55em !important;
  min-height: 2.55em !important;
  max-height: 2.55em !important;
  margin: 0 0 9px !important;
  overflow: hidden !important;
  line-height: 1.275 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

body.single-product :is(.related.products, .upsells.products) ul.products li.product .amour-loop-meta {
  display: -webkit-box !important;
  height: 3.0em !important;
  min-height: 3.0em !important;
  max-height: 3.0em !important;
  margin: 0 0 9px !important;
  overflow: hidden !important;
  line-height: 1.5 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

body.single-product :is(.related.products, .upsells.products) ul.products li.product .price {
  display: flex !important;
  align-items: center !important;
  min-height: 1.55em !important;
  margin: 0 0 10px !important;
}

/* Afterpay/Cash App Afterpay may inject a block between the price and CTA.
   Give that block a stable footprint without depending on one plugin version. */
body.single-product :is(.related.products, .upsells.products) ul.products li.product :is(
  [class*="afterpay" i],
  [id*="afterpay" i],
  [data-afterpay],
  [class*="cash-app" i]
) {
  box-sizing: border-box !important;
  min-height: 52px !important;
  max-height: 52px !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  overflow: hidden !important;
}

/* The action is always the final baseline, regardless of title length,
   finance messaging or whether the product is purchasable. */
body.single-product :is(.related.products, .upsells.products) ul.products li.product > :is(.button, .added_to_cart) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: auto 0 0 !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

/* Keep screen-reader helper elements from affecting flex sizing. */
body.single-product :is(.related.products, .upsells.products) ul.products li.product > .screen-reader-text {
  position: absolute !important;
}

@media (max-width: 860px) {
  body.single-product :is(.related.products, .upsells.products) ul.products li.product a img,
  body.single-product :is(.related.products, .upsells.products) ul.products li.product img.woocommerce-placeholder {
    flex-basis: 210px !important;
    height: 210px !important;
    min-height: 210px !important;
    max-height: 210px !important;
  }
}

@media (max-width: 560px) {
  body.single-product :is(.related.products, .upsells.products) ul.products li.product a img,
  body.single-product :is(.related.products, .upsells.products) ul.products li.product img.woocommerce-placeholder {
    flex-basis: 180px !important;
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
    padding: 16px !important;
  }
  body.single-product :is(.related.products, .upsells.products) ul.products li.product .woocommerce-loop-product__title {
    height: 2.7em !important;
    min-height: 2.7em !important;
    max-height: 2.7em !important;
  }
}
