/*
 * Store messages (inc/urgency.php, inc/recent-sales.php, assets/js/u17-urgency.js):
 * "Limited stock", the discount countdown and the recent-purchase card.
 *
 * Quiet by design: white cards with hairline borders like the rest of the
 * store, one accent colour each (red for stock and time left, teal for the
 * brand), the uppercase letter-spaced label of .u17-kicker, and a single
 * pinging dot as the only movement. Tokens from u17-system.css; motion stops
 * under prefers-reduced-motion.
 */

/* ============================================================ "Limited stock" */

.u17-urg {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--u17-line);
	border-left: 3px solid var(--u17-danger);
	border-radius: 4px;
	background: var(--u17-white);
	color: var(--u17-text);
	font-size: var(--u17-fs-small);
	line-height: 1.45;
}

.u17-urg__body {
	min-width: 0;
}

.u17-urg__label {
	margin-right: 4px;
	color: var(--u17-danger);
	font-size: var(--u17-fs-label);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
}

.u17-urg__text {
	color: var(--u17-black);
}

/* the dot, with a ring that keeps pinging outwards */
.u17-urg__dot {
	position: relative;
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--u17-danger);
}

.u17-urg__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--u17-danger);
	animation: u17-urg-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes u17-urg-ping {
	0% { transform: scale(1); opacity: 0.5; }
	75%, 100% { transform: scale(3); opacity: 0; }
}

/* product page: a full row under the button (the form is a wrapping flex row) */
#content.u17-pdp form.cart .u17-urg--pdp {
	flex: 1 0 100%;
	margin: 0;
}

/* phone buy bar: a short version under the price */
.u17-urg-mini {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 2px 0 0;
	color: var(--u17-danger);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.u17-urg-mini .u17-urg__dot {
	width: 6px;
	height: 6px;
}

/* ============================================================ the discount's end */

.u17-cd {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
}

/* the discount code chip, as in the promo bar */
.u17-urg-code {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 3px;
	background: var(--u17-ink);
	color: var(--u17-teal);
	font-size: 0.92em;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.5;
	white-space: nowrap;
}

/* product page, under the price */
.u17-urg-promo {
	margin: 10px 0 0;
	color: var(--u17-text);
	font-size: var(--u17-fs-small);
	line-height: 1.6;
}

.u17-urg-promo strong {
	color: var(--u17-black);
	font-weight: 600;
}

.u17-urg-promo__sep,
.u17-urg-promo__end {
	color: var(--u17-danger);
	white-space: nowrap;
}

.u17-urg-promo__end .u17-cd {
	color: var(--u17-danger);
}

@media (max-width: 600px) {
	.u17-urg-promo__sep {
		display: none;
	}

	.u17-urg-promo__end {
		display: block;
	}

	.u17-urg-promo__end::first-letter {
		text-transform: uppercase;
	}
}

/* cart (above "Proceed to checkout") + checkout (above "Place order") */
.u17-urg-co {
	display: grid;
	gap: 8px;
	margin: 0 0 16px;
}

.u17-urg-promo--co {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--u17-line);
	border-left: 3px solid var(--u17-teal);
	border-radius: 4px;
	background: var(--u17-white);
	line-height: 1.45;
}

.u17-urg-promo--co svg {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	fill: none;
	stroke: var(--u17-teal-text);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.u17-urg-promo--co .u17-cd {
	color: var(--u17-danger);
}

/* the cart's totals card is paper: keep the white cards crisp on it */
.cart_totals .u17-urg,
.cart_totals .u17-urg-promo--co {
	border-color: var(--u17-line-on-paper);
}

.cart_totals .u17-urg {
	border-left-color: var(--u17-danger);
}

.cart_totals .u17-urg-promo--co {
	border-left-color: var(--u17-teal);
}

/* promo bar (teal): "Ends in 1d 02:14:05" */
.u17-promo__cd {
	font-weight: 600;
}

/* phone promo strip */
.u17-m__promo-cd {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	white-space: nowrap;
}

/* ============================================================ recent purchase card */

.u17-rs {
	position: fixed;
	left: 20px;
	bottom: calc(20px + var(--u17-rs-lift, 0px));
	z-index: 90;
	width: min(372px, calc(100vw - 40px));
	border: 1px solid var(--u17-line);
	border-radius: 6px;
	background: var(--u17-white);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.12);
	font-family: var(--u17-font);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.35s var(--u17-ease), transform 0.35s var(--u17-ease), bottom 0.2s var(--u17-ease);
}

.u17-rs.is-in {
	opacity: 1;
	transform: none;
}

.u17-rs[hidden] {
	display: none;
}

.u17-rs__card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 44px 12px 12px;
	color: inherit;
	text-decoration: none;
}

.u17-rs__img {
	flex: none;
	width: 64px;
	height: 64px;
	border-radius: 4px;
	background: var(--u17-paper);
	object-fit: cover;
}

.u17-rs__body {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.u17-rs__kicker {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--u17-teal-text);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.u17-rs__kicker svg {
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.u17-rs__who {
	color: var(--u17-muted);
	font-size: 13px;
	line-height: 1.35;
}

.u17-rs__what {
	display: -webkit-box;
	overflow: hidden;
	color: var(--u17-black);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.u17-rs__card:hover .u17-rs__what,
.u17-rs__card:focus-visible .u17-rs__what {
	color: var(--u17-teal-text);
}

.u17-rs__close {
	position: absolute;
	top: 4px;
	right: 4px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--u17-muted);
	cursor: pointer;
}

.u17-rs__close svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.u17-rs__close:hover,
.u17-rs__close:focus-visible {
	background: var(--u17-paper);
	color: var(--u17-black);
}

@media (max-width: 600px) {
	.u17-rs {
		left: 12px;
		right: 12px;
		bottom: calc(12px + var(--u17-rs-lift, 0px));
		width: auto;
	}

	.u17-rs__close {
		width: 44px;
		height: 44px;
		top: 0;
		right: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.u17-urg__dot::after {
		animation: none;
	}

	.u17-rs {
		transition: none;
		transform: none;
	}
}
