:root {
	--wfpb-green: #16a34a;
	--wfpb-green-dark: #166534;
	--wfpb-green-soft: #ecfdf3;
	--wfpb-green-border: #bbf7d0;
}

.woocommerce ul.products li.product,
.wc-block-product,
.wc-block-grid__product,
.product-grid-item,
.product-small,
.product-item,
.products .item.product,
.item-area {
	position: relative;
}

.wfpb-badge {
	direction: rtl;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	box-sizing: border-box;
	width: max-content;
	max-width: 100%;
	padding: 6px 10px;
	color: var(--wfpb-green-dark);
	background: rgba(236, 253, 243, 0.96);
	border: 1px solid var(--wfpb-green-border);
	border-radius: 999px;
	box-shadow: 0 5px 16px rgba(22, 101, 52, 0.11);
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	vertical-align: middle;
}

.wfpb-badge__dot {
	position: relative;
	display: inline-block;
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	background: var(--wfpb-green);
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.13);
	animation: wfpb-pulse 2s ease-out infinite;
}

.wfpb-badge--card {
	position: static !important;
	display: flex;
	clear: both;
	width: max-content;
	max-width: 100%;
	margin: 4px 0 2px auto;
	padding: 3px 7px;
	gap: 5px;
	font-size: 9px;
	font-weight: 700;
	line-height: 1.45;
	box-shadow: none;
	pointer-events: none;
}

/* Exact placement for the active buffalo33 product-card template. */
.product-detail-area > .wfpb-badge--card {
	margin-top: 3px;
	margin-right: 0;
	margin-left: auto;
}

.product-detail-area .price.wfpb-price-with-badge > .wfpb-badge--card {
	position: static !important;
	inset: auto !important;
	display: flex !important;
	float: none !important;
	clear: both !important;
	width: max-content !important;
	height: auto !important;
	margin: 4px 0 0 auto !important;
	transform: none !important;
}

.wfpb-badge--card .wfpb-badge__dot {
	flex-basis: 6px;
	width: 6px;
	height: 6px;
	box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}

.wfpb-badge--single {
	display: flex;
	margin: 2px 0 14px;
	padding: 7px 12px;
	font-size: 13px;
}

.wfpb-badge--block {
	margin: 7px 0 3px;
}

@keyframes wfpb-pulse {
	0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.42); }
	70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
	100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

@media (max-width: 480px) {
	.wfpb-badge--card {
		position: static !important;
		inset: auto !important;
		float: none !important;
		margin: 3px 0 0 auto !important;
		padding: 2px 6px;
		gap: 4px;
		font-size: 8px;
		transform: none !important;
	}
}

/*
 * Buffalo33 two-column mobile cards: keep the cart row completely untouched.
 * The badge is visually placed below the price without participating in flex sizing.
 */
@media (max-width: 767px) {
	.item-area.elm_pg_3 .product-detail-area .price.wfpb-price-with-badge {
		position: relative !important;
		overflow: visible !important;
	}

	.item-area.elm_pg_3 .product-detail-area .price.wfpb-price-with-badge > .wfpb-badge--card {
		position: absolute !important;
		top: calc(100% + 4px) !important;
		right: 0 !important;
		bottom: auto !important;
		left: auto !important;
		z-index: 2;
		float: none !important;
		margin: 0 !important;
		transform: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wfpb-badge__dot {
		animation: none;
	}
}
