/* T4 badges: over the top corner (start side) of the image, at most 2. On cards a long text keeps to 2 lines. */
ul.products li.product,
.wc-block-grid__product,
.wc-block-product,
.wp-block-woocommerce-product-image-gallery {
	position: relative;
}

.eikst-badges {
	position: absolute;
	inset-block-start: 8px;
	inset-inline-start: 8px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	max-width: calc(100% - 16px);
	pointer-events: none;
}

.single-product div.product {
	position: relative;
}

/* Product page, side-by-side layout: the badges stay over the gallery and off the title. */
@media (min-width: 768px) {
	.single-product div.product > .eikst-badges {
		max-width: calc(40% - 16px);
	}
}

.eikst-badge {
	display: inline-block;
	box-sizing: border-box;
	max-width: 100%;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	text-align: start;
	overflow-wrap: anywhere;
}

/* The block "Sale" badge is replaced too (the class twice: WooCommerce's own rule may load later). */
.wc-block-components-product-sale-badge.wc-block-components-product-sale-badge {
	display: none;
}

/* Cards: a long text keeps to 2 lines (the full text is on the product page). */
ul.products li.product .eikst-badge,
.wc-block-grid__product .eikst-badge,
.wc-block-product .eikst-badge {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}
