/**
 * WC Product Badges - frontend styles
 */

:root {
	--wcpb-z-index: 10;
	--wcpb-gap: 6px;
	--wcpb-edge-gap: 10px;
}

/* Make sure the containers we hook into can host absolutely positioned badges. */
ul.products li.product,
.woocommerce-product-gallery {
	position: relative;
}

.wcpb-badges-wrap {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	z-index: var(--wcpb-z-index);
}

.wcpb-badge-group {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: var(--wcpb-gap);
	max-width: 70%;
}

.wcpb-position-top-left {
	top: var(--wcpb-edge-gap);
	left: var(--wcpb-edge-gap);
	align-items: flex-start;
}

.wcpb-position-top-right {
	top: var(--wcpb-edge-gap);
	right: var(--wcpb-edge-gap);
	align-items: flex-end;
}

.wcpb-position-bottom-left {
	bottom: var(--wcpb-edge-gap);
	left: var(--wcpb-edge-gap);
	align-items: flex-start;
}

.wcpb-position-bottom-right {
	bottom: var(--wcpb-edge-gap);
	right: var(--wcpb-edge-gap);
	align-items: flex-end;
}

.wcpb-badge {
	pointer-events: auto;
	transform-origin: top left;
}

.wcpb-position-top-right .wcpb-badge,
.wcpb-position-bottom-right .wcpb-badge {
	transform-origin: top right;
}

.wcpb-badge-text {
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: 3px;
	line-height: 1.5;
	white-space: nowrap;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.wcpb-badge-image {
	display: inline-block;
	line-height: 0;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.wcpb-badge-image img {
	display: block;
	max-width: 64px;
	height: auto;
}
