/**
 * DELTITECH free shipping progress (v1.0.236) — loaded on every page.
 *
 * One design for every bar: Glozin's native bar in the mini cart, cart page
 * and checkout (`.glozin-free-shipping-bar …`) and the product page meter
 * (`.dt-fsb …`, inc/dt-pdp.php). Motion lives in assets/js/dt-shipping.js.
 *
 *   ┌───────────────────────────────────────────────┐
 *   │ You're $40 away from free express shipping    │  message
 *   │ ███████████████████████(🚚)░░░░░░░░░░░░░░░░░░ │  track: fill + knob
 *   └───────────────────────────────────────────────┘
 *
 * The knob's truck comes from woocommerce/cart/free-shipping-bar.php (native
 * bars) and inc/dt-pdp.php (product page): the same SVG in both.
 *
 * `:not(#dt)` lends the root an id's weight: the child theme's older
 * cart-panel rules (custom-animations-v6.css, §11) use `!important` and long
 * selectors; this keeps the new design on top without longer chains.
 */

:root {
	--dt-fsb-green: #4cd964;
	--dt-fsb-green-deep: #1a8030;
	--dt-fsb-green-soft: #d4f7dc;
	--dt-fsb-ink: #0a0c10;
	--dt-fsb-ink-2: #2b3038;
	--dt-fsb-track: rgba(10, 12, 16, 0.08);
	--dt-fsb-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--dt-fsb-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Card -------------------------------------------------------------------- */

html body .glozin-free-shipping-bar:not(#dt),
html body .dt-fsb:not(#dt) {
	position: relative;
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	gap: 12px !important;
	margin: 0;
	padding: 14px 16px 18px !important;
	border: 1px solid rgba(26, 128, 48, 0.12) !important;
	border-radius: 18px !important;
	background: linear-gradient(180deg, #f7fcf8 0%, #eef8f1 100%) !important;
	box-shadow: inset 0 1px 0 #fff;
	font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
	opacity: 1 !important;
	animation: none !important;
	transition: background 0.5s var(--dt-fsb-ease), border-color 0.5s var(--dt-fsb-ease), box-shadow 0.5s var(--dt-fsb-ease) !important;
	box-sizing: border-box;
}

html body .glozin-free-shipping-bar:not(#dt) *,
html body .dt-fsb:not(#dt) * {
	animation: none;
	box-sizing: border-box;
}

/* Spacing per place. */
html body .cart-panel .glozin-free-shipping-bar:not(#dt) {
	margin: 16px 0 6px !important;
}

html body .cart-collaterals .glozin-free-shipping-bar:not(#dt),
html body .cart_totals .glozin-free-shipping-bar:not(#dt),
html body .woocommerce-checkout .glozin-free-shipping-bar:not(#dt) {
	margin: 0 0 20px !important;
}

/* Message ---------------------------------------------------------------- */

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__message,
html body .dt-fsb:not(#dt) .dt-fsb__message {
	order: 1 !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 13.5px !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
	letter-spacing: 0 !important;
	text-align: left !important;
	color: var(--dt-fsb-ink-2) !important;
	opacity: 1 !important;
}

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__message strong,
html body .dt-fsb:not(#dt) .dt-fsb__message strong {
	font-weight: 600 !important;
	color: var(--dt-fsb-green-deep) !important;
}

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__message .amount,
html body .dt-fsb:not(#dt) .dt-fsb__message .dt-fsb__amount {
	font-weight: 700 !important;
	color: var(--dt-fsb-ink) !important;
}

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__percent-value {
	display: none !important;
}

/* Track ------------------------------------------------------------------ */

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__progress,
html body .dt-fsb:not(#dt) .dt-fsb__track {
	order: 2 !important;
	position: relative !important;
	display: block !important;
	width: 100% !important;
	height: 8px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--dt-fsb-track) !important;
	box-shadow: inset 0 1px 2px rgba(10, 12, 16, 0.06) !important;
	overflow: visible !important;
	opacity: 1 !important;
}

/* Product page: the striped "this pair" segment is off since v1.0.236 so
   the product page bar looks exactly like the mini cart's (the message
   already says what this pair does). */
html body .dt-fsb:not(#dt) .dt-fsb__next {
	display: none !important;
}

/* Fill ------------------------------------------------------------------- */

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__progress-bar,
html body .dt-fsb:not(#dt) .dt-fsb__fill {
	position: absolute !important;
	top: 0;
	bottom: 0;
	left: 0;
	display: block !important;
	width: 0 !important;
	min-width: 0 !important;
	max-width: 100%;
	height: 100% !important;
	margin: 0 !important;
	border-radius: 999px !important;
	background: linear-gradient(90deg, var(--dt-fsb-green-deep) 0%, var(--dt-fsb-green) 100%) !important;
	background-size: 100% 100% !important;
	box-shadow: 0 2px 10px -2px rgba(26, 128, 48, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
	transform: none !important;
	transition: width 1s var(--dt-fsb-ease) !important;
	overflow: visible !important;
}

html body .glozin-free-shipping-bar.is-drawn:not(#dt) .glozin-free-shipping-bar__progress-bar {
	width: var(--gz-progress, 0%) !important;
}

html body .dt-fsb.is-drawn:not(#dt) .dt-fsb__fill {
	width: var(--dt-fsb-cart, 0%) !important;
}

/* Sheen sweeping along the fill. */
html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__progress-bar::after,
html body .dt-fsb:not(#dt) .dt-fsb__fill::after {
	content: "" !important;
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%) !important;
	background-size: 220% 100% !important;
	pointer-events: none;
	animation: dt-fsb-sheen 2.8s ease-in-out infinite !important;
}

/* Knob (truck) riding the end of the fill. */
html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__icon,
html body .dt-fsb:not(#dt) .dt-fsb__knob {
	position: absolute !important;
	top: 50% !important;
	right: -14px !important;
	left: auto !important;
	z-index: 2;
	display: grid !important;
	place-items: center;
	width: 28px !important;
	height: 28px !important;
	margin: -14px 0 0 !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: #fff !important;
	box-shadow: 0 0 0 1.5px var(--dt-fsb-green-deep), 0 6px 14px -4px rgba(10, 40, 20, 0.45) !important;
	color: var(--dt-fsb-green-deep) !important;
	line-height: 1 !important;
	transform: none !important;
	transition: background-color 0.4s var(--dt-fsb-ease), color 0.4s, box-shadow 0.4s !important;
}

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__icon svg,
html body .dt-fsb:not(#dt) .dt-fsb__knob svg {
	display: block !important;
	width: 16px !important;
	height: 16px !important;
	stroke-width: 1.8 !important;
	color: inherit !important;
	transition: opacity 0.25s, transform 0.4s var(--dt-fsb-spring);
}

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__icon .glozin-svg-icon {
	display: inline-grid !important;
	place-items: center;
	color: inherit !important;
	font-size: 15px;
}

/* Keep the knob inside the track at the very start. */
html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__progress-bar,
html body .dt-fsb:not(#dt) .dt-fsb__fill {
	min-width: 14px !important;
}

/* Unlocked ---------------------------------------------------------------- */

html body .glozin-free-shipping-bar.gz-is-success:not(#dt),
html body .dt-fsb.is-success:not(#dt) {
	border-color: rgba(26, 128, 48, 0.28) !important;
	background: linear-gradient(180deg, #ecfaef 0%, #ddf5e3 100%) !important;
	box-shadow: inset 0 1px 0 #fff, 0 10px 28px -18px rgba(26, 128, 48, 0.6);
}

html body .glozin-free-shipping-bar.gz-is-success:not(#dt) .glozin-free-shipping-bar__icon,
html body .dt-fsb.is-success:not(#dt) .dt-fsb__knob {
	background: var(--dt-fsb-green-deep) !important;
	box-shadow: 0 0 0 3px #fff, 0 6px 16px -4px rgba(26, 128, 48, 0.7) !important;
	color: #fff !important;
}

/* Truck → check. */
html body .glozin-free-shipping-bar.gz-is-success:not(#dt) .glozin-free-shipping-bar__icon svg,
html body .dt-fsb.is-success:not(#dt) .dt-fsb__knob svg {
	opacity: 0;
	transform: scale(0.4);
}

html body .glozin-free-shipping-bar:not(#dt) .glozin-free-shipping-bar__icon::after,
html body .dt-fsb:not(#dt) .dt-fsb__knob::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 6px;
	height: 11px;
	margin: -7px 0 0 -3px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	opacity: 0;
	transform: rotate(45deg) scale(0.3);
	transition: opacity 0.25s 0.1s, transform 0.5s var(--dt-fsb-spring) 0.1s;
}

html body .glozin-free-shipping-bar.gz-is-success:not(#dt) .glozin-free-shipping-bar__icon::after,
html body .dt-fsb.is-success:not(#dt) .dt-fsb__knob::after {
	opacity: 1;
	transform: rotate(45deg) scale(1);
}

/* Unlock moment (dt-shipping.js adds is-celebrate for ~1.8s). */
html body .glozin-free-shipping-bar.is-celebrate:not(#dt) .glozin-free-shipping-bar__icon,
html body .dt-fsb.is-celebrate:not(#dt) .dt-fsb__knob {
	animation: dt-fsb-pop 0.7s var(--dt-fsb-spring) 0.55s both !important;
}

html body .glozin-free-shipping-bar.is-celebrate:not(#dt) .glozin-free-shipping-bar__icon::before,
html body .dt-fsb.is-celebrate:not(#dt) .dt-fsb__knob::before {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid var(--dt-fsb-green);
	animation: dt-fsb-ring 0.9s var(--dt-fsb-ease) 0.6s both !important;
}

html body .glozin-free-shipping-bar.is-celebrate:not(#dt) .glozin-free-shipping-bar__message,
html body .dt-fsb.is-celebrate:not(#dt) .dt-fsb__message {
	animation: dt-fsb-message 0.6s var(--dt-fsb-ease) 0.5s both !important;
}

html body .glozin-free-shipping-bar.is-celebrate:not(#dt),
html body .dt-fsb.is-celebrate:not(#dt) {
	animation: dt-fsb-glow 1.6s var(--dt-fsb-ease) 0.5s both !important;
}

.dt-fsb-confetti {
	position: absolute;
	z-index: 3;
	pointer-events: none;
}

/* Product page: the card sits in the summary column. */
html body .dt-fsb--pdp:not(#dt) {
	margin: 0 0 14px;
}

/* Keyframes -------------------------------------------------------------- */

@keyframes dt-fsb-sheen {
	0% {
		background-position: 160% 0;
	}
	60%,
	100% {
		background-position: -60% 0;
	}
}

@keyframes dt-fsb-stripes {
	to {
		background-position: 17px 0;
	}
}

@keyframes dt-fsb-pop {
	0% {
		transform: scale(1);
	}
	40% {
		transform: scale(1.28);
	}
	100% {
		transform: scale(1);
	}
}

@keyframes dt-fsb-ring {
	0% {
		opacity: 0.9;
		transform: scale(0.8);
	}
	100% {
		opacity: 0;
		transform: scale(2.2);
	}
}

@keyframes dt-fsb-message {
	0% {
		opacity: 0;
		transform: translateY(4px);
	}
	100% {
		opacity: 1;
		transform: none;
	}
}

@keyframes dt-fsb-glow {
	0% {
		box-shadow: inset 0 1px 0 #fff, 0 0 0 0 rgba(76, 217, 100, 0.45);
	}
	50% {
		box-shadow: inset 0 1px 0 #fff, 0 0 0 8px rgba(76, 217, 100, 0);
	}
	100% {
		box-shadow: inset 0 1px 0 #fff, 0 10px 28px -18px rgba(26, 128, 48, 0.6);
	}
}

@media (prefers-reduced-motion: reduce) {
	html body .glozin-free-shipping-bar:not(#dt) *,
	html body .dt-fsb:not(#dt) *,
	html body .glozin-free-shipping-bar:not(#dt),
	html body .dt-fsb:not(#dt) {
		animation: none !important;
		transition: none !important;
	}
}
