/* NoirMusk animated "Add to cart" pill button.
   Sequence: click → label slides out while the accent fill sweeps across → a cart rolls through
   and an item drops in → fill collapses to a check circle and "Done" slides in → resets. */

:root {
	--noirmusk-atc-bg: #1a1a1a;
	--noirmusk-atc-accent: #a3703f;
	--noirmusk-atc-text: #fff;
	--noirmusk-atc-item: #1a1a1a;
}

html body .noirmusk-atc,
html body ul.products li.product a.la-addcart.noirmusk-atc.button,
html body .single-product-article button.noirmusk-atc.single_add_to_cart_button {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-sizing: border-box;
	min-width: 176px;
	max-width: 100%;
	height: 50px;
	margin: 6px auto 0;
	padding: 0 30px !important;
	border: 1px solid var(--noirmusk-atc-bg) !important;
	border-radius: 4px !important;
	background: var(--noirmusk-atc-bg) !important;
	color: var(--noirmusk-atc-text) !important;
	font-family: var(--theme-body-font-family), 'Inter', sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none !important;
	text-align: center;
	white-space: nowrap;
	box-shadow: none !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.25s ease, border-color 0.2s ease;
}
html body .noirmusk-atc:hover,
html body ul.products li.product a.la-addcart.noirmusk-atc.button:hover,
html body .single-product-article button.noirmusk-atc.single_add_to_cart_button:hover {
	background: #000 !important;
	color: var(--noirmusk-atc-text) !important;
	box-shadow: none !important;
}
html body .noirmusk-atc:focus-visible {
	outline: 2px solid var(--noirmusk-atc-accent);
	outline-offset: 3px;
}
/* WooCommerce hides the button after an add and shows "View cart" — the "Done" state replaces that. */
html body ul.products li.product a.la-addcart.noirmusk-atc.button.added,
html body ul.products li.product a.la-addcart.noirmusk-atc.button.loading {
	display: inline-flex !important;
}
html body ul.products li.product a.la-addcart.noirmusk-atc.button::before,
html body ul.products li.product a.la-addcart.noirmusk-atc.button::after,
html body .noirmusk-atc.loading::before,
html body .noirmusk-atc.loading::after {
	display: none !important;
	content: none !important;
}
html body ul.products li.product .added_to_cart,
html body .single-product-article .added_to_cart {
	display: none !important;
}

/* Home grid cards are flex columns: pin the button to the bottom so every row lines up */
html body .noirmusk-home-products ul.products li.product a.la-addcart.noirmusk-atc.button {
	margin-top: auto;
}

/* Shop / category cards: same bottom alignment so buttons line up across a row */
html body.woocommerce-shop ul.products li.product,
html body.tax-product_cat ul.products li.product {
	display: flex;
	flex-direction: column;
}
html body.woocommerce-shop ul.products li.product .noirmusk-product-card__content,
html body.tax-product_cat ul.products li.product .noirmusk-product-card__content {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1 1 auto;
}
html body.woocommerce-shop ul.products li.product a.la-addcart.noirmusk-atc.button,
html body.tax-product_cat ul.products li.product a.la-addcart.noirmusk-atc.button {
	margin-top: auto;
}

/* Single product: sits next to the quantity box */
html body .single-product-article button.noirmusk-atc.single_add_to_cart_button {
	flex: 1 1 auto;
	width: auto;
	height: 56px;
	min-height: 56px;
	margin: 0;
}

/* Layers */
.noirmusk-atc .atc__label,
.noirmusk-atc .atc__done {
	position: relative;
	z-index: 2;
	display: block;
	line-height: 1;
	transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s ease;
}
.noirmusk-atc .atc__done {
	position: absolute;
	top: 50%;
	left: 0;
	right: 46px;
	margin-top: -8px;
	text-align: center;
	opacity: 0;
	transform: translateX(-28px);
	pointer-events: none;
}

.noirmusk-atc .atc__fill {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	background: var(--noirmusk-atc-accent);
	color: #fff;
	opacity: 0;
	clip-path: inset(7px 100% 7px 7px round 3px);
	/* on reset: fade out first, then snap the shape back */
	transition: opacity 0.25s ease, clip-path 0s linear 0.25s;
	pointer-events: none;
}
.noirmusk-atc .atc__check {
	position: absolute;
	top: 50%;
	right: 27px;
	margin-top: -7px;
	opacity: 0;
	transform: scale(0.4);
	transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.noirmusk-atc .atc__cart {
	position: absolute;
	top: 50%;
	left: -14%;
	z-index: 3;
	width: 24px;
	height: 24px;
	margin-top: -12px;
	color: #fff;
	opacity: 0;
	pointer-events: none;
}
.noirmusk-atc .atc__cart svg {
	display: block;
}
.noirmusk-atc .atc__dot {
	position: absolute;
	top: 3px;
	left: 46%;
	width: 6px;
	height: 6px;
	margin-left: -3px;
	border-radius: 50%;
	background: var(--noirmusk-atc-item);
	opacity: 0;
}

/* 1 — sweep: label out, fill in */
.noirmusk-atc.is-adding .atc__label,
.noirmusk-atc.is-carting .atc__label,
.noirmusk-atc.is-done .atc__label {
	opacity: 0;
	transform: translateX(70%);
}
.noirmusk-atc.is-adding .atc__fill,
.noirmusk-atc.is-carting .atc__fill {
	opacity: 1;
	clip-path: inset(0 0 0 0 round 3px);
	transition: clip-path 0.65s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.1s ease;
}

/* the button border follows the fill so no dark outline shows around the gold */
html body .noirmusk-atc.is-adding,
html body ul.products li.product a.la-addcart.noirmusk-atc.button.is-adding,
html body .single-product-article button.noirmusk-atc.single_add_to_cart_button.is-adding,
html body .noirmusk-atc.is-carting,
html body ul.products li.product a.la-addcart.noirmusk-atc.button.is-carting,
html body .single-product-article button.noirmusk-atc.single_add_to_cart_button.is-carting {
	border-color: var(--noirmusk-atc-accent) !important;
}

/* 2 — cart rolls through, item drops in */
.noirmusk-atc.is-carting .atc__cart {
	animation: noirmusk-atc-cart 1.5s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}
.noirmusk-atc.is-carting .atc__dot {
	animation: noirmusk-atc-dot 1.5s ease-in forwards;
}
@keyframes noirmusk-atc-cart {
	0%   { left: -14%; opacity: 1; }
	42%  { left: 42%; opacity: 1; }
	58%  { left: 46%; opacity: 1; }
	100% { left: 116%; opacity: 1; }
}
@keyframes noirmusk-atc-dot {
	0%, 30% { opacity: 0; transform: translateY(-16px); }
	40%     { opacity: 1; transform: translateY(-10px); }
	56%     { opacity: 1; transform: translateY(2px); }
	100%    { opacity: 1; transform: translateY(2px); }
}

/* 3 — done: fill collapses to a check circle, "Done" slides in */
.noirmusk-atc.is-done .atc__fill {
	opacity: 1;
	clip-path: inset(calc(50% - 14px) 20px calc(50% - 14px) calc(100% - 48px) round 999px);
	transition: clip-path 0.5s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.1s ease;
}
.noirmusk-atc.is-done .atc__check {
	opacity: 1;
	transform: scale(1);
	transition-delay: 0.3s;
}
.noirmusk-atc.is-done .atc__done {
	opacity: 1;
	transform: translateX(0);
	transition-delay: 0.15s;
}
.noirmusk-atc.is-busy {
	cursor: default;
}

@media (prefers-reduced-motion: reduce) {
	.noirmusk-atc .atc__label,
	.noirmusk-atc .atc__done,
	.noirmusk-atc .atc__fill,
	.noirmusk-atc .atc__check {
		transition-duration: 0.01s !important;
		transition-delay: 0s !important;
	}
	.noirmusk-atc.is-carting .atc__cart,
	.noirmusk-atc.is-carting .atc__dot {
		animation: none;
		opacity: 0;
	}
}
