/* MUTTI LAB 2.0 DEV2 — Product Card V2.1
 * Marketplace rhythm contract:
 * - deterministic media/title/rating/delivery/price zones
 * - identical CTA baseline inside every row
 * - trust/review metadata visible on thematic/AJAX cards too
 * - no query, WooCommerce, SKU, cart or media-pipeline changes
 */

/* 1) The card stretches to the height supplied by its row/wrapper. The CTA is
   the final flex item and therefore cannot float upward on a shorter title. */
html body .mutti-market-card.mutti-ui-card-v2-1{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-self:stretch!important;
  height:100%!important;
  min-height:0!important;
}

/* Common wrapper owners used by Home streams, feature bands and shelves. */
html body .mutti-feature-band-v9460__product,
html body .mutti-home-department-v8521__card,
html body .mutti-popular-v9370__shelf-card,
html body .mutti-cart-discovery-v9458 .mutti-market-grid>*,
html body .mutti-pdp-related-grid>*{
  align-items:stretch!important;
}
html body .mutti-feature-band-v9460__product,
html body .mutti-home-department-v8521__card{
  display:flex!important;
}
html body .mutti-feature-band-v9460__product>.mutti-ui-card-v2-1,
html body .mutti-home-department-v8521__card>.mutti-ui-card-v2-1,
html body .mutti-popular-v9370__shelf-card>.mutti-ui-card-v2-1{
  flex:1 1 auto!important;
  width:100%!important;
}

/* 2) Product media has deterministic geometry. Existing image-fit / optical
   scale logic remains authoritative inside this slot. */
html body .mutti-ui-card-v2-1 .mutti-market-media-v9456{
  flex:0 0 auto!important;
  min-height:0!important;
}
html body .mutti-ui-card-v2-1 .mutti-market-image{
  box-sizing:border-box!important;
  aspect-ratio:3/4!important;
  height:auto!important;
  min-height:0!important;
}

/* 3) The information block is a fixed four-zone marketplace stack. The DOM
   can contain variable content; geometry cannot. Price stays above the name to
   preserve the current MUTTI visual order seen in production. */
html body .mutti-ui-card-v2-1 .mutti-market-copy,
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-market-copy{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-areas:
    "price"
    "title"
    "rating"
    "promise"!important;
  grid-template-rows:auto 2.62em 18px 31px!important;
  row-gap:4px!important;
  flex:0 0 auto!important;
  min-height:0!important;
  height:auto!important;
  padding-bottom:0!important;
}
html body .mutti-ui-card-v2-1 .mutti-market-price-row{
  grid-area:price!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:flex-end!important;
  min-height:22px!important;
  margin:0!important;
}
html body .mutti-ui-card-v2-1 .mutti-market-copy h3,
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-market-copy h3{
  grid-area:title!important;
  box-sizing:border-box!important;
  display:-webkit-box!important;
  height:2.62em!important;
  min-height:2.62em!important;
  max-height:2.62em!important;
  margin:0!important;
  overflow:hidden!important;
  line-height:1.31!important;
  text-overflow:ellipsis!important;
  overflow-wrap:anywhere!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  line-clamp:2!important;
}
html body .mutti-ui-card-v2-1 .mutti-market-copy h3 a{
  display:block!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  line-height:inherit!important;
}

/* 4) Honest review slot. Real Woo reviews win. Logged-in admins may still see
   the existing Stage121 demo preview; customers with no reviews see a neutral
   “Нет отзывов”, so the row never collapses and CTA alignment stays stable. */
html body .mutti-ui-card-v2-1 .mutti-stage121-card-rating,
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-stage121-card-rating{
  grid-area:rating!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:auto max-content minmax(0,1fr)!important;
  align-items:center!important;
  column-gap:5px!important;
  width:100%!important;
  height:18px!important;
  min-height:18px!important;
  max-height:18px!important;
  margin:0!important;
  overflow:hidden!important;
  white-space:nowrap!important;
}
html body .mutti-ui-card-v2-1 .mutti-stage121-card-rating--empty{
  display:flex!important;
  align-items:center!important;
  color:#858a92!important;
  font-size:10.4px!important;
  font-weight:520!important;
  line-height:18px!important;
}
html body .mutti-ui-card-v2-1 .mutti-stage121-card-rating__empty{
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body .mutti-ui-card-v2-1 .mutti-stage121-card-rating .mutti-market-stars{
  flex:0 0 auto!important;
  min-width:0!important;
  line-height:1!important;
}
html body .mutti-ui-card-v2-1 .mutti-stage121-card-rating>span:last-child{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

/* 5) Delivery/availability is one reserved trust slot on every card. This is
   the specific parity fix for Tools/Gaming/Home/other thematic surfaces. */
html body .mutti-ui-card-v2-1 .mutti-stage121-pvz,
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-stage121-pvz,
html body .mutti-ui-card-v2-1 .mutti-market-delivery{
  grid-area:promise!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-wrap:wrap!important;
  align-content:flex-start!important;
  align-items:baseline!important;
  gap:1px 5px!important;
  width:100%!important;
  height:31px!important;
  min-height:31px!important;
  max-height:31px!important;
  margin:0!important;
  overflow:hidden!important;
}
html body .mutti-ui-card-v2-1 .mutti-stage121-pvz__free{
  color:#118447!important;
  font-size:10.4px!important;
  font-weight:760!important;
  line-height:14px!important;
  white-space:nowrap!important;
}
html body .mutti-ui-card-v2-1 .mutti-stage121-pvz__free::before{
  content:""!important;
  display:inline-block!important;
  width:6px!important;
  height:6px!important;
  margin:0 4px 1px 0!important;
  border-radius:50%!important;
  background:currentColor!important;
  vertical-align:middle!important;
}
html body .mutti-ui-card-v2-1 .mutti-stage121-pvz__eta{
  min-width:0!important;
  color:#6d727a!important;
  font-size:9.7px!important;
  font-weight:540!important;
  line-height:14px!important;
  white-space:normal!important;
}
html body .mutti-ui-card-v2-1 .mutti-market-delivery{
  color:#6d727a!important;
  font-size:10px!important;
  line-height:14px!important;
}

/* 6) The marketplace baseline rule: actions consume remaining vertical space
   and the button sits at the bottom of every equal-height row. */
html body .mutti-ui-card-v2-1 .mutti-market-actions,
html body .mutti-ui-card-v2-1 .mutti-market-actions--single-v8524,
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-market-actions--single-v8524{
  box-sizing:border-box!important;
  display:flex!important;
  flex:1 0 auto!important;
  align-items:flex-end!important;
  width:100%!important;
  margin-top:auto!important;
  padding-top:7px!important;
}
html body .mutti-ui-card-v2-1 .mutti-market-action--cart-v8524{
  flex:0 0 auto!important;
  width:100%!important;
  margin-top:auto!important;
}

/* Compact thematic cards keep their established scale; V2.1 only fixes rhythm. */
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-stage121-card-rating{
  font-size:9.2px!important;
}
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-stage121-card-rating .mutti-market-stars{
  font-size:10.5px!important;
}
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-stage121-pvz__free{
  font-size:9.3px!important;
}
html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-stage121-pvz__eta{
  font-size:8.8px!important;
}

/* Narrow screens: preserve two-line titles and the same bottom-aligned CTA,
   while allowing the promise copy to use a slightly taller reserved slot. */
@media(max-width:700px){
  html body .mutti-ui-card-v2-1 .mutti-market-copy,
  html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-market-copy{
    grid-template-rows:auto 2.62em 17px 34px!important;
    row-gap:3px!important;
  }
  html body .mutti-ui-card-v2-1 .mutti-stage121-card-rating,
  html body.home #mutti-market .mutti-feature-band-v9460__product .mutti-ui-card-v2-1 .mutti-stage121-card-rating{
    height:17px!important;
    min-height:17px!important;
    max-height:17px!important;
  }
  html body .mutti-ui-card-v2-1 .mutti-stage121-pvz,
  html body .mutti-ui-card-v2-1 .mutti-market-delivery{
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
  }
  html body .mutti-ui-card-v2-1 .mutti-stage121-pvz__free{font-size:9.4px!important}
  html body .mutti-ui-card-v2-1 .mutti-stage121-pvz__eta{font-size:8.9px!important}
}

html[data-mutti-theme="dark"] body .mutti-ui-card-v2-1 .mutti-stage121-card-rating--empty,
html[data-mutti-theme="dark"] body .mutti-ui-card-v2-1 .mutti-stage121-pvz__eta,
html[data-mutti-theme="dark"] body .mutti-ui-card-v2-1 .mutti-market-delivery{
  color:#aeb5bf!important;
}
