/* =============================================================
   Collection Grid (wcg-) — category / collection pages
   -------------------------------------------------------------
   Category pages are rendered by the Collection Grid plugin, not
   WooCommerce's product loop, so they carry none of the .wd-product
   markup the shop page uses. That's why the shop-card styling never
   reached them. These rules give the wcg- cards the same treatment.
   ============================================================= */

.wcg-grid,
.wcg-products {
	--wcg-ink: #1a1a2e;
	--wcg-navy: #2b2e52;
	--wcg-muted: #6b6b7c;
	--wcg-line: #e6e6ec;
	--wcg-sale: #e4032e;
}

/* ---------------------------------------------- card */
.wcg-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e6e6ec;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(20, 20, 40, .06);
	transition: box-shadow .2s ease, transform .2s ease;
}

.wcg-card:hover {
	box-shadow: 0 8px 22px rgba(20, 20, 40, .1);
	transform: translateY(-2px);
}

/* Image inset with rounded corners, matching the shop card */
.wcg-image-link {
	display: block;
	padding: 10px 10px 0;
}

.wcg-product-image {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 8px;
}

/* Discount badge injected by collection-grid.js — the plugin
   renders no percentage badge of its own, so it is calculated
   from the price and RRP already in the markup. */
.wcg-image-link {
	position: relative;
}

.wcg-badge {
	position: absolute;
	top: 18px;
	left: 18px;
	z-index: 2;
	padding: 6px 10px;
	border-radius: 6px;
	background: #e4032e;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}


.wcg-card-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 0;
}

/* ---------------------------------------------- title
   line-height and max-height are set in px, not em, so the two
   can never disagree and let a third line peek through. */
.wcg-title {
	margin: 14px 16px 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 22px !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 2 !important;
	-webkit-box-orient: vertical !important;
	line-clamp: 2;
	overflow: hidden !important;
	max-height: 44px !important;
	min-height: 44px;
}

.wcg-title a {
	color: #1a1a2e;
	text-decoration: none;
}

/* "Now from" caption above the price, as on the shop card */
.wcg-price-row::before {
	content: "Now from";
	display: block;
	margin-bottom: 3px;
	font-size: 12px;
	font-weight: 400;
	color: #6b6b7c;
}


/* ---------------------------------------------- price block */
.wcg-section-separator {
	margin: 12px 16px 0;
	border-top: 1px solid #e6e6ec;
}

.wcg-info-row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px 14px;
	margin-top: auto;
}

.wcg-info-right {
	text-align: right;
	margin-left: auto;
}

.wcg-price-current {
	display: block;
	font-size: 20px;
	font-weight: 700;
	color: #1a1a2e;
	line-height: 1.2;
}

.wcg-price-rrp {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	font-weight: 400;
	color: #6b6b7c;
}

.wcg-price-rrp del {
	text-decoration: line-through;
}

.wcg-save-badge {
	display: inline-block;
	margin-top: 8px;
	padding: 5px 10px;
	border-radius: 6px;
	background: #e4032e;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.wcg-save-badge .amount {
	color: #fff;
}

/* ---------------------------------------------- delivery */
.wcg-divider {
	border-top: 1px solid #e6e6ec;
}

.wcg-delivery-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	font-size: 13px;
	color: #1a1a2e;
	line-height: 1.35;
}

.wcg-delivery-icon {
	display: inline-flex;
	flex: 0 0 auto;
	color: #1a1a2e;
}

/* ---------------------------------------------- swatches
   Collection Grid renders its own buttons (.wcg-swatch) with an
   inline background-color, plus its own "+N" overflow chip. They
   carry no dimensions of their own, so inside a flex row they
   stretch into tall ovals. Locked to circles here.
   ---------------------------------------------- */
.wcg-swatches {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
}

.wcg-swatch {
	width: 26px !important;
	height: 26px !important;
	min-width: 26px !important;
	max-width: 26px !important;
	min-height: 26px !important;
	max-height: 26px !important;
	flex: 0 0 auto !important;
	padding: 0 !important;
	border-radius: 50% !important;
	border: 1px solid rgba(0, 0, 0, .15) !important;
	box-sizing: border-box !important;
	cursor: pointer;
	appearance: none;
	background-clip: padding-box;
	transition: box-shadow .15s ease;
}

.wcg-swatch:hover {
	box-shadow: 0 0 0 2px rgba(43, 46, 82, .35);
}

.wcg-swatch.is-active {
	box-shadow: 0 0 0 2px #2b2e52;
}

.wcg-swatch-overflow {
	width: 26px;
	height: 26px;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #f1f1f4;
	color: #1a1a2e;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}

/* ---------------------------------------------- pagination */
.wcg-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 28px;
}

.wcg-page-btn {
	min-width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	border: 1px solid #e6e6ec;
	border-radius: 8px;
	background: #fff;
	color: #1a1a2e;
	font-weight: 600;
	text-decoration: none;
}

.wcg-page-btn.is-active {
	background: #2b2e52;
	border-color: #2b2e52;
	color: #fff;
}

/* ---------------------------------------------- mobile
   One card per row, image left / content right — the same
   horizontal card used on the shop grid.
   ---------------------------------------------- */
@media (max-width: 768px) {
	.wcg-grid,
	.wcg-products,
	.wcg-cards {
		display: grid !important;
		grid-template-columns: 1fr !important;
		gap: 14px !important;
	}

	.wcg-card {
		display: grid !important;
		grid-template-columns: 44% 1fr !important;
		grid-template-rows: auto auto auto !important;
		align-items: start;
	}

	.wcg-image-link {
		grid-column: 1;
		grid-row: 1 / 3;
	}

	/* display:contents dissolves the body wrapper so title, price
	   and the delivery row become direct grid children of the card.
	   Without this the delivery bar is trapped in the right-hand
	   column and cannot span the full card width. */
	.wcg-card-body {
		display: contents !important;
	}

	.wcg-title {
		grid-column: 2;
		grid-row: 1;
		margin: 14px 14px 0 18px;
		font-size: 15px;
		line-height: 21px !important;
		display: -webkit-box !important;
		-webkit-line-clamp: 3 !important;
		-webkit-box-orient: vertical !important;
		line-clamp: 3;
		overflow: hidden !important;
		max-height: 63px !important;
		min-height: 0;
	}

	.wcg-image-link {
		padding: 10px 0 10px 10px;
	}

	.wcg-badge {
		top: 18px;
		left: 18px;
	}

	.wcg-section-separator {
		display: none;
	}

	.wcg-info-row {
		grid-column: 2;
		grid-row: 2;
		display: block;
		padding: 8px 14px 12px 18px;
		margin-top: 0;
	}

	.wcg-info-right {
		text-align: left;
		margin-left: 0;
	}

	.wcg-price-current {
		font-size: 19px;
	}

	/* Delivery bar spans the full card width, under the image */
	.wcg-divider {
		grid-column: 1 / -1;
		grid-row: 3;
	}

	.wcg-delivery-row {
		grid-column: 1 / -1;
		grid-row: 3;
		padding: 10px 12px;
		font-size: 12px;
	}
}
