/*
 * Best Before · "Recent activity" social-proof toast (inc/integrations/activity.php).
 * Bottom left — bottom right is kept for the chat launcher (assets/css/chat.css).
 * On phones JS (activity.js) lifts the stack above whatever bar is fixed at the
 * bottom (tab bar, sticky basket, product buy bar), the same way chat.js does.
 * Tokens only (--bb-*), no new colours.
 */

.bb-activity {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 57; /* below .bb-stickybasket (59), .bb-tabs (60) and .bb-chat (58) */
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min(360px, calc(100vw - 40px));
	pointer-events: none; /* only the toast itself (and its children) is interactive */
}

.bb-activity__toast {
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 40px 10px 10px;
	position: relative;
	border-radius: var(--bb-r-tile);
	background: var(--bb-surface);
	border: 1px solid var(--bb-border);
	box-shadow: var(--bb-shadow);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .25s var(--bb-ease), transform .25s var(--bb-ease);
}

.bb-activity__toast--in { opacity: 1; transform: translateY(0); }
.bb-activity__toast--out { opacity: 0; transform: translateY(12px); }

@media (prefers-reduced-motion: reduce) {
	.bb-activity__toast { transition: opacity .01ms !important; transform: none !important; }
}

.bb-activity__link {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}
.bb-activity__link:hover .bb-activity__msg { text-decoration: underline; }

.bb-activity__img {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: var(--bb-r-small);
	background: var(--bb-ground);
	border: 1px solid var(--bb-border);
}

.bb-activity__body { display: grid; gap: 2px; min-width: 0; }
.bb-activity__msg {
	margin: 0;
	font-size: .8125rem;
	line-height: 1.35;
	color: var(--bb-ink-2);
	overflow-wrap: anywhere;
}
.bb-activity__time { font-size: .6875rem; color: var(--bb-muted); }

.bb-activity__close {
	position: absolute;
	top: 0;
	right: 0;
	width: var(--bb-touch);
	height: var(--bb-touch);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: var(--bb-muted);
	font-size: 1.125rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 0 var(--bb-r-tile) 0 0;
}
.bb-activity__close:hover { color: var(--bb-ink); background: var(--bb-ground); }
.bb-activity__close:focus-visible { outline: 3px solid var(--bb-yellow); outline-offset: -3px; }

@media print {
	.bb-activity { display: none !important; }
}

@media (max-width: 767px) {
	.bb-activity {
		left: 12px;
		/* 100vw − 12px (left) − 52px (round chat launcher) − 12px (gap) − 12px (right) */
		width: min(340px, calc(100vw - 12px - 52px - 12px - 12px));
		bottom: calc(var(--bb-tabs-h, 64px) + 12px + env(safe-area-inset-bottom));
	}
	body:not(:has(.bb-tabs)) .bb-activity { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
