/*
 * Sawir Pulse toast styles.
 *
 * Renders inside arbitrary themes, so everything is scoped under .swpl-root,
 * sized in px, and themeable through custom properties.
 */
.swpl-root {
	--swpl-bg: #ffffff;
	--swpl-text: #1c1c1e;
	--swpl-muted: #71717a;
	--swpl-border: rgba(0, 0, 0, 0.07);
	--swpl-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
	--swpl-pulse: #12b76a;
	--swpl-star: #f5a623;
	--swpl-radius: 12px;

	position: fixed;
	bottom: var(--swpl-offset, 20px);
	z-index: 99998;
	max-width: min(340px, calc(100vw - 32px));
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
	line-height: 1.4;
	pointer-events: none;
}

.swpl-bottom-left {
	left: 20px;
}

.swpl-bottom-right {
	right: 20px;
}

.swpl-toast {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--swpl-bg);
	color: var(--swpl-text);
	border: 1px solid var(--swpl-border);
	border-radius: var(--swpl-radius);
	box-shadow: var(--swpl-shadow);
	pointer-events: auto;
	text-decoration: none;
	opacity: 0;
	transform: translateY(16px) scale(0.97);
	transition: opacity 0.45s cubic-bezier(0.21, 1.02, 0.55, 1),
		transform 0.45s cubic-bezier(0.21, 1.02, 0.55, 1);
}

.swpl-toast.swpl-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.swpl-toast.swpl-leaving {
	opacity: 0;
	transform: translateY(10px) scale(0.98);
}

a.swpl-toast:hover .swpl-title {
	text-decoration: underline;
}

/* Thumbnail with the signature pulse dot on its corner. */
.swpl-thumb {
	position: relative;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
}

.swpl-thumb img {
	width: 44px;
	height: 44px;
	max-width: 44px;
	object-fit: cover;
	border-radius: 9px;
	display: block;
	margin: 0;
}

.swpl-thumb-fallback {
	width: 44px;
	height: 44px;
	border-radius: 9px;
	background: color-mix(in srgb, var(--swpl-pulse) 12%, var(--swpl-bg));
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.swpl-dot {
	position: absolute;
	right: -3px;
	bottom: -3px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--swpl-pulse);
	box-shadow: 0 0 0 2px var(--swpl-bg);
}

.swpl-dot::after {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: 50%;
	border: 1.5px solid var(--swpl-pulse);
	animation: swpl-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes swpl-ping {
	0% {
		transform: scale(1);
		opacity: 0.8;
	}
	80%,
	100% {
		transform: scale(2.4);
		opacity: 0;
	}
}

.swpl-body {
	min-width: 0;
	flex: 1;
}

.swpl-title {
	font-size: 13px;
	font-weight: 500;
	margin: 0;
	color: var(--swpl-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.swpl-meta {
	font-size: 12px;
	margin: 2px 0 0;
	color: var(--swpl-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.swpl-stars {
	color: var(--swpl-star);
	letter-spacing: 1px;
	font-size: 12px;
}

.swpl-close {
	flex: 0 0 auto;
	align-self: flex-start;
	appearance: none;
	background: none;
	border: 0;
	padding: 2px;
	margin: -4px -6px 0 0;
	cursor: pointer;
	color: var(--swpl-muted);
	font-size: 14px;
	line-height: 1;
	border-radius: 4px;
}

.swpl-close:hover {
	color: var(--swpl-text);
}

.swpl-close:focus-visible {
	outline: 2px solid var(--swpl-pulse);
	outline-offset: 1px;
}

/* Inline "X sold this week" badge on the product page. */
.swpl-sold-badge {
	--swpl-pulse: #12b76a;

	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.85em;
	margin: 0 0 1em;
}

.swpl-badge-dot {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--swpl-pulse);
	flex: 0 0 auto;
}

.swpl-badge-dot::after {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: 50%;
	border: 1.5px solid var(--swpl-pulse);
	animation: swpl-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@media (prefers-reduced-motion: reduce) {
	.swpl-badge-dot::after {
		animation: none;
		display: none;
	}

	.swpl-toast {
		transition: opacity 0.3s ease;
		transform: none;
	}

	.swpl-toast.swpl-visible,
	.swpl-toast.swpl-leaving {
		transform: none;
	}

	.swpl-dot::after {
		animation: none;
		display: none;
	}
}
