/**
 * Quantity Cart Drawer - Stili
 * Coerente con design Organics Pharm:
 * Font: Manrope | Primary: #1B1B1B | Secondary: #7A7A7A | Accent: #000 | Border-radius: 0
 */

/* Wrapper quantità */
.qcd-quantity-wrapper {
	display: inline-flex;
	align-items: center;
	gap: 0;
	border: 1px solid #1B1B1B;
	border-radius: 0;
	overflow: hidden;
	margin: 4px 0 0;
	height: 30px;
	font-family: "Manrope", sans-serif;
	box-sizing: border-box;
	vertical-align: middle;
}

/* Pulsanti +/- */
.qcd-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 100%;
	border: none;
	background: transparent;
	color: #1B1B1B;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	margin: 0;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	font-family: "Manrope", sans-serif;
	box-sizing: border-box;
	flex-shrink: 0;
}

.qcd-btn:hover {
	background: #1B1B1B;
	color: #fff;
}

.qcd-btn:active {
	background: #000;
	color: #fff;
}

.qcd-btn.qcd-minus {
	border-right: 1px solid #1B1B1B;
}

.qcd-btn.qcd-plus {
	border-left: 1px solid #1B1B1B;
}

/* Valore quantità */
.qcd-qty-value {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 100%;
	font-size: 13px;
	font-weight: 600;
	color: #1B1B1B;
	text-align: center;
	background: #fff;
	padding: 0 2px;
	user-select: none;
	-webkit-user-select: none;
	font-family: "Manrope", sans-serif;
}

/* Prezzo articolo */
.qcd-item-price {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: #1B1B1B;
	font-family: "Manrope", sans-serif;
}

/* Stato di caricamento */
.qcd-quantity-wrapper.qcd-loading {
	opacity: 0.5;
	pointer-events: none;
}

.qcd-quantity-wrapper.qcd-loading .qcd-qty-value {
	position: relative;
}

.qcd-quantity-wrapper.qcd-loading .qcd-qty-value::after {
	content: '';
	position: absolute;
	width: 12px;
	height: 12px;
	border: 2px solid #7A7A7A;
	border-top-color: #1B1B1B;
	border-radius: 50%;
	animation: qcd-spin 0.6s linear infinite;
}

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

/* Override stili WooCommerce mini-cart per compatibilità */
.widget_shopping_cart .qcd-quantity-wrapper,
.woocommerce-mini-cart .qcd-quantity-wrapper,
.elementor-menu-cart__products .qcd-quantity-wrapper {
	display: inline-flex !important;
}

/* Nasconde la quantità originale WooCommerce se residua */
.woocommerce-mini-cart-item .quantity:not(.qcd-quantity-wrapper) {
	display: none;
}

/* Responsive */
@media (max-width: 480px) {
	.qcd-btn {
		width: 26px;
		font-size: 13px;
	}

	.qcd-qty-value {
		min-width: 26px;
		font-size: 12px;
	}
}
