/* WRAPPER */
.rzq-quantity-wrapper {
	position: relative;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	max-width: 100%;
	vertical-align: middle;
}

/* FIX FOR ELEMENTOR JUSTIFIED ALIGNMENT */
.elementor-add-to-cart--align-justify .rzq-quantity-wrapper {
	width: 100%;
	display: flex;
}
.elementor-add-to-cart--align-justify .rzq-quantity-wrapper .add_to_cart_button {
	width: 100%;
}

/* ORIGINAL BUTTON STYLES & TRANSITION */
.rzq-quantity-wrapper .add_to_cart_button {
	transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* WHEN ADDED TO CART: HIDE ORIGINAL BUTTON */
.rzq-quantity-wrapper.has-qty .add_to_cart_button {
	display: none !important;
}

/* WOOCOMMERCE VIEW CART LINK FIX */
.rzq-quantity-wrapper .added_to_cart {
	display: none !important;
}

/* CUSTOM QTY BOX */
.rzq-quantity-wrapper .rzq-qty-box {
	display: none !important; /* Hidden by default in normal flow */
	position: relative !important;
	align-items: center !important;
	border: 1px solid #008000 !important;
	background: #fff !important;
	border-radius: 8px !important;
	overflow: hidden !important;
	padding: 0 !important;
	margin: 0 auto !important; /* Centers within wrapper if full width */
	width: max-content !important;
	height: auto !important;
	
	/* Animation States */
	opacity: 0;
	transform: scale(0.96);
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 10;
}

/* SHOW QTY BOX WHEN HAS-QTY CLASS IS PRESENT */
.rzq-quantity-wrapper.has-qty .rzq-qty-box {
	display: flex !important;
	opacity: 1;
	transform: scale(1);
}

/* QTY BUTTONS (+ / -) */
.rzq-quantity-wrapper .rzq-qty-btn {
	flex: 0 0 38px !important;
	width: 38px !important;
	height: 38px !important;
	border: none !important;
	background: #008000 !important;
	border-radius: 6px !important;
	font-size: 24px !important;
	color: #fff !important;
	cursor: pointer !important;
	transition: 0.25s !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
}

.rzq-quantity-wrapper .rzq-qty-btn:hover {
	background: #006400 !important;
	color: #fff !important;
	border: none !important;
}

/* QTY VALUE TEXT */
.rzq-quantity-wrapper .rzq-qty-val {
	flex: 1 1 auto !important;
	min-width: 40px !important;
	text-align: center !important;
	font-size: 18px !important;
	font-weight: normal !important;
	color: #222 !important;
	user-select: none !important;
	background: transparent !important;
	border: none !important;
	outline: none !important;
	padding: 0 5px !important;
	margin: 0 !important;
}

/* LOADING SPINNER OVERLAY */
.rzq-quantity-wrapper.is-loading .rzq-qty-box::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.6);
	z-index: 15;
}
.rzq-quantity-wrapper.is-loading::before {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	width: 20px; height: 20px;
	margin-top: -10px; margin-left: -10px;
	border: 2px solid #008000;
	border-top-color: transparent;
	border-radius: 50%;
	animation: rzq-spin 0.6s linear infinite;
	z-index: 20;
}
@keyframes rzq-spin { 100% { transform: rotate(360deg); } }
