/* ==========================================================================
   HESP Product Card — mockup 6.3 (282×400, image 282×212)
   ========================================================================== */

.hesp-product-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	justify-content: stretch;
	gap: var(--hesp-space-grid-gap, 24px);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.hesp-product-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 282px;
	height: 400px;
	margin: 0 auto;
	background: #ffffff;
	border: 1px solid #e7ecf1;
	border-radius: 18px;
	overflow: hidden;
	min-width: 0;
	transition: box-shadow 0.2s ease;
}

.hesp-product-card.is-hidden {
	display: none;
}

.hesp-product-card:hover {
	box-shadow: 0 8px 30px rgba(16, 32, 47, 0.08);
}

/* Image frame — desktop 282×212 (4:3), never crop product */
.hesp-product-card__media {
	position: relative;
	flex: 0 0 212px;
	width: 100%;
	height: 212px;
	background: #f7fafd;
	border-bottom: 1px solid #e7ecf1;
}

.hesp-product-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	padding: 16px;
	overflow: hidden;
	background: #f7fafd;
	text-decoration: none;
}

.hesp-product-card__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain !important;
	object-position: center;
}

.hesp-product-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(
		-45deg,
		#eef2f6,
		#eef2f6 8px,
		#f7fafd 8px,
		#f7fafd 16px
	);
}

.hesp-product-card__badges {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.hesp-product-card__badges--overlay {
	position: absolute;
	inset: 10px 10px auto;
	justify-content: space-between;
	pointer-events: none;
	z-index: 1;
}

.hesp-product-card__badges--inline {
	position: static;
	flex-wrap: wrap;
	margin: 0 0 12px;
}

.hesp-product-card__badge {
	display: inline-flex;
	align-items: center;
	max-width: calc(50% - 4px);
	padding: 5px 10px;
	border-radius: 999px;
	font-family: var(--hesp-font);
	font-size: 11px;
	font-weight: var(--hesp-font-semibold);
	line-height: 1.2;
	letter-spacing: 0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hesp-product-card__badge--availability {
	margin-right: auto;
	background: #e6f4ec;
	color: #166b40;
}

.hesp-product-card__badge--on_order {
	background: #e6f4ec;
	color: #166b40;
}

.hesp-product-card__badge--unavailable {
	background: #eef1f4;
	color: #5b6472;
}

.hesp-product-card__badge--adr {
	margin-left: auto;
	background: #fdecea;
	color: #a51f1f;
}

.hesp-product-card__badges--inline .hesp-product-card__badge {
	max-width: none;
	margin: 0;
}

.hesp-product-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	padding: 16px;
	background: #ffffff;
}

.hesp-product-card__tag {
	display: block;
	font-family: var(--hesp-font);
	font-size: var(--hesp-text-label, 11px);
	font-weight: var(--hesp-font-semibold);
	line-height: var(--hesp-leading-label, 1.3);
	text-transform: uppercase;
	letter-spacing: var(--hesp-tracking-eyebrow, 0.06em);
	color: var(--hesp-gold, #d6a431);
	margin: 0 0 6px;
}

.hesp-product-card__name {
	font-family: var(--hesp-font);
	font-weight: var(--hesp-font-bold, 700);
	font-size: 16px;
	line-height: 1.3;
	margin: 0;
	min-height: calc(1.3em * 2);
	min-width: 0;
	overflow: hidden;
}

.hesp-product-card__name a {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	color: var(--hesp-navy, #082e4e);
	text-decoration: none;
	word-break: break-word;
}

.hesp-product-card__name a:hover {
	color: var(--hesp-blue, #1264aa);
}

.hesp-product-card__footer {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 10px;
	margin-top: auto;
	padding-top: 12px;
}

.hesp-product-card__footer--simple {
	justify-content: flex-start;
}

.hesp-product-card__prices {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.hesp-product-card__price {
	display: inline-flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
	line-height: 1.2;
}

.hesp-product-card__price--net {
	font-family: var(--hesp-font);
	font-weight: var(--hesp-font-bold, 700);
	font-size: 18px;
	color: var(--hesp-navy, #082e4e);
}

.hesp-product-card__price--gross {
	font-family: var(--hesp-font);
	font-weight: var(--hesp-font-regular, 400);
	font-size: 12px;
	color: #5b6472;
}

.hesp-product-card__price-amount {
	white-space: nowrap;
}

.hesp-product-card__price-label {
	font-size: 0.85em;
	font-weight: var(--hesp-font-semibold);
	white-space: nowrap;
	flex-shrink: 0;
}

.hesp-product-card__price--net .hesp-product-card__price-label {
	font-family: var(--hesp-font);
	color: var(--hesp-navy, #082e4e);
}

.hesp-product-card__price--gross .hesp-product-card__price-label {
	font-family: var(--hesp-font);
	color: #5b6472;
}

.hesp-product-card__price .woocommerce-Price-amount {
	color: inherit;
}

.hesp-product-card__footer--mail {
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
}

.hesp-product-card__footer--mail .hesp-product-card__prices {
	flex: 1 1 auto;
	min-width: 0;
}

.hesp-product-card__footer--mail .hesp-product-card__price--net {
	font-size: 14px;
}

.hesp-product-card__footer--mail .hesp-product-card__price--gross {
	font-size: 11px;
}

.hesp-product-card__footer--mail .hesp-product-card__btn,
.hesp-product-card__btn.hesp-btn-mail-order {
	flex: 0 0 auto;
	width: auto;
	max-width: 52%;
	min-height: 40px !important;
	padding: 0 12px !important;
	font-size: 12px !important;
	letter-spacing: -0.01em;
	white-space: nowrap;
	text-align: center;
}

/*
 * Audit 15.1 — product list columns:
 *   ≥ 1280 desktop — 4
 *   640–1279       — 3
 *   < 640 phone    — 2
 */
@media (max-width: 1279px) {
	.hesp-product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		justify-content: stretch;
	}

	.hesp-product-card {
		max-width: none;
		height: auto;
		min-height: 400px;
	}

	.hesp-product-card__media {
		flex: 0 0 auto;
		height: auto;
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 639px) {
	.hesp-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	/* Audit 15.3 — compact 2-col cards (avoid endless single-column scroll) */
	.hesp-product-card {
		max-width: none;
		height: auto;
		min-height: 0;
	}

	.hesp-product-card__media {
		flex: 0 0 auto;
		height: auto;
		aspect-ratio: 4 / 3;
	}

	.hesp-product-card__image {
		padding: 12px;
	}

	.hesp-product-card__body {
		padding: 12px 12px 14px;
	}

	.hesp-product-card__footer:not(.hesp-product-card__footer--simple) {
		flex-wrap: wrap;
		align-items: stretch;
		gap: 8px;
	}

	.hesp-product-card__footer:not(.hesp-product-card__footer--simple) .hesp-product-card__prices {
		flex: 1 1 100%;
	}

	.hesp-product-card__btn {
		width: 100%;
	}

	.hesp-product-card__footer--mail .hesp-product-card__btn,
	.hesp-product-card__btn.hesp-btn-mail-order {
		flex: 1 1 100%;
		width: 100%;
		max-width: none;
	}

	.hesp-product-card__price--net {
		font-size: 15px;
	}

	.hesp-product-card__badge {
		font-size: 10px;
		padding: 4px 8px;
	}
}

@media (max-width: 420px) {
	.hesp-product-card__name {
		font-size: 14px;
	}

	.hesp-product-card__btn {
		font-size: 13px;
	}
}
