/* 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-button:disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

.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-qty {
	display: inline-flex;
	align-items: center;
	width: auto;
	box-sizing: border-box;
	border: 1px solid #d8dade;
	border-radius: 4px;
	background-color: #fff;
	overflow: hidden;
	max-width: 100%;
}

.atcbn-qty-btn {
	flex: 0 0 auto;
	align-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #2b2d42;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: all 0.2s ease;
}

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

.atcbn-qty-input {
	width: 48px;
	min-width: 0;
	padding: 0;
	flex: 0 0 auto;
	align-self: center;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

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

.atcbn-qty-input:focus {
	outline: none;
}

/*
 * 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-qty.atcbn-qty-full,
.atcbn-replace .atcbn-qty {
	display: flex;
	width: 100%;
	flex: 1 1 100%;
	max-width: 100%;
}

.atcbn-qty.atcbn-qty-full .atcbn-qty-input,
.atcbn-replace .atcbn-qty .atcbn-qty-input {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0;
}

.atcbn-qty.atcbn-qty-full .atcbn-qty-btn,
.atcbn-replace .atcbn-qty .atcbn-qty-btn {
	flex: 0 0 auto;
}

/* Percentage / custom width boxes still keep a stretching input. */
.atcbn-qty.atcbn-qty-custom .atcbn-qty-input {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0;
}

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

/* Stretch position: quantity box shares the row with the button. */
.atcbn-pos-stretch .atcbn-qty.atcbn-qty-full,
.atcbn-pos-stretch .atcbn-qty.atcbn-qty-custom {
	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;
}

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