/* =============================================================================
 * Storzen — Stock Scarcity Messages
 * Frontend styles. Scoped under .sz-ss — no global bleed.
 *
 * Amber palette for low-stock warning, red for critical state.
 * ========================================================================== */

.sz-ss {
	background: #fffbeb;
	border: 1px solid rgba(245, 158, 11, 0.3);
	border-left: 3px solid #f59e0b;
	border-radius: 6px;
	padding: 12px 14px;
	margin: 0 0 18px;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.4;
	color: #92400e;
	box-sizing: border-box;
}

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

/* ── Message line ───────────────────────────────────────────────────────── */
.sz-ss__message {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
	color: #92400e;
	margin-bottom: 8px;
}

.sz-ss__icon {
	font-size: 16px;
	line-height: 1;
	flex-shrink: 0;
	animation: sz-ss-pulse 2s ease-in-out infinite;
}

@keyframes sz-ss-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.15); }
}

.sz-ss__text { flex: 1; }

.sz-ss__text strong {
	color: #f59e0b;
	font-weight: 700;
	font-size: 1.05em;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.sz-ss__progress {
	width: 100%;
	height: 6px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 99px;
	overflow: hidden;
}

.sz-ss__progress-fill {
	height: 100%;
	background: #f59e0b;
	border-radius: 99px;
	transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Critical state (more urgent) ───────────────────────────────────────── */
.sz-ss.is-critical {
	background: #fef2f2;
	border-color: rgba(220, 38, 38, 0.3);
	border-left-color: #dc2626;
	color: #991b1b;
	animation: sz-ss-flash 1.5s ease-in-out infinite;
}

.sz-ss.is-critical .sz-ss__message       { color: #991b1b; }
.sz-ss.is-critical .sz-ss__text strong   { color: #dc2626; }
.sz-ss.is-critical .sz-ss__progress-fill { background: #dc2626; }

@keyframes sz-ss-flash {
	0%, 100% { box-shadow: 0 0 0 0 transparent; }
	50%      { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }
}

/* ── Compact variant (shop / category loop) ─────────────────────────────── */
.sz-ss--compact {
	padding: 6px 10px;
	margin: 6px 0;
	font-size: 11px;
	border-radius: 4px;
	border-left-width: 2px;
}

.sz-ss--compact .sz-ss__message {
	margin-bottom: 0;
	font-size: 11px;
}

.sz-ss--compact .sz-ss__icon { font-size: 13px; }

/* ── Variable product placeholder wrapper ───────────────────────────────── */
.sz-ss-wrap {
	margin: 0 0 18px;
}
.sz-ss-wrap[hidden] { display: none; }

/* ── Reduced-motion / accessibility ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.sz-ss__icon,
	.sz-ss.is-critical {
		animation: none;
	}
	.sz-ss__progress-fill {
		transition: none;
	}
}
