/* Al Mahjar Core — product cards: the cart button of a product already in the cart, in green with how many (cart-state.js).
   Colour and a badge only: the button still does what the theme or WooCommerce makes it do (quick view, add, options). */
:where(.quick-add-button.almahjar-in-cart, a.add_to_cart_button.almahjar-in-cart) {
	position: relative;
} /* :where: the badge needs a positioned parent, but a card layout's own position (over the photo) must win */
.quick-add-button.almahjar-in-cart > a,
.quick-add-button.almahjar-in-cart > .button,
a.add_to_cart_button.almahjar-in-cart {
	background: #1f8a4c !important;
	border-color: #1f8a4c !important;
	color: #fff !important;
}
.quick-add-button.almahjar-in-cart > a svg,
a.add_to_cart_button.almahjar-in-cart svg {
	color: #fff;
}
.quick-add-button.almahjar-in-cart::after,
a.add_to_cart_button.almahjar-in-cart::after {
	content: attr(data-almahjar-n);
	position: absolute;
	top: -5px;
	right: -5px;
	z-index: 1;
	box-sizing: border-box;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #fff;
	color: #1f8a4c;
	font:
		700 11px/18px system-ui,
		sans-serif;
	text-align: center;
	box-shadow: 0 0 0 2px #1f8a4c;
	pointer-events: none;
}
/* at its "Maximum per order": the same green, the badge says so with a tick */
.quick-add-button.almahjar-cart-full::after,
a.add_to_cart_button.almahjar-cart-full::after {
	content: "✓ " attr(data-almahjar-n);
}
[dir="rtl"] .quick-add-button.almahjar-in-cart::after,
[dir="rtl"] a.add_to_cart_button.almahjar-in-cart::after {
	right: auto;
	left: -5px;
}
@media (prefers-reduced-motion: no-preference) {
	.quick-add-button.almahjar-in-cart > a,
	a.add_to_cart_button.almahjar-in-cart {
		transition:
			background-color 0.2s,
			color 0.2s;
	}
}
