/* Cart quantity repair: one aligned control on every cart layout. */
body.woocommerce-cart .ll-cart-quantity-control {
	display: grid !important;
	grid-template-columns: 31px 44px 31px !important;
	align-items: stretch !important;
	width: 106px !important;
	height: 38px !important;
	margin: 0 !important;
	border: 1px solid #cfd8d5 !important;
	border-radius: 7px !important;
	background: #fff !important;
	overflow: hidden !important;
}

body.woocommerce-cart .ll-cart-quantity-control input.qty {
	display: block !important;
	width: 44px !important;
	height: 36px !important;
	min-height: 36px !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	justify-self: center !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #fff !important;
	box-shadow: none !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 36px !important;
	text-align: center !important;
	text-indent: 0 !important;
	-moz-appearance: textfield !important;
	appearance: textfield !important;
}

body.woocommerce-cart .ll-cart-quantity-control input.qty::-webkit-inner-spin-button,
body.woocommerce-cart .ll-cart-quantity-control input.qty::-webkit-outer-spin-button,
body.woocommerce-cart .woocommerce-cart-form input.qty::-webkit-inner-spin-button,
body.woocommerce-cart .woocommerce-cart-form input.qty::-webkit-outer-spin-button {
	margin: 0 !important;
	-webkit-appearance: none !important;
}

body.woocommerce-cart .ll-cart-quantity-step {
	display: grid !important;
	width: 31px !important;
	height: 36px !important;
	margin: 0 !important;
	padding: 0 !important;
	place-items: center !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #f4f6f5 !important;
	color: #172421 !important;
	font: 400 18px/1 Arial, sans-serif !important;
	cursor: pointer;
}

body.woocommerce-cart .ll-cart-quantity-step:first-child {
	border-right: 1px solid #e1e6e4 !important;
}

body.woocommerce-cart .ll-cart-quantity-step:last-child {
	border-left: 1px solid #e1e6e4 !important;
}

body.woocommerce-cart .ll-cart-quantity-step:hover:not(:disabled),
body.woocommerce-cart .ll-cart-quantity-step:focus-visible {
	background: #e8f5f1 !important;
	color: #008f7c !important;
}

body.woocommerce-cart .ll-cart-quantity-step:disabled {
	color: #aeb6b4 !important;
	cursor: not-allowed;
	opacity: .62;
}

body.woocommerce-cart .ll-cart-item.is-quantity-pending .ll-cart-subtotal .ll-cart-value {
	color: #008f7c;
}

body.woocommerce-cart .woocommerce-cart-form.is-cart-updating {
	cursor: progress;
}

/*
 * The parent theme prints later inline rules for cart number inputs. Those
 * rules force a 66px/78px input into this control's 44px centre track. Use a
 * deliberately cart-specific selector so the real input remains inside its
 * allocated track on desktop and mobile, regardless of stylesheet order.
 */
html body.ll-commerce-v2.woocommerce-cart .ll-cart-item .ll-cart-quantity .ll-cart-quantity-control > input.qty {
	display: block !important;
	width: 44px !important;
	min-width: 44px !important;
	max-width: 44px !important;
	height: 36px !important;
	min-height: 36px !important;
	max-height: 36px !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	justify-self: stretch !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #fff !important;
	box-shadow: none !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 36px !important;
	text-align: center !important;
	text-indent: 0 !important;
	-moz-appearance: textfield !important;
	appearance: textfield !important;
}

html body.ll-commerce-v2.woocommerce-cart .ll-cart-quantity {
	min-width: 0 !important;
}

html body.ll-commerce-v2.woocommerce-cart .ll-cart-quantity > .ll-cart-value {
	display: flex !important;
	align-items: center !important;
	min-width: 0 !important;
}

@media (min-width: 768px) {
	/*
	 * Centre the quantity grid item itself in the fourth desktop column. Some
	 * browser/theme combinations shrink this grid item to its contents, so
	 * centring only the nested control can still leave the whole item at the
	 * column's left edge.
	 */
	html body.ll-commerce-v2.woocommerce-cart .ll-cart-item > .ll-cart-quantity {
		grid-column: 4 !important;
		justify-self: center !important;
		width: 106px !important;
		min-width: 106px !important;
		max-width: 106px !important;
	}

	html body.ll-commerce-v2.woocommerce-cart .ll-cart-item .ll-cart-quantity .ll-cart-quantity-control {
		margin: 0 !important;
	}

	html body.ll-commerce-v2.woocommerce-cart .ll-cart-quantity {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
	}

	html body.ll-commerce-v2.woocommerce-cart .ll-cart-quantity > .ll-cart-value {
		width: 106px !important;
		justify-content: center !important;
	}
}

@media (max-width: 767px) {
	html body.ll-commerce-v2.woocommerce-cart .ll-cart-quantity {
		display: flex !important;
		width: 100% !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 16px !important;
	}

	html body.ll-commerce-v2.woocommerce-cart .ll-cart-quantity > .ll-cart-value {
		flex: 0 0 106px !important;
		width: 106px !important;
		margin-left: auto !important;
		justify-content: flex-end !important;
	}
}

/*
 * Desktop only: keep the existing right-aligned QUANTITY heading fixed and
 * place the controls beneath the visible centre of that heading. The compact
 * desktop grid uses a 126px quantity track; the full grid uses 132px.
 * Mobile is intentionally excluded and remains unchanged.
 */
@media (min-width: 769px) and (max-width: 980px) {
	html body.ll-commerce-v2.woocommerce-cart .ll-cart-item > .ll-cart-quantity {
		transform: translateX(30px) !important;
	}
}

@media (min-width: 981px) {
	html body.ll-commerce-v2.woocommerce-cart .ll-cart-item > .ll-cart-quantity {
		transform: translateX(33px) !important;
	}
}
