/*
 * STW Social Proof toast.
 *
 * The toast is a fixed overlay that must never swallow a tap meant for the
 * page: the container ignores pointer events entirely, and only the card
 * (a single link plus its close button) is clickable, and only while the
 * toast is showing. It is not displayed below 768px. When hidden the
 * toast is visibility:hidden (after the Bootstrap fade completes) so it is
 * also out of hit-testing and the accessibility tree.
 */
#stw-social-proof {
	max-width: 320px;
	pointer-events: none;
}

#stw-social-proof:not(.show) {
	visibility: hidden;
	/* Keep the fade-out: delay the visibility flip until opacity has finished. */
	transition: opacity 0.15s linear, visibility 0s linear 0.15s;
}

@media (prefers-reduced-motion: reduce) {
	#stw-social-proof:not(.show) {
		transition: none;
	}
}

/*
 * Desktop card: the whole card is one link (the product name carries
 * Bootstrap's .stretched-link, whose ::after covers the .position-relative
 * card). The card takes clicks only while the toast is showing; the close
 * button sits above the stretched link so it closes instead of navigating.
 */
#stw-social-proof.show .stw-sp-card {
	pointer-events: auto;
}

#stw-social-proof .btn-close {
	position: relative;
	z-index: 2;
}

#stw-social-proof .stretched-link:hover {
	text-decoration: underline !important;
}

/* The link text alone would show a tiny focus ring; ring the whole card. */
#stw-social-proof .stretched-link:focus-visible {
	outline: none;
}

#stw-social-proof .stretched-link:focus-visible::after {
	outline: 2px solid #0d6efd;
	outline-offset: -2px;
	border-radius: 0.375rem;
}

/* Below Bootstrap's md breakpoint (768px) the toast is not shown at all.
   notification.js uses the same query to skip the REST fetch. */
@media (max-width: 767.98px) {
	#stw-social-proof {
		display: none !important;
	}
}

@media (max-width: 991.98px) {
	#stw-social-proof {
		/* !important: the container carries an inline max-width as a fallback. */
		max-width: 260px !important;
	}

	#stw-social-proof #stw-sp-image {
		width: 40px;
		height: 40px;
	}

	#stw-social-proof #stw-sp-text,
	#stw-social-proof #stw-sp-time {
		font-size: 0.75rem;
	}
}
