.bl-ebook-ribbon {
	--bl-corner-width: max(64px, 33%);
	position: absolute;
	top: 0;
	right: 0;
	z-index: 3;
	width: var(--bl-corner-width);
	aspect-ratio: 1;
	container-type: inline-size;
	background: #b84b00;
	clip-path: polygon(0 0, 100% 0, 100% 100%);
	pointer-events: none;
}
.bl-ebook-ribbon > span {
	position: absolute;
	top: 38%;
	left: 62%;
	transform: translate(-50%, -50%) rotate(45deg);
	color: #fff;
	font: 700 max(11px, 17cqw)/1.1 sans-serif;
	white-space: nowrap;
}
.bl-series-cover:has(.bl-ebook-ribbon),
.bl-pair-cover:has(.bl-ebook-ribbon),
.woocommerce-loop-product__link:has(.bl-ebook-ribbon) { position: relative; }
.woocommerce-loop-product__link:has(.bl-ebook-ribbon) { display: block; }
.wd-product-img-link:has(> .bl-ebook-ribbon),
.woocommerce-product-gallery__image > a:has(> .bl-ebook-ribbon) {
	position: relative;
	display: block;
	width: fit-content;
	max-width: 100%;
	margin-inline: auto;
}
/* Preserve the cover aspect ratio when the theme also caps the image height. */
:is(.wd-product-img-link, .woocommerce-product-gallery__image > a):has(> .bl-ebook-ribbon) > img:first-of-type {
	display: block;
	width: auto;
	height: auto;
}
.woocommerce-product-gallery__image .bl-ebook-ribbon { --bl-corner-width: 33%; }
.single-product .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image .bl-ebook-ribbon { --bl-corner-width: 36%; }
/* The right-hand WoodMart actions share the cover's top edge on hover. */
.wd-product-thumb:has(.bl-ebook-ribbon) > .wd-buttons.wd-pos-r-t { margin-top: max(64px, 33%); }
.bl-series-cover:has(.bl-ebook-ribbon) { width: fit-content; max-width: min(95px, 100%); }
.bl-series-cover:has(.bl-ebook-ribbon) > img { width: auto; height: auto; max-height: 124px; }
:is(.bl-series-cover, .bl-pair-cover) .bl-ebook-ribbon {
	width: auto;
	aspect-ratio: auto;
	container-type: normal;
	clip-path: none;
	padding: 2px 4px;
	line-height: 1;
}
:is(.bl-series-cover, .bl-pair-cover) .bl-ebook-ribbon > span {
	position: static;
	transform: none;
	display: block;
	font-size: 10px;
}
form.cart:has(.bl-ebook-info), .woocommerce-variation-add-to-cart:has(.bl-ebook-info) { flex-wrap: wrap; }
.bl-ebook-info {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: max-content 1fr;
	align-items: center;
	gap: 3px 10px;
	width: 100%;
	flex: 0 0 100%;
	margin: 0 0 12px;
	padding: 10px 14px;
	border-inline-start: 3px solid #b84b00;
	background: #fff5eb;
	color: #432b1a;
	line-height: 1.4;
	text-align: start;
}
.bl-ebook-info > span:not(.bl-ebook-label) { grid-column: 1 / -1; }
.bl-ebook-label { padding: 2px 7px; background: #b84b00; color: white; border-radius: 3px; font-size: .85em; }
.bl-ebook-item-label { display: inline-block; margin-inline-start: .35em; font-weight: 600; white-space: nowrap; }
.bl-ebook-item-row { display: block; flex-basis: 100%; }
.bl-ebook-item-row > .bl-ebook-item-label { margin-inline-start: 0; }
.wd-free-progress-bar:has(.bl-no-shipping-progress),
.wd-shipping-progress-bar:has(.bl-no-shipping-progress) { display: none; }
.bl-ebook-warning { margin: 0 0 12px; padding: 12px 16px; background: #fff2bd; color: #493910; border-inline-start: 4px solid #ba8c19; text-align: start; }
.bl-ebook-warning[hidden] { display: none; }
