/**
 * Social Proof for WooCommerce — storefront.
 *
 * Everything visual comes from the custom properties printed by the plugin, so
 * a child theme can override one value without fighting selector specificity.
 */

.wcsp-stack {
	position: fixed;
	z-index: 9998;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: var( --wcsp-max-width, 320px );
	pointer-events: none;
}

.wcsp-stack > * {
	pointer-events: auto;
}

.wcsp-pos-bottom-left  { bottom: 20px; left: 20px; }
.wcsp-pos-bottom-right { bottom: 20px; right: 20px; align-items: flex-end; }
.wcsp-pos-top-left     { top: 20px; left: 20px; }
.wcsp-pos-top-right    { top: 20px; right: 20px; align-items: flex-end; }

.wcsp-pos-bar-bottom,
.wcsp-pos-bar-top {
	left: 0;
	right: 0;
	max-width: none;
	align-items: stretch;
	gap: 0;
}

.wcsp-pos-bar-bottom { bottom: 0; }
.wcsp-pos-bar-top    { top: 0; }

.wcsp-pos-bar-bottom .wcsp-block,
.wcsp-pos-bar-top .wcsp-block {
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	justify-content: center;
	max-width: none;
}

.wcsp-pos-inline { display: none; }

/* ------------------------------------------------------------------ block */

.wcsp-block {
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	padding: 10px 14px;
	background: var( --wcsp-bg, #fff );
	color: var( --wcsp-text, #1f2933 );
	border: 1px solid var( --wcsp-border, #e3e8ee );
	border-radius: var( --wcsp-radius, 12px );
	box-shadow: var( --wcsp-shadow, none );
	font-size: var( --wcsp-font-size, 14px );
	line-height: 1.35;
	max-width: var( --wcsp-max-width, 320px );
}

.wcsp-block__icon {
	flex: 0 0 auto;
	font-size: 1.1em;
	line-height: 1;
}

.wcsp-block__thumb {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: calc( var( --wcsp-radius, 12px ) / 2 );
}

.wcsp-block__text {
	flex: 1 1 auto;
	min-width: 0;
}

.wcsp-block__text a {
	color: var( --wcsp-accent, currentColor );
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wcsp-block__close {
	flex: 0 0 auto;
	margin: -4px -6px -4px 0;
	padding: 0 6px;
	background: none;
	border: 0;
	color: inherit;
	opacity: 0.55;
	font-size: 1.15em;
	line-height: 1;
	cursor: pointer;
}

.wcsp-block__close:hover,
.wcsp-block__close:focus-visible {
	opacity: 1;
}

.wcsp-block__close:focus-visible {
	outline: 2px solid var( --wcsp-accent, currentColor );
	outline-offset: 2px;
	border-radius: 3px;
}

/* Inline placements sit in the page flow and stay quieter than a toast. */

.wcsp-block--inline {
	box-shadow: none;
	margin: 8px 0;
	width: 100%;
}

.wcsp-block--cart {
	display: inline-flex;
	margin: 6px 0 0;
	padding: 4px 8px;
	font-size: calc( var( --wcsp-font-size, 14px ) - 1px );
}

.wcsp-loop .wcsp-block--inline {
	margin: 6px 0 0;
	padding: 5px 9px;
	font-size: calc( var( --wcsp-font-size, 14px ) - 1px );
}

/* -------------------------------------------------------------- animation */

.wcsp-anim-fade,
.wcsp-anim-slide-up,
.wcsp-anim-slide-in {
	animation-duration: 260ms;
	animation-timing-function: cubic-bezier( 0.22, 1, 0.36, 1 );
	animation-fill-mode: both;
}

.wcsp-anim-fade     { animation-name: wcsp-fade; }
.wcsp-anim-slide-up { animation-name: wcsp-slide-up; }
.wcsp-anim-slide-in { animation-name: wcsp-slide-in; }

@keyframes wcsp-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes wcsp-slide-up {
	from { opacity: 0; transform: translateY( 12px ); }
	to   { opacity: 1; transform: none; }
}

@keyframes wcsp-slide-in {
	from { opacity: 0; transform: translateX( -16px ); }
	to   { opacity: 1; transform: none; }
}

.wcsp-block--leaving {
	opacity: 0;
	transform: translateY( 6px );
	transition: opacity 240ms ease, transform 240ms ease;
}

@media ( prefers-reduced-motion: reduce ) {
	.wcsp-block,
	.wcsp-block--leaving {
		animation: none !important;
		transition: none !important;
		transform: none !important;
	}
}

/* ----------------------------------------------------------------- mobile */

@media ( max-width: 782px ) {
	.wcsp-stack {
		left: 10px;
		right: 10px;
		max-width: none;
		align-items: stretch;
	}

	.wcsp-block {
		max-width: none;
	}
}
