/**
 * Shared product card layout (Phase 1 — docs/improvements/Home_and_Products.md).
 * 1:1 media, equal-height feel, clamped titles.
 */

.jdh-product-card .product-box {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.jdh-product-card .product-imgbox.jdh-product-card__imgbox {
  position: relative;
}

.jdh-product-card__face {
  display: block;
}

.jdh-product-card__face .jdh-product-card__img,
.jdh-product-card__imgbox .jdh-product-card__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.jdh-product-card .product-detail {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Space below image + vertically center title/price as a group (overrides assets/new/product.css) */
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 0.75rem 0.65rem 0.85rem;
  margin-top: 0.35rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Beat theme + product.css rules that pin content to the bottom */
.product .product-card.jdh-product-card .product-detail.detail-inline,
.product .product-card.jdh-product-card .product-detail {
  justify-content: center;
}

.jdh-product-card .detail-title,
.jdh-product-card .detail-title-excp {
  min-height: 0;
  max-height: none;
  align-content: unset;
  width: 100%;
  padding-top: 0;
}

.product .product-card.jdh-product-card .product-box .product-detail .detail-title {
  padding-top: 0;
}

.jdh-product-card .detail-title-excp {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.jdh-product-card .detail-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.jdh-product-card .detail-right {
  float: none;
  width: 100%;
  text-align: center;
}

.jdh-product-card .price-price-title {
  margin: 0;
}

.jdh-product-card .jdh-product-card__title {
  margin-bottom: 0;
}

.jdh-product-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

/* Search results: icon bar full width (legacy inline style) */
.jdh-product-card--ctx-search .product-icon.icon-inline {
  transform: none;
  right: 0;
  left: 0;
}
