/* ============================================================
 * HBN Cart UX — mini-cart qty controls + cart page loader
 * ============================================================ */

/* === Mini-cart : +/- controls inline === */
.hbn-mini-qty {
	display: inline-flex;
	align-items: center;
	gap: 0;
	border: 1px solid #d8d8d8;
	border-radius: 999px;
	overflow: hidden;
	background: #fff;
	font-size: 13px;
	line-height: 1;
	height: 28px;
	user-select: none;
	transition: opacity 0.25s ease;
}
.hbn-mini-qty-btn {
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 0;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	color: #555;
	transition: background 0.15s ease, color 0.15s ease;
}
.hbn-mini-qty-btn:hover {
	background: #f3f3f3;
	color: #1f3a2e;
}
.hbn-mini-qty-btn:active {
	background: #e8e8e8;
}
.hbn-mini-qty-value {
	min-width: 24px;
	text-align: center;
	padding: 0 6px;
	color: #333;
	font-weight: 500;
	border-left: 1px solid #eee;
	border-right: 1px solid #eee;
	height: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* === Updating state : spinner + lock === */
.hbn-mini-qty.hbn-updating,
.hbn-row-updating {
	opacity: 0.55;
	pointer-events: none;
	position: relative;
}
.hbn-mini-qty.hbn-updating .hbn-mini-qty-btn,
.hbn-mini-qty.hbn-updating .hbn-mini-qty-value {
	color: #999;
}

/* Spinner on mini-cart updating */
.mini_cart_item.hbn-updating,
.woocommerce-mini-cart-item.hbn-updating {
	position: relative;
}
.mini_cart_item.hbn-updating::after,
.woocommerce-mini-cart-item.hbn-updating::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 12px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid transparent;
	border-top-color: #1f3a2e;
	border-right-color: #1f3a2e;
	border-radius: 50%;
	animation: hbn-cart-spin 0.7s linear infinite;
	pointer-events: none;
	z-index: 5;
}

/* Cart page (WC Blocks) — lock interactions while Store API call is in-flight */
body.hbn-cart-busy .wc-block-cart-items,
body.hbn-cart-busy .wp-block-woocommerce-cart-line-items-block,
body.hbn-cart-busy .wc-block-components-totals-wrapper,
body.hbn-cart-busy .wp-block-woocommerce-proceed-to-checkout-block {
	pointer-events: none;
	opacity: 0.55;
	transition: opacity 0.2s ease;
}
/* Spinner overlay on the cart items table */
body.hbn-cart-busy .wc-block-cart-items {
	position: relative;
}
body.hbn-cart-busy .wc-block-cart-items::after {
	content: '';
	position: absolute;
	top: 20px;
	left: 50%;
	width: 22px;
	height: 22px;
	margin-left: -11px;
	border: 2px solid transparent;
	border-top-color: #1f3a2e;
	border-right-color: #1f3a2e;
	border-radius: 50%;
	animation: hbn-cart-spin 0.7s linear infinite;
	z-index: 10;
	pointer-events: none;
}

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