/* Tabiat — minimum order progress (cart, checkout, mini-cart). Colors follow tabiat-design tokens when present. */

.tmo, .tmo-lock {
	--tmo-g: var(--t-g600, #128040);
	--tmo-g-2: var(--t-g500, #19a34f);
	--tmo-g-dark: var(--t-g800, #0a4425);
	--tmo-lime: var(--t-lime, #a3e635);
	--tmo-ink: var(--t-ink, #0d1b12);
	--tmo-ink-2: var(--t-ink-2, #3b4a40);
	--tmo-muted: var(--t-muted, #7b877f);
	--tmo-line: var(--t-line, #e7e2d4);
	--tmo-cream: var(--t-cream, #fbf7ee);
	--tmo-cream-2: var(--t-cream-2, #f3ecdc);
	--tmo-red: var(--t-red, #e3242b);
	--tmo-ease: var(--t-ease, cubic-bezier(.2, .8, .2, 1));
	--tmo-font: var(--t-font, inherit);
}

/* ---------- card ---------- */
.tmo {
	position: relative;
	display: grid;
	gap: 14px;
	margin: 0 0 24px;
	padding: 18px 22px 20px;
	border-radius: var(--t-radius, 22px);
	background: #fff;
	box-shadow: var(--t-shadow, 0 1px 2px rgba(6, 47, 25, .06), 0 12px 32px -14px rgba(6, 47, 25, .28));
	font-family: var(--tmo-font);
	color: var(--tmo-ink);
	overflow: hidden;
	isolation: isolate;
}
.tmo::before {
	/* soft wash in the brand color behind the icon side */
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(120% 140% at 100% 0%, rgba(163, 230, 53, .14), transparent 55%);
	pointer-events: none;
}

.tmo__head { display: flex; align-items: center; gap: 14px; }
.tmo__icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 15px;
	background: var(--tmo-cream-2);
	color: var(--tmo-g-dark);
	transition: background-color .4s var(--tmo-ease), color .4s var(--tmo-ease), transform .4s var(--tmo-ease);
}
.tmo__icon svg { width: 22px; height: 22px; }
.tmo__text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tmo__msg { font-size: 15px; font-weight: 800; line-height: 1.8; color: var(--tmo-ink); }
.tmo__amount { color: var(--tmo-red); font-weight: 900; white-space: nowrap; }
.tmo__amount .woocommerce-Price-amount { color: inherit; }
.tmo__sub { font-size: 12.5px; font-weight: 600; color: var(--tmo-muted); line-height: 1.7; }
.tmo__sub .woocommerce-Price-amount { color: var(--tmo-ink-2); font-weight: 800; }
.tmo__pct {
	flex: none;
	min-width: 56px;
	padding: 6px 10px;
	border-radius: 999px;
	background: var(--tmo-cream);
	box-shadow: inset 0 0 0 1px var(--tmo-line);
	font-size: 14px;
	font-weight: 900;
	text-align: center;
	color: var(--tmo-g-dark);
	font-variant-numeric: tabular-nums;
}

/* ---------- bar ---------- */
.tmo__track {
	position: relative;
	height: 12px;
	border-radius: 999px;
	background: var(--tmo-cream-2);
	box-shadow: inset 0 1px 2px rgba(6, 47, 25, .08);
	overflow: hidden;
}
.tmo__fill {
	position: relative;
	display: block;
	height: 100%;
	min-width: 12px;
	border-radius: inherit;
	background: linear-gradient(270deg, var(--tmo-g), var(--tmo-g-2) 70%, var(--tmo-lime));
	box-shadow: 0 0 12px -2px rgba(25, 163, 79, .55);
	transition: width .9s var(--tmo-ease);
	animation: tmo-grow 1.1s var(--tmo-ease) both;
	overflow: hidden;
}
.tmo.is-below .tmo__fill::after {
	/* slow sheen so the bar reads as "in progress" */
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%);
	transform: translateX(100%);
	animation: tmo-sheen 2.6s ease-in-out 1.1s infinite;
}

/* ---------- call to action ---------- */
.tmo__cta {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	border-radius: 999px;
	background: var(--tmo-ink);
	color: #fff !important;
	font-size: 13.5px;
	font-weight: 800;
	text-decoration: none !important;
	transition: transform .25s var(--tmo-ease), background-color .25s;
}
.tmo__cta svg { width: 17px; height: 17px; transition: transform .25s var(--tmo-ease); }
.tmo__cta:hover { background: var(--tmo-g-dark); transform: translateY(-1px); }
.tmo__cta:hover svg { transform: translateX(-3px); }
.tmo__cta:focus-visible { outline: 3px solid var(--tmo-lime); outline-offset: 2px; }

/* ---------- reached ---------- */
.tmo.is-reached .tmo__icon { background: var(--tmo-g); color: #fff; }
.tmo.is-reached .tmo__msg { color: var(--tmo-g-dark); }
.tmo.is-reached .tmo__pct { background: var(--tmo-lime); box-shadow: none; color: var(--t-g950, #04210f); }
.tmo.is-reached .tmo__fill { background: linear-gradient(270deg, var(--tmo-g-2), var(--tmo-lime)); }
.tmo.is-celebrate .tmo__icon { animation: tmo-pop .6s var(--tmo-ease); }
.tmo.is-nudge { animation: tmo-nudge 1.6s var(--tmo-ease); }

/* compact success on checkout: no need to shout */
.tmo--checkout.is-reached { padding: 14px 18px 16px; gap: 10px; }
.tmo--checkout.is-reached .tmo__icon { width: 38px; height: 38px; border-radius: 12px; }
.tmo--checkout.is-reached .tmo__track { height: 8px; }

/* ---------- mini-cart ---------- */
.tmo--mini {
	margin: 0 0 14px;
	padding: 12px 14px 14px;
	gap: 10px;
	border-radius: 16px;
	background: var(--tmo-cream);
	box-shadow: inset 0 0 0 1px var(--tmo-line);
}
.tmo--mini::before { display: none; }
.tmo--mini .tmo__head { gap: 10px; }
.tmo--mini .tmo__icon { width: 34px; height: 34px; border-radius: 11px; background: #fff; }
.tmo--mini.is-reached .tmo__icon { background: var(--tmo-g); }
.tmo--mini .tmo__icon svg { width: 18px; height: 18px; }
.tmo--mini .tmo__msg { font-size: 13px; line-height: 1.7; }
.tmo--mini .tmo__pct { min-width: 0; padding: 3px 8px; font-size: 12px; background: #fff; }
.tmo--mini .tmo__track { height: 8px; background: #fff; }

/* ---------- locked checkout button (cart totals) ---------- */
.tmo-lock {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	margin: 0 0 6px;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--tmo-cream-2);
	box-shadow: inset 0 0 0 1.5px var(--tmo-line);
	color: var(--tmo-ink-2);
	font-family: var(--tmo-font);
	font-size: 14.5px;
	font-weight: 800;
	line-height: 1.6;
	text-align: center;
	cursor: not-allowed;
	overflow: hidden;
	isolation: isolate;
	user-select: none;
}
.tmo-lock__fill {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	z-index: -1;
	width: var(--tmo-p, 0%);
	background: linear-gradient(270deg, rgba(25, 163, 79, .22), rgba(163, 230, 53, .38));
	transition: width .9s var(--tmo-ease);
	animation: tmo-grow 1.1s var(--tmo-ease) both;
}
.tmo-lock__label { display: inline-flex; align-items: center; gap: 8px; }
.tmo-lock__label svg { flex: none; width: 18px; height: 18px; color: var(--tmo-g-dark); }
.tmo-lock .woocommerce-Price-amount { color: var(--tmo-red); font-weight: 900; white-space: nowrap; }

/* ---------- motion ---------- */
@keyframes tmo-grow { from { width: 0; } }
@keyframes tmo-sheen {
	0% { transform: translateX(100%); }
	60%, 100% { transform: translateX(-100%); }
}
@keyframes tmo-pop {
	0% { transform: scale(.6) rotate(-12deg); }
	60% { transform: scale(1.15) rotate(4deg); }
	100% { transform: scale(1) rotate(0); }
}
@keyframes tmo-nudge {
	0%, 100% { box-shadow: var(--t-shadow, 0 12px 32px -14px rgba(6, 47, 25, .28)); }
	25%, 65% { box-shadow: 0 0 0 4px rgba(227, 36, 43, .25), var(--t-shadow, 0 12px 32px -14px rgba(6, 47, 25, .28)); }
}

@media (prefers-reduced-motion: reduce) {
	.tmo__fill, .tmo-lock__fill { transition: none; animation: none; }
	.tmo.is-below .tmo__fill::after { animation: none; display: none; }
	.tmo.is-celebrate .tmo__icon, .tmo.is-nudge { animation: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
	.tmo { margin-bottom: 18px; padding: 14px 16px 16px; gap: 12px; border-radius: 18px; }
	.tmo__head { gap: 12px; align-items: flex-start; }
	.tmo__icon { width: 40px; height: 40px; border-radius: 13px; }
	.tmo__icon svg { width: 20px; height: 20px; }
	.tmo__msg { font-size: 14px; line-height: 1.75; }
	.tmo__sub { font-size: 12px; }
	.tmo__pct { min-width: 0; padding: 4px 9px; font-size: 12.5px; }
	.tmo__track { height: 10px; }
	.tmo__cta { justify-self: stretch; justify-content: center; padding: 11px 16px; }
	.tmo-lock { min-height: 52px; font-size: 13.5px; }
}
