/**
 * JTX Shipping - free shipping progress bar.
 * Rendered in three contexts (see JtxShippingBar::__construct): the Shoptimizer
 * slide-out mini-cart, the cart page .cart_totals panel, and the checkout
 * order-review column. A jtx-ship-bar--{context} modifier class allows
 * per-location layout tweaks.
 */

.jtx-ship-bar {
	--jtx-ship-accent: #1a7f37; /* progress / success colour */
	--jtx-ship-track: #e9e9e9;
	margin: 2px 0 18px;
	font-size: 13px;
	line-height: 1.45;
	color: #111;
}

.jtx-ship-bar__msg {
	margin-bottom: 9px;
}

.jtx-ship-bar__msg .woocommerce-Price-amount {
	font-weight: 700;
	white-space: nowrap;
}

.jtx-ship-bar--complete .jtx-ship-bar__msg {
	color: black;
	font-weight: 400;
}

.jtx-ship-bar__track {
	position: relative;
	height: 8px;
	border-radius: 999px;
	background: var(--jtx-ship-track);
}

.jtx-ship-bar__fill {
	display: block;
	height: 100%;
	width: 0;
	min-width: 8px;
	border-radius: 999px;
	background: var(--jtx-ship-accent);
	transition: width 0.4s ease;
}

/* Threshold chips ($80 / $120) sitting on the bar at their points. */
.jtx-ship-bar__badge {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 1px 6px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.5;
	color: #fff;
	background: #9a9a9a;
	border-radius: 999px;
	white-space: nowrap;
	z-index: 1;
}

.jtx-ship-bar__badge--end {
	left: auto;
	right: 0;
	transform: translateY(-50%);
}

/* Highlight a chip once its threshold has been reached. */
.jtx-ship-bar--standard .jtx-ship-bar__badge--mid,
.jtx-ship-bar--complete .jtx-ship-bar__badge--mid,
.jtx-ship-bar--complete .jtx-ship-bar__badge--end {
	background: var(--jtx-ship-accent);
}

/*
 * Checkout wrapper. Shoptimizer floats #order_review_heading and #order_review
 * right at 41.18% (>= 993px). The bar renders between them (wrapped in
 * .jtx-ship-bar-checkout so it can refresh as an AJAX fragment), so without a
 * matching float it breaks out to full width across both columns. Float the
 * wrapper to sit cleanly in the order-review column, stacked under "Your order"
 * and above the order table.
 */
@media (min-width: 993px) {
	.jtx-ship-bar-checkout {
		float: right;
		clear: right;
		width: 41.1764705882%;
		margin-top: 10px;
	}
}
