.woocommerce-product-gallery__image { position: relative; }

/* Grid wrapper around the loop image and badge. Hugs the image width so the
   badge sits on the image corners. */
.cwp-sale-badge-wrap {
	position: relative;
	display: block;
	width: fit-content;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	line-height: 0;
}

.cwp-sale-badge {
	position: absolute;
	display: block;
	z-index: 5;
	pointer-events: none;
	line-height: 0;
	margin: 0;
	padding: 0;
}

/* Win specificity over storefront-child's `ul.products img` rule. */
.cwp-sale-badge .cwp-sale-badge__img,
ul.products .cwp-sale-badge .cwp-sale-badge__img,
.woocommerce-product-gallery__image .cwp-sale-badge .cwp-sale-badge__img {
	position: static;
	top: auto;
	left: auto;
	right: auto;
	bottom: auto;
	width: 100%;
	height: auto;
	max-width: 100%;
	max-height: none;
	min-width: 0;
	min-height: 0;
	transform: none;
	box-shadow: none;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	display: block;
}

.cwp-sale-badge--top-left     { top: 0;    left: 0;    }
.cwp-sale-badge--top-right    { top: 0;    right: 0;   }
.cwp-sale-badge--bottom-left  { bottom: 0; left: 0;    }
.cwp-sale-badge--bottom-right { bottom: 0; right: 0;   }
