/* Add to Cart & Buy Now for WooCommerce — frontend styles. */

.elementor-widget-atcbn-add-to-cart .elementor-widget-container,
.elementor-widget-atcbn-buy-now .elementor-widget-container {
	width: 100%;
	display: flex;
	flex-direction: column;
}

.elementor-widget-atcbn-add-to-cart,
.elementor-widget-atcbn-buy-now {
	width: 100%;
}

.atcbn-wrap {
	position: relative;
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	max-width: 100%;
	box-sizing: border-box;
}

.atcbn-wrap * {
	box-sizing: border-box;
}

.atcbn-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	max-width: 100%;
	padding: 12px 22px;
	border: 1px solid transparent;
	border-radius: 4px;
	background-color: #2b2d42;
	color: #fff;
	font: inherit;
	line-height: 1.3;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.3s ease;
}

.atcbn-button:hover {
	opacity: 0.9;
}

.atcbn-wrap .atcbn-button.atcbn-out-of-stock,
.atcbn-wrap .atcbn-button.atcbn-out-of-stock:hover,
.atcbn-wrap .atcbn-button.atcbn-out-of-stock:focus,
.atcbn-wrap .atcbn-button.atcbn-out-of-stock:focus-visible,
.atcbn-wrap .atcbn-button.atcbn-out-of-stock:active,
.atcbn-wrap .atcbn-button:disabled {
	opacity: 0.45 !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
	box-shadow: none !important;
	transform: none !important;
}

.atcbn-icon {
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

.atcbn-icon svg {
	width: 1em;
	height: 1em;
}

/* Stretch position */
.atcbn-pos-stretch .atcbn-wrap {
	flex-wrap: nowrap;
}

.atcbn-pos-stretch .atcbn-button {
	width: 100%;
	flex: 1 1 auto;
}

@media (max-width: 1024px) {
	.atcbn-pos-tablet-stretch .atcbn-wrap { flex-wrap: nowrap; }
	.atcbn-pos-tablet-stretch .atcbn-button { width: 100%; flex: 1 1 auto; }
}

@media (max-width: 767px) {
	.atcbn-pos-mobile-stretch .atcbn-wrap { flex-wrap: nowrap; }
	.atcbn-pos-mobile-stretch .atcbn-button { width: 100%; flex: 1 1 auto; }
}

/* Quantity stepper */
.atcbn-wrap .atcbn-qty {
	display: inline-flex;
	align-items: stretch;
	width: auto;
	height: auto;
	min-height: 0;
	min-width: min-content;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid #d8dade;
	border-radius: 4px;
	background-color: #fff;
	overflow: hidden;
}

.atcbn-wrap .atcbn-qty button.atcbn-qty-btn {
	flex: 0 1 auto;
	align-self: stretch;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	margin: 0 !important;
	padding: 10px 12px;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	background-image: none !important;
	color: #2b2d42;
	font-size: 14px;
	font-weight: 500;
	line-height: 1 !important;
	text-align: center !important;
	text-indent: 0 !important;
	letter-spacing: 0 !important;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none !important;
	transition: color 0.2s ease, background-color 0.2s ease, border-radius 0.2s ease;
}

.atcbn-wrap .atcbn-qty button.atcbn-qty-btn .atcbn-qty-icon {
	display: block;
	width: 1em;
	height: 1em;
	max-width: none;
	flex-shrink: 0;
	pointer-events: none;
}

.atcbn-wrap .atcbn-qty button.atcbn-qty-btn:hover {
	background-color: #f1f2f4;
}

.atcbn-wrap .atcbn-qty input.atcbn-qty-input {
	width: 48px;
	min-width: 24px;
	height: auto !important;
	min-height: 0 !important;
	max-height: none;
	padding: 0 !important;
	margin: 0 !important;
	flex: 0 0 auto;
	align-self: stretch;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	background-image: none !important;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	text-align: center !important;
	text-indent: 0 !important;
	box-shadow: none !important;
	-moz-appearance: textfield;
	appearance: textfield;
}

.atcbn-wrap .atcbn-qty input.atcbn-qty-input::-webkit-outer-spin-button,
.atcbn-wrap .atcbn-qty input.atcbn-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.atcbn-wrap .atcbn-qty :is(button, input):is(:focus, :focus-visible, :active) {
	outline: none !important;
	box-shadow: none !important;
}

/*
 * Flexible / full-width quantity box.
 *
 * Applied when the "Box Width" control is set to Full Width (100%) and always
 * in replace mode, so the quantity box occupies exactly the same width as the
 * Add to Cart button it replaces.
 */
.atcbn-wrap .atcbn-qty.atcbn-qty-full,
.atcbn-wrap.atcbn-replace .atcbn-qty {
	display: flex;
	width: 100%;
	flex: 1 1 100%;
	max-width: 100%;
}

.atcbn-wrap .atcbn-qty.atcbn-qty-full input.atcbn-qty-input,
.atcbn-wrap .atcbn-qty.atcbn-qty-custom input.atcbn-qty-input,
.atcbn-wrap.atcbn-replace .atcbn-qty input.atcbn-qty-input {
	flex: 1 1 0% !important;
	width: 0 !important;
	min-width: 24px !important;
}

.atcbn-wrap .atcbn-qty.atcbn-qty-full button.atcbn-qty-btn,
.atcbn-wrap .atcbn-qty.atcbn-qty-custom button.atcbn-qty-btn,
.atcbn-wrap.atcbn-replace .atcbn-qty button.atcbn-qty-btn {
	flex: 0 1 auto;
}

.atcbn-wrap .atcbn-qty.atcbn-qty-custom {
	display: flex;
	min-width: min-content;
	max-width: 100%;
}

/* Stretch position: full-width quantity box shares the row with the button. */
.atcbn-pos-stretch .atcbn-wrap .atcbn-qty.atcbn-qty-full {
	flex: 1 1 auto;
}

/* Loading overlay */
.atcbn-overlay {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background-color: rgba(255, 255, 255, 0.75);
	border-radius: 4px;
	z-index: 5;
}

.atcbn-loading .atcbn-overlay {
	display: flex;
}

.atcbn-spin i,
.atcbn-spin svg {
	animation: atcbn-spin 0.8s linear infinite;
}

.atcbn-pulse i,
.atcbn-pulse svg {
	animation: atcbn-pulse 0.8s ease-in-out infinite;
}

.atcbn-bounce i,
.atcbn-bounce svg {
	animation: atcbn-bounce 0.8s ease-in-out infinite;
}

@keyframes atcbn-spin {
	to { transform: rotate(360deg); }
}

@keyframes atcbn-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(0.75); opacity: 0.6; }
}

@keyframes atcbn-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-6px); }
}

/* Toast */
.atcbn-toast-wrap {
	position: fixed;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
	padding: 20px;
}

.atcbn-toast-top-left { top: 0; left: 0; align-items: flex-start; }
.atcbn-toast-top-center { top: 0; left: 50%; transform: translateX(-50%); align-items: center; }
.atcbn-toast-top-right { top: 0; right: 0; align-items: flex-end; }
.atcbn-toast-bottom-left { bottom: 0; left: 0; align-items: flex-start; }
.atcbn-toast-bottom-center { bottom: 0; left: 50%; transform: translateX(-50%); align-items: center; }
.atcbn-toast-bottom-right { bottom: 0; right: 0; align-items: flex-end; }

.atcbn-toast {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: min(92vw, 420px);
	padding: 12px 18px;
	border-radius: 6px;
	background-color: #0f9d58;
	color: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	opacity: 0;
	transition: all 0.3s ease;
}

.atcbn-toast .atcbn-toast-icon,
.atcbn-toast .atcbn-toast-icon i {
	display: inline-flex;
	line-height: 1;
}

.atcbn-anim-slide { transform: translateY(-12px); }
.atcbn-anim-zoom { transform: scale(0.85); }

.atcbn-toast.is-visible {
	opacity: 1;
	transform: none;
}

/* Editor notice */
.atcbn-notice {
	padding: 12px 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	color: #6b6f76;
	font-size: 13px;
}

@media (max-width: 480px) {
	.atcbn-wrap { gap: 8px; }
}

/* Fly to cart */
.atcbn-fly-clone {
	position: fixed;
	z-index: 999999;
	pointer-events: none;
	border-radius: 50%;
	object-fit: cover;
	opacity: 0.95;
	will-change: transform, opacity, width, height;
	transition-property: top, left, width, height, opacity, transform;
	transition-timing-function: cubic-bezier(0.35, 0.15, 0.3, 1);
}

.atcbn-cart-bump {
	animation: atcbn-bump 0.4s ease;
}

@keyframes atcbn-bump {
	0%, 100% { transform: scale(1); }
	40% { transform: scale(1.25); }
}

/* Live price feedback in replace mode ------------------------------- */
.atcbn-wrap.atcbn-syncing .atcbn-qty { opacity: .92; }
.atcbn-wrap.atcbn-syncing .atcbn-qty-btn { cursor: progress; }

.atcbn-price-updated,
.atcbn-price-updated del,
.atcbn-price-updated ins {
	display: inline-block;
	white-space: nowrap;
}

/* Quantity stepper loading state ------------------------------------- */
.atcbn-qty.atcbn-qty-loading {
	position: relative;
	pointer-events: none;
}

.atcbn-qty.atcbn-qty-loading > * {
	opacity: .45;
}

.atcbn-qty.atcbn-qty-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: atcbn-spin .6s linear infinite;
}


/* ---------------------------------------------------------------
 * Variation swatches (1.4.0)
 * ------------------------------------------------------------- */
.atcbn-variations {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	margin-bottom: 12px;
}

.atcbn-var-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.atcbn-var-label {
	font-weight: 600;
	font-size: 0.9em;
}

.atcbn-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.atcbn-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	padding: 8px 14px;
	border: 1px solid #d0d3db;
	border-radius: 4px;
	background-color: #fff;
	color: #2b2d42;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: all 0.2s ease;
}

.atcbn-swatch:hover,
.atcbn-swatch.is-selected {
	border-color: #2b2d42;
	background-color: #2b2d42;
	color: #fff;
}

.atcbn-swatch:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.atcbn-swatch.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
	text-decoration: none;
}

.atcbn-swatch.is-disabled::after {
	position: absolute;
	top: 50%;
	left: 10%;
	width: 80%;
	height: 1px;
	background: currentColor;
	content: '';
	transform: rotate(-45deg);
	transform-origin: center;
	pointer-events: none;
}

.atcbn-variations.atcbn-shake {
	animation: atcbn-shake 0.5s ease;
}

@keyframes atcbn-shake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-5px); }
	40%, 80% { transform: translateX(5px); }
}

/* Full-width stock notice leaves the original quantity/button row intact. */
.atcbn-wrap > .atcbn-stock-notice {
	--atcbn-stock-error: #dc2626;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	flex: 0 0 100%;
	min-width: 0;
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--atcbn-stock-error);
	animation: atcbn-stock-reveal .18s ease-out;
}
.atcbn-wrap > .atcbn-stock-notice[hidden] { display: none !important; }
.atcbn-wrap .atcbn-stock-notice-text { min-width: 0; overflow-wrap: anywhere; }
.atcbn-wrap .atcbn-stock-notice-icon { display: inline-flex; align-items: center; flex-shrink: 0; font-size: 16px; line-height: 1; }
.atcbn-wrap .atcbn-stock-notice-icon svg { width: 1em; height: 1em; flex-shrink: 0; fill: currentColor; }
.atcbn-wrap .atcbn-stock-notice-icon svg path { fill: currentColor; }
.atcbn-pos-stretch .atcbn-wrap:has(> .atcbn-stock-notice:not([hidden])) { flex-wrap: wrap; }
@media (max-width: 1024px) {
	.atcbn-pos-tablet-stretch .atcbn-wrap:has(> .atcbn-stock-notice:not([hidden])) { flex-wrap: wrap; }
}
@media (max-width: 767px) {
	.atcbn-pos-mobile-stretch .atcbn-wrap:has(> .atcbn-stock-notice:not([hidden])) { flex-wrap: wrap; }
}
@keyframes atcbn-stock-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .atcbn-wrap > .atcbn-stock-notice { animation: none; } }
