/* IPEKERP_STOREFRONT_SEARCH_HOME_CARD_COMPACT_V1
   Search cards adopt the already-approved homepage card proportions.
   Visual only. No product/search/compatibility/stock/price semantics change.
*/

/* The homepage diagnosis proved these two flex-grow rules create artificial
   vertical space. Collapse them on search cards as well. */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card {
  min-height: 0 !important;
  height: auto !important;
  align-self: start !important;
}

body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__link {
  flex: 0 0 auto !important;
  min-height: 0 !important;
}

body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__body {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  padding: 10px 16px 0 !important;
}

/* Homepage-like image proportion: product stays dominant but no longer pushes
   price/CTA below the first viewport. */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__image {
  height: 176px !important;
  min-height: 176px !important;
  margin: 0 10px !important;
  background: #fff !important;
}

body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 94% !important;
  max-height: 94% !important;
  object-fit: contain !important;
}

/* Missing image remains deliberately neutral until the later image-data pass. */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__placeholder {
  height: 100% !important;
  min-height: 0 !important;
  background: #f7f9fb !important;
}

/* Brand / meta */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__brand,
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__brand-badge {
  min-height: 36px !important;
  padding-left: 16px !important;
  padding-right: 52px !important;
}

body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__meta {
  margin-bottom: 7px !important;
  color: #ef1b23 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

/* Product title: compact but readable */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__body h2,
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__body h3 {
  margin: 0 !important;
  min-height: 40px !important;
  font-size: 14px !important;
  line-height: 1.32 !important;
  color: #062a57 !important;
}

/* Compatibility row remains visible, but loses the old reserved-height behavior. */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__compat {
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  margin: 9px 0 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

/* Commerce/footer follows content directly, like the homepage cards. */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__commerce {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
}

body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__footer {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  margin-top: 10px !important;
  padding: 0 16px !important;
}

body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__actions {
  flex: 0 0 auto !important;
  margin-top: 10px !important;
  padding: 0 16px 16px !important;
}

/* Price hierarchy */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
:is(.sf-product-card__price,.sf-price,[class*="price"]) {
  color: #062a57 !important;
  font-size: 18px !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
}

/* Homepage CTA language */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__actions button,
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__actions > a,
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__footer button,
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-cart-add-button {
  min-height: 46px !important;
  width: 100% !important;
  border: 1px solid #ef1b23 !important;
  border-radius: 8px !important;
  background: #ef1b23 !important;
  color: #fff !important;
  font-weight: 850 !important;
}

/* Favorite stays light and secondary. */
body.sf-search-v2.sf-stage5-search-v1
#storefront-product-grid > article.sf-product-card
.sf-product-card__favorite {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
}

/* Keep four-column desktop density; responsive behavior remains owned by canonical CSS. */
@media (max-width: 1100px) {
  body.sf-search-v2.sf-stage5-search-v1
  #storefront-product-grid > article.sf-product-card
  .sf-product-card__image {
    height: 164px !important;
    min-height: 164px !important;
  }
}
