/* Availability text must remain readable on the dark purchase form. */
html body.single-product.woocommerce .wmw-single-product .stock {
	color: #b1000b !important;
	background: transparent !important;
	position: static !important;
	width: auto;
	height: auto;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	font-family: 'Golos Text', sans-serif !important;
	font-weight: 700;
	line-height: 1.5;
	text-transform: uppercase;
}

body.single-product .wp-block-woocommerce-product-image-gallery.wmw-stock-gallery {
	position: relative;
	z-index: 0;
}

.wmw-product-badges {
	position: absolute;
	top: var(--wmw-badges-top, 20px);
	right: var(--wmw-badges-right, 20px);
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	max-width: calc(var(--wmw-product-image-width, 100%) - 40px);
	pointer-events: none;
}

.wmw-low-stock-badge {
	order: 0;
	box-sizing: border-box;
	padding: 0 12px;
	border-radius: 999px;
	background: #b1000b;
	color: #fff;
	font-family: var(--wp--preset--font-family--unbounded, 'Unbounded', sans-serif);
	font-size: 13px;
	font-style: normal;
	font-weight: 900;
	line-height: 27px;
	letter-spacing: 0.339px;
	white-space: nowrap;
	text-transform: uppercase;
}

.wmw-low-stock-badge[hidden] {
	display: none !important;
}

html body .wmw-product-badges > .onsale {
	order: 1;
	position: static !important;
	inset: auto !important;
	margin: 0 !important;
	float: none;
	transform: none;
}

html body :is(.onsale, .wc-block-components-product-sale-badge, .wc-block-grid__product-onsale) {
	background: #cdff09 !important;
	color: #000 !important;
	font-family: var(--wp--preset--font-family--unbounded, 'Unbounded', sans-serif) !important;
}

.wmw-card-image,
.woocommerce ul.products li.product:has(.wmw-card-badges) {
	position: relative;
	z-index: 0;
	container-type: inline-size;
}

/* Inline-size containment needs a real width on the legacy inline-block image. */
.wc-block-grid__product-image.wmw-card-image {
	display: block;
	width: 100%;
}

/* The shared stack replaces the block's optional built-in sale label. */
.wmw-card-image .wp-block-woocommerce-product-sale-badge {
	display: none !important;
}

.wmw-card-badges > :is(.wmw-low-stock-badge, .onsale) {
	box-sizing: border-box;
	min-height: 0;
	height: auto;
	font-size: clamp(8px, 5cqi, 13px);
	font-style: normal;
	font-weight: 900;
	line-height: 27px;
	letter-spacing: 0.339px;
	padding: 0 clamp(4px, 3cqi, 12px);
	border-radius: 999px;
	white-space: nowrap;
}

/* Keep the zoom control below the badges, inside the main image's bounds. */
html body.single-product.woocommerce .wmw-stock-gallery .woocommerce-product-gallery__trigger {
	top: auto !important;
	bottom: var(--wmw-gallery-zoom-bottom, 24px) !important;
	right: var(--wmw-gallery-zoom-right, 24px) !important;
}

@media (max-width: 600px) {
	body.single-product .wmw-stock-gallery .wmw-low-stock-badge {
		padding-inline: 10px;
		font-size: clamp(10px, 3.333vw, 13px);
	}
}
