/* Jadiora — relationship product sales cards: intrinsic height only.
   Last loaded on index.html. English / Finnish / Chinese.
   Keep product previews, columns, widths, typography, colors and buttons unchanged. */
body[data-page-mode="relationship"] .shared-zodiac-product-grid > .relationship-product-card {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  /* The first track retains the original preview size by breakpoint below. */
  grid-template-rows: 205px minmax(min-content, 1fr) !important;
}

/* The original card content had overflow:hidden and a zero-minimum fractional
   detail row, which could cut longer Finnish/English lines when card height
   becomes intrinsic. Give each content row its natural height instead. */
body[data-page-mode="relationship"] .shared-zodiac-product-grid > .relationship-product-card .relationship-product-content {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  grid-template-rows: auto auto auto auto auto !important;
}

/* Keep price and buy action last, with no overlap. */
body[data-page-mode="relationship"] .shared-zodiac-product-grid > .relationship-product-card .paid-bottom {
  align-self: end !important;
}

@media (max-width: 980px) {
  body[data-page-mode="relationship"] .shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 170px minmax(min-content, 1fr) !important;
  }
}
@media (max-width: 760px) {
  body[data-page-mode="relationship"] .shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 154px minmax(min-content, 1fr) !important;
  }
}
@media (max-width: 520px) {
  body[data-page-mode="relationship"] .shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 140px minmax(min-content, 1fr) !important;
  }
}
@media (min-width: 981px) {
  body[data-page-mode="relationship"] .shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 186px minmax(min-content, 1fr) !important;
  }
}


/* v2.1 — Align price and purchase button across cards in the same grid row.
   The prior auto-height fix used five auto-sized internal grid tracks, so
   bottom actions stopped immediately after differing content lengths.
   A flex column fills the available card space and reserves the spare
   height above the price/action group instead. */
body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid {
  align-items: stretch !important;
}
body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid > .relationship-product-card {
  align-self: stretch !important;
  grid-template-rows: 205px minmax(min-content, 1fr) !important;
}
body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid > .relationship-product-card > .relationship-product-content {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: visible !important;
}
body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid > .relationship-product-card > .relationship-product-content > .paid-bottom {
  margin-top: auto !important;
  flex: 0 0 auto !important;
  align-self: stretch !important;
}
/* Preserve the preview row heights established by the auto-height patch. */
@media (max-width: 980px) {
  body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 170px minmax(min-content, 1fr) !important;
  }
}
@media (max-width: 760px) {
  body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 154px minmax(min-content, 1fr) !important;
  }
}
@media (max-width: 520px) {
  body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 140px minmax(min-content, 1fr) !important;
  }
}
@media (min-width: 981px) {
  body[data-page-mode="relationship"] .paid-grid.shared-zodiac-product-grid > .relationship-product-card {
    grid-template-rows: 186px minmax(min-content, 1fr) !important;
  }
}
