/* =============================================================================
 * Storzen — Free Shipping Progress Bar
 * Frontend styles. Scoped under .sz-sb-* — no global bleed.
 * ========================================================================== */

.sz-sb {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 14px 16px;
	margin: 0 0 20px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	color: #1f2937;
	box-sizing: border-box;
}

.sz-sb *,
.sz-sb *::before,
.sz-sb *::after { box-sizing: border-box; }

/* ── Message line ───────────────────────────────────────────────────────── */
.sz-sb__message {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #1f2937;
	margin-bottom: 10px;
}

.sz-sb__icon {
	font-size: 18px;
	line-height: 1;
	flex-shrink: 0;
}

.sz-sb__text { flex: 1; }

.sz-sb__amount {
	color: #FF3636;
	font-weight: 700;
	white-space: nowrap;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.sz-sb__progress {
	width: 100%;
	height: 8px;
	background: #e5e7eb;
	border-radius: 99px;
	overflow: hidden;
	position: relative;
}

.sz-sb__progress-fill {
	height: 100%;
	background: #FF3636;
	border-radius: 99px;
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	min-width: 0;
}

/* Subtle shimmer over the fill — pure CSS, GPU-friendly */
.sz-sb__progress-fill::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.35) 50%,
		transparent 100%
	);
	animation: sz-sb-shimmer 2.5s infinite;
}

@keyframes sz-sb-shimmer {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}

/* Disable transition + shimmer when 'animate' setting is off */
.sz-sb--no-animate .sz-sb__progress-fill,
.sz-sb--no-animate .sz-sb__progress-fill::after {
	transition: none;
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.sz-sb__progress-fill,
	.sz-sb__progress-fill::after {
		animation: none !important;
		transition: none !important;
	}
}

/* ── Achieved state ─────────────────────────────────────────────────────── */
.sz-sb.is-achieved {
	background: rgba(34, 197, 94, 0.05);
	border-color: rgba(34, 197, 94, 0.3);
}

.sz-sb.is-achieved .sz-sb__message       { color: #16a34a; }
.sz-sb.is-achieved .sz-sb__progress-fill { background: #16a34a; }

/* ── Sticky variants (full-width banner) ────────────────────────────────── */
.sz-sb--sticky-top,
.sz-sb--sticky-bottom {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 9999;
	margin: 0;
	border-radius: 0;
	border-left: none;
	border-right: none;
	padding: 10px 20px;
	background: #FF3636;
	border-color: #FF3636;
	color: #ffffff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.sz-sb--sticky-top    { top: 0;    border-top: none; }
.sz-sb--sticky-bottom { bottom: 0; border-bottom: none; }

.sz-sb--sticky-top .sz-sb__message,
.sz-sb--sticky-bottom .sz-sb__message {
	justify-content: center;
	color: #ffffff;
	margin: 0;
	font-size: 13px;
	text-align: center;
}

.sz-sb--sticky-top .sz-sb__amount,
.sz-sb--sticky-bottom .sz-sb__amount {
	color: #fde047;
}

/* Sticky banner uses inline message only — progress bar hidden */
.sz-sb--sticky-top .sz-sb__progress,
.sz-sb--sticky-bottom .sz-sb__progress { display: none; }

.sz-sb--sticky-top.is-achieved,
.sz-sb--sticky-bottom.is-achieved {
	background: #16a34a;
	border-color: #16a34a;
}

/* Body offset for sticky variants — applied by JS */
body.sz-sb-has-sticky-top    { padding-top:    44px !important; }
body.sz-sb-has-sticky-bottom { padding-bottom: 44px !important; }

/* ── Mini cart context (compact) ────────────────────────────────────────── */
.sz-sb--mini_cart {
	margin: 10px 12px;
	font-size: 12px;
	padding: 10px 12px;
}

.sz-sb--mini_cart .sz-sb__message {
	font-size: 12px;
	margin-bottom: 7px;
}

.sz-sb--mini_cart .sz-sb__icon     { font-size: 14px; }
.sz-sb--mini_cart .sz-sb__progress { height: 6px; }

/* ── Checkout context ───────────────────────────────────────────────────── */
.sz-sb--checkout { margin-bottom: 24px; }

/* ── Mobile responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.sz-sb--sticky-top,
	.sz-sb--sticky-bottom {
		padding: 8px 14px;
	}
	.sz-sb--sticky-top .sz-sb__message,
	.sz-sb--sticky-bottom .sz-sb__message {
		font-size: 12px;
	}
}
