/*
 * JZ iMotor Stock – stock card (templates/card.php and the cards stock.js renders).
 * Shared by the listing, "Similar Vehicles" and any carousel, so every card looks the same.
 * Figma card: 399×508, 1px #D9D9D9 border, 10px radius, 399×260 photo.
 */

.jz-card {
	--c-blue: var(--jz-blue, #1456ab);
	--c-ink: var(--jz-ink, #050b20);
	--c-muted: #5b5b5b;
	--c-line: var(--jz-line, #d9d9d9);

	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin: 0;
	border: 1px solid var(--c-line);
	border-radius: 10px;
	background: #fff;
	color: var(--c-ink);
	transition: box-shadow 0.2s, transform 0.2s;
}

.jz-card *,
.jz-card *::before,
.jz-card *::after {
	box-sizing: border-box;
}

.jz-card:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
	transform: translateY(-3px);
}

.jz-card a {
	color: inherit;
	text-decoration: none;
}

.jz-card svg {
	width: 1em;
	height: 1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.jz-card__media {
	display: block;
	aspect-ratio: 399 / 260;
	overflow: hidden;
	background: #e9e9e9;
}

.jz-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s;
}

.jz-card:hover .jz-card__media img {
	transform: scale(1.04);
}

.jz-card__noimg {
	display: grid;
	height: 100%;
	place-items: center;
	color: var(--c-muted);
	font-size: 14px;
}

.jz-card__badge {
	position: absolute;
	top: 20px;
	right: 30px;
	padding: 3px 14px;
	border-radius: 3px;
	background: #fff;
	font-size: 15px;
	line-height: 20px;
}

/* Heart: reset theme button styles first (WoodMart styles every <button>). */
.jz-card .jz-card__fav {
	position: absolute;
	top: 21px;
	right: 30px;
	display: grid;
	width: 54px;
	min-width: 0;
	height: 54px;
	min-height: 0;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
	color: #1e1e1e;
	font-size: 25px;
	line-height: 1;
	cursor: pointer;
}

.jz-card.has-badge .jz-card__fav {
	top: 58px;
}

.jz-card .jz-card__fav:hover,
.jz-card .jz-card__fav:focus,
.jz-card .jz-card__fav[aria-pressed="true"] {
	background: #fff;
	color: #e0245e;
}

.jz-card .jz-card__fav:focus-visible,
.jz-card a:focus-visible {
	outline: 2px solid var(--c-blue);
	outline-offset: 2px;
}

.jz-card__fav[aria-pressed="true"] svg {
	fill: currentColor;
}

.jz-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 22px 22px 25px;
}

.jz-card .jz-card__title {
	margin: 0 0 11px;
	color: var(--c-ink);
	font-family: inherit;
	font-size: 21px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
}

.jz-card__title a:hover {
	color: var(--c-blue);
}

.jz-card .jz-card__sub {
	margin: 0;
	overflow: hidden;
	color: var(--c-ink);
	font-size: 17px;
	line-height: 22px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jz-card .jz-card__specs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 18px 0 22px;
	padding: 16px 8px 12px;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.04);
	list-style: none;
	text-align: center;
}

.jz-card__specs li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	min-width: 0;
	margin: 0;
	font-size: 12px;
	line-height: 1.2;
}

.jz-card__specs span {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jz-card__specs svg {
	font-size: 30px;
	stroke-width: 1.3;
}

.jz-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
}

.jz-card .jz-card__price {
	margin: 0;
	color: var(--c-blue);
	font-size: 24px;
	line-height: 1.1;
}

.jz-card__price s {
	margin-right: 6px;
	color: var(--c-muted);
	font-size: 15px;
}

.jz-card .jz-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--c-blue);
	font-size: 17px;
	white-space: nowrap;
}

.jz-card__cta svg {
	font-size: 15px;
}

.jz-card .jz-card__cta:hover {
	text-decoration: underline;
}

.jz-card .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Loading placeholder card (listing). */
.jz-card--skeleton .jz-card__media,
.jz-card--skeleton i {
	animation: jz-pulse 1.2s infinite;
}

.jz-card--skeleton i {
	display: block;
	height: 14px;
	margin-bottom: 12px;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.06);
}

.jz-card--skeleton i:nth-child(2) {
	width: 60%;
}

.jz-card--skeleton i:nth-child(3) {
	height: 80px;
}

@keyframes jz-pulse {
	50% {
		opacity: 0.5;
	}
}

/* Narrower cards (4-up rows, laptops): scale type down a little. */
@media (max-width: 1366px) {
	.jz-card__body {
		padding-inline: 18px;
	}

	.jz-card .jz-card__title {
		font-size: 19px;
	}

	.jz-card .jz-card__sub {
		font-size: 15px;
	}

	.jz-card .jz-card__price {
		font-size: 21px;
	}

	.jz-card .jz-card__cta {
		font-size: 15px;
	}

	.jz-card .jz-card__fav {
		width: 46px;
		height: 46px;
		font-size: 22px;
	}
}
