/*
 * Product listing card — Horizonte do Açaí
 *
 * Shared by the shop archive, the home page blocks and "Produtos relacionados"
 * on the single product page, so all of them render the identical card.
 *
 * Scoped to `.hda-card-produto`, a marker class added in
 * horizonte-woocommerce-style.php to the listings that actually render the
 * product card (426 and 1017). This file used to target `.jet-listing-grid__item`
 * directly, which reached EVERY JetEngine listing on the site — the consultants
 * listing on the home page included. Its cards lost their spacing to the
 * `margin: 0 !important` below and ran together. JetEngine's own markup carries
 * nothing that identifies the listing, hence the marker class.
 *
 * The card is an Elementor section stack:
 *   section (card shell)
 *     └ column › widget-wrap
 *         ├ image widget
 *         ├ inner section  → title / short description / price
 *         └ inner section  → "Compre agora" button
 *
 * Left alone, each card is only as tall as its own content, so longer names
 * or descriptions push the price and button down and the row looks ragged.
 * These rules make every card fill the row height, let the text block absorb
 * the slack, and pin the button to the bottom so prices and CTAs line up.
 */

/* The grid rule has to sit on the container, which carries no marker of its
   own — `:has()` derives it from the children instead. Baseline in every
   current browser; where it is missing the cards simply keep JetEngine's
   default columns rather than breaking. */
.jet-listing-grid__items:has(> .hda-card-produto) {
	display: grid !important;
	/* auto-fill drops columns on its own as the container narrows and avoids
	   a half-empty final row */
	grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
	gap: 20px;
	align-items: stretch;
	max-width: none;
	margin: 0;
	padding: 0;
}

.jet-listing-grid__item.hda-card-produto {
	display: flex;
	width: auto !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Card shell fills its grid cell */
.hda-card-produto > .elementor {
	display: flex;
	width: 100%;
}

.hda-card-produto .elementor-top-section {
	display: flex;
	width: 100%;
	min-height: 100%;
	margin: 0;
}

.hda-card-produto .elementor-top-section > .elementor-container {
	width: 100%;
	min-height: 100%;
}

.hda-card-produto .elementor-top-column {
	width: 100%;
}

.hda-card-produto .elementor-top-column > .elementor-widget-wrap {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 14px 14px 16px;
}

/* Text block takes the leftover height; button section sinks to the bottom */
.hda-card-produto .elementor-widget-wrap > .elementor-inner-section:first-of-type {
	flex: 1 1 auto;
	margin: 0;
}

.hda-card-produto .elementor-widget-wrap > .elementor-inner-section:last-of-type {
	flex: 0 0 auto;
	margin-top: auto;
	padding-top: 12px;
}

/* Uniform image box so every card's text starts at the same y position */
.hda-card-produto .elementor-widget-image {
	margin-bottom: 12px;
}

.hda-card-produto .elementor-widget-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
}

/*
 * Title / description / price are addressed by their Elementor widget IDs
 * from listing 426. Rebuilding that listing from scratch regenerates the IDs
 * and these three rules would need repointing.
 */
.hda-card-produto .elementor-element-7b825f2 .elementor-heading-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.5em;
	font-size: 16px;
	line-height: 1.25;
}

.hda-card-produto .elementor-element-4e6171f .elementor-heading-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 3.9em;
	font-size: 12.5px;
	font-weight: 400;
	line-height: 1.3;
	color: #6b6580;
}

.hda-card-produto .elementor-element-2abd802 .elementor-heading-title {
	font-size: 21px;
	font-weight: 700;
	line-height: 1.2;
}

.hda-card-produto .elementor-widget-button .elementor-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	font-size: 14px;
}
