/* article + class beats Gutenberg's `.is-layout-constrained > *` margin rule.
 * The explicit `.is-layout-constrained >` context also beats its
 * `> :last-child { margin-block-end: 0 }` rule, keeping the fixture's
 * 1.6em 0 margin on the frontend where the article is the last child. */
article.lca-product-card,
.is-layout-constrained > article.lca-product-card {
	padding: 16px;
	border: 1px solid #ddd;
	border-radius: 12px;
	margin: 1.6em 0;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.lca-product-card__main {
	display: flex;
	gap: 14px;
	align-items: center;
}

.lca-product-card__image {
	flex-shrink: 0;
}

/* Image presentation follows AliNavigator's product images (ProductImage in
 * the gallery and store cards): scaled to fit, never cropped (its AliExpress
 * rule allows scaling only, no trimming), a little padding, on white inside
 * a 1px frame in AliNavigator's light line color (--rule #d8dde2), so white
 * product shots sit flush and letterboxed photos still read as a tile.
 * The 112px square and the radius stay the card's own (small blog card). */
.lca-product-card__image img {
	display: block;
	box-sizing: border-box;
	width: 112px;
	height: 112px;
	padding: 6px;
	object-fit: contain;
	background: #fff;
	border: 1px solid #d8dde2;
	border-radius: 10px;
}

.lca-product-card__body {
	min-width: 0;
	flex: 1;
}

.lca-product-card__title {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.45;
}

.lca-product-card__description {
	margin: 0;
	font-size: 14px;
	color: #555;
	line-height: 1.7;
}

/* Cocoon's `.entry-content ul` (0,1,1) beats the base rule (0,1,0) and adds
 * padding-left (16.8px), pushing the button row right of the image; its `li`
 * also gets side margins. Scope to (0,2,2) like the link rule below. */
article.lca-product-card ul.lca-product-card__links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

article.lca-product-card ul.lca-product-card__links > li {
	margin: 0;
	padding: 0;
}

.lca-product-card__link {
	display: inline-block;
	padding: 9px 15px;
	border-radius: 999px;
	font-size: 14px;
	color: #fff;
	text-decoration: none;
}

/* Cocoon theme's `.entry-content a` (0,1,1) beats the base rule (0,1,0) and
 * turns button text green. Scope LCA anchors (0,2,2) to win without
 * !important; this selector never matches ordinary article links. */
article.lca-product-card a.lca-product-card__link,
article.lca-product-card a.lca-product-card__link:visited,
article.lca-product-card a.lca-product-card__link:hover,
article.lca-product-card a.lca-product-card__link:focus,
article.lca-product-card a.lca-product-card__link:active {
	color: #fff;
	text-decoration: none;
}

/* Button colors follow AliNavigator's tokens (app.css): AliExpress --drop
 * #c5341f, neutral --ink-2 #4c5868. White text on every background must stay
 * at 4.5:1 or more (tests/card-contrast-smoke.php). Amazon keeps its own navy. */
.lca-product-card__link--official,
.lca-product-card__link--custom {
	font-weight: 600;
	background: #4c5868;
}

.lca-product-card__link--amazon {
	font-weight: 700;
	background: #232f3e;
}

.lca-product-card__link--aliexpress {
	font-weight: 700;
	background: #c5341f;
}

/* Narrow viewports only: keep the fixture layout on desktop, avoid overflow
 * when the fixed 112px image plus text cannot share one row. */
@media (max-width: 480px) {
	.lca-product-card__main {
		flex-wrap: wrap;
	}
}

/* AliNavigator line under the buttons (includes/alinavigator.php): a thin
 * rule, the lead text and a link with AliNavigator's site mark. Colors follow
 * AliNavigator's tokens: --rule #d8dde2, --ink-3 #606b7a, link blue #2f4bd8.
 * The anchor rule is (0,2,2) to beat Cocoon's `.entry-content a` color. */
article.lca-product-card p.lca-product-card__alinavigator {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 2px 12px;
	margin: 14px 0 0;
	padding: 10px 0 0;
	border-top: 1px solid #d8dde2;
	font-size: 12px;
	line-height: 1.6;
	color: #606b7a;
}

article.lca-product-card a.lca-product-card__alinavigator-link,
article.lca-product-card a.lca-product-card__alinavigator-link:visited {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #2f4bd8;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

article.lca-product-card a.lca-product-card__alinavigator-link:hover,
article.lca-product-card a.lca-product-card__alinavigator-link:focus {
	color: #2f4bd8;
	text-decoration: underline;
}

article.lca-product-card img.lca-product-card__alinavigator-mark {
	display: block;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	border: 0;
}
