/**
 * Handcrafted watermark — Chesterfield product images only.
 * Top-right overlay on the main/first image.
 */

/* PDP: featured / first gallery image */
body.single-product.rs-chesterfield-pdp .woocommerce-product-gallery__image:has(img.wp-post-image),
body.single-product.rs-chesterfield-pdp .woocommerce-product-gallery__image:has(img.wp-post-image) .product-image-wrap,
body.single-product.rs-chesterfield-pdp .woocommerce-product-gallery__image:has(img.wp-post-image) > a {
	position: relative;
}

body.single-product.rs-chesterfield-pdp .woocommerce-product-gallery__image:has(img.wp-post-image)::after {
	content: "";
	position: absolute;
	top: 2.5%;
	right: 2.5%;
	z-index: 4;
	width: 40%;
	min-width: 288px;
	max-width: 480px;
	aspect-ratio: 480 / 161;
	pointer-events: none;
	background-image: image-set(
		url("../img/handcrafted-watermark.webp") type("image/webp") 1x,
		url("../img/handcrafted-watermark@2x.webp") type("image/webp") 2x
	);
	background-repeat: no-repeat;
	background-position: top right;
	background-size: contain;
	opacity: 0.92;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
}

/* Archive / related / shop cards */
.product-grid-item.rs-chesterfield-product .product-element-top,
.product-grid-item.rs-chesterfield-product .wd-product-img-wrap,
.product-grid-item.rs-chesterfield-product .product-image-link {
	position: relative;
}

.product-grid-item.rs-chesterfield-product .product-image-link::after,
.product-grid-item.rs-chesterfield-product .wd-product-img-wrap::after {
	content: "";
	position: absolute;
	top: 2.5%;
	right: 2.5%;
	z-index: 3;
	width: 72%;
	min-width: 224px;
	max-width: 384px;
	aspect-ratio: 480 / 161;
	pointer-events: none;
	background-image: image-set(
		url("../img/handcrafted-watermark.webp") type("image/webp") 1x,
		url("../img/handcrafted-watermark@2x.webp") type("image/webp") 2x
	);
	background-repeat: no-repeat;
	background-position: top right;
	background-size: contain;
	opacity: 0.92;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Prefer the link overlay; avoid double marks when both wrappers match */
.product-grid-item.rs-chesterfield-product .wd-product-img-wrap:has(.product-image-link)::after {
	content: none;
}

@media (max-width: 640px) {
	body.single-product.rs-chesterfield-pdp .woocommerce-product-gallery__image:has(img.wp-post-image)::after {
		width: 56%;
		min-width: 256px;
		max-width: 400px;
	}

	.product-grid-item.rs-chesterfield-product .product-image-link::after,
	.product-grid-item.rs-chesterfield-product .wd-product-img-wrap::after {
		width: 88%;
		min-width: 208px;
		max-width: 336px;
	}
}
