/* Embodied Peptides — Backorder Notice
   Cart/checkout warning shown when the order contains a backordered item.
   Flashes red briefly, then settles into a calm dark box with white text.
   Loads only while the plugin is active. */

.ep-backorder-warning {
	position: relative;
	overflow: hidden;
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	font-family: 'DM Sans', sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: #0d0d0d;
	background: #ffe3e3;
	border: 3px solid #c0392b;
	animation: ep-warn-flash 0.9s ease-in-out infinite;
}
.ep-backorder-warning strong { color: #a3271b; font-weight: 800; }

@keyframes ep-warn-flash {
	0%, 100% { background: #ffe3e3; border-color: #c0392b; box-shadow: 0 0 0 0 rgba(192,57,43,0); }
	50%      { background: #ffc9c9; border-color: #e74c3c; box-shadow: 0 0 14px 2px rgba(192,57,43,0.55); }
}

/* Settling: stop the flash and smoothly crossfade to the dark box. */
.ep-backorder-warning.ep-warn-settling,
.ep-backorder-warning.ep-warn-settled {
	animation: none;
	background: #0d0d0d;
	border-color: #0d0d0d;
	color: #ffffff;
	box-shadow: none;
	transition: background 1.1s ease, border-color 1.1s ease, color 0.9s ease 0.25s;
}
.ep-backorder-warning.ep-warn-settling strong,
.ep-backorder-warning.ep-warn-settled strong {
	color: #ffffff;
	transition: color 0.9s ease 0.25s;
}

/* Dithered neutral code-sweep overlay that passes across during the transition. */
.ep-backorder-warning::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0;
	pointer-events: none;
	background-image:
		repeating-linear-gradient(90deg, rgba(255,255,255,0.10) 0 1px, transparent 1px 3px),
		radial-gradient(rgba(255,255,255,0.38) 42%, transparent 45%),
		radial-gradient(rgba(255,255,255,0.38) 42%, transparent 45%);
	background-size: 3px 100%, 6px 6px, 6px 6px;
	background-position: 0 0, 0 0, 3px 3px;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 20%, transparent 32%);
	mask-image: linear-gradient(90deg, transparent, #000 12%, #000 20%, transparent 32%);
	-webkit-mask-size: 250% 100%;
	mask-size: 250% 100%;
}
.ep-backorder-warning.ep-warn-settling::after {
	animation: ep-warn-sweep 1.1s ease-out forwards;
}
.ep-backorder-warning > * { position: relative; z-index: 1; }
@keyframes ep-warn-sweep {
	0%   { opacity: 0;   -webkit-mask-position: -120% 0; mask-position: -120% 0; }
	15%  { opacity: 0.9; }
	100% { opacity: 0;   -webkit-mask-position: 120% 0;  mask-position: 120% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ep-backorder-warning { animation: none; background: #0d0d0d; border-color: #0d0d0d; color: #ffffff; }
	.ep-backorder-warning strong { color: #ffffff; }
	.ep-backorder-warning::after { display: none; }
}
