/**
 * ES Product Cards
 * Fixes the uneven-grid problem: fixed image ratio box (padding-top spacer),
 * reserved title height, and button pinned to the bottom so every card aligns.
 */

.es-pcards {
	display: grid;
	grid-template-columns: repeat(var(--es-cols, 4), minmax(0, 1fr));
	column-gap: 26px;
	row-gap: 26px;
	width: 100%;
	height: auto !important;
	align-self: flex-start;
}

.es-pcard {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid #e7e3dd;
	border-radius: 4px;
	overflow: hidden;
	height: auto !important;
	align-self: flex-start;
	transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
}

/* Image ratio box — padding-top spacer keeps every card identical */
.es-pcard-media {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #ffffff;
}

.es-pcard-media::before {
	content: "";
	display: block;
	width: 100%;
	padding-top: var(--es-ratio, 100%);
}

.es-pcard-imglink {
	position: absolute;
	inset: 0;
	display: block;
}

.es-pcard-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Badges */
.es-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	padding: 5px 10px;
	border-radius: 2px;
	color: #fff;
	font-family: "Jost", sans-serif;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	line-height: 1;
}

.es-badge-sale {
	background: #c0392b;
}

.es-badge-new {
	background: #2b2622;
}

/* Wishlist */
.es-pcard-wish {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
}

/* Body */
.es-pcard-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px 20px 22px;
}

.es-pcard-cat {
	margin-bottom: 8px;
	font-family: "Jost", sans-serif;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	line-height: 1.2;
}

.es-pcard-cat a {
	color: #a9793a;
	text-decoration: none;
}

.es-pcard-title {
	margin: 0 0 12px;
	min-height: 44px;
	font-family: "Red Hat Display", sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	color: #2b2622;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.es-pcard-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

/* Price — force theme .amount to inherit our colors */
.es-pcard-price {
	margin-bottom: 16px;
	margin-top: auto;
	font-family: "Jost", sans-serif;
	font-size: 18px;
	font-weight: 600;
	color: #2b2622;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 9px;
}

.es-pcard-price .amount {
	color: inherit !important;
}

.es-pcard-price del {
	opacity: 1;
	font-weight: 400;
	font-size: 0.8em;
}

.es-pcard-price del .amount {
	color: #6b645d !important;
}

.es-pcard-price ins {
	text-decoration: none;
}

/* Button */
.es-pcard-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	padding: 13px 18px;
	border: 1.5px solid transparent;
	border-radius: 2px;
	background: #a9793a;
	color: #fff;
	font-family: "Jost", sans-serif;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.es-pcard-btn:hover {
	background: #956a31;
	color: #fff;
}

/* Added-to-cart state (WooCommerce adds .added) */
.es-pcard-btn.added::after {
	content: "\2713";
	margin-left: 6px;
}

.es-cats-notice {
	padding: 20px;
	border: 1px dashed #c9bda9;
	border-radius: 3px;
	background: #faf7f2;
	color: #6b645d;
	font-family: "Red Hat Display", sans-serif;
	font-size: 14px;
	text-align: center;
}
