/**
 * WC Live Sales Notification — front-end styles
 */

.wclsn-root {
	position: fixed;
	z-index: var( --wclsn-z, 999990 );
	width: min( var( --wclsn-max-width, 500px ), calc( 100vw - 24px ) );
	pointer-events: none;
}

.wclsn-card {
	display: flex;
	align-items: center;
	gap: 16px;
	box-sizing: border-box;
	width: 100%;
	padding: 14px;
	background: var( --wclsn-bg, #fff );
	border-radius: var( --wclsn-radius, 20px );
	box-shadow: 0 10px 34px rgba( 15, 23, 42, 0.16 ), 0 2px 8px rgba( 15, 23, 42, 0.08 );
	color: var( --wclsn-text, #141414 );
	font-size: 16px;
	line-height: 1.35;
	text-decoration: none;
	pointer-events: auto;
	opacity: 0;
	transform: translateX( var( --wclsn-slide-from, -24px ) ) scale( 0.97 );
	transition: opacity 0.42s cubic-bezier( 0.22, 1, 0.36, 1 ), transform 0.42s cubic-bezier( 0.22, 1, 0.36, 1 );
	will-change: opacity, transform;
}

a.wclsn-card,
a.wclsn-card:hover,
a.wclsn-card:focus {
	color: var( --wclsn-text, #141414 );
	text-decoration: none;
	box-shadow: 0 10px 34px rgba( 15, 23, 42, 0.16 ), 0 2px 8px rgba( 15, 23, 42, 0.08 );
}

.wclsn-card.is-visible {
	opacity: 1;
	transform: translateX( 0 ) scale( 1 );
}

/* Media ------------------------------------------------------------------ */

.wclsn-media {
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	overflow: hidden;
	border-radius: 14px;
	background: #f1f3f5;
}

.wclsn-media img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	border-radius: inherit;
}

/* Body ------------------------------------------------------------------- */

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

.wclsn-row {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.wclsn-row + .wclsn-row {
	margin-top: 6px;
}

.wclsn-dot {
	position: relative;
	flex: 0 0 auto;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var( --wclsn-accent, #128040 );
}

.wclsn-dot.is-blinking::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	content: "";
	border-radius: 50%;
	background: var( --wclsn-accent, #128040 );
	transform: translate( -50%, -50% );
	animation: wclsn-pulse 1.6s ease-out infinite;
}

@keyframes wclsn-pulse {
	0% {
		opacity: 0.55;
		transform: translate( -50%, -50% ) scale( 1 );
	}
	70% {
		opacity: 0;
		transform: translate( -50%, -50% ) scale( 2.6 );
	}
	100% {
		opacity: 0;
		transform: translate( -50%, -50% ) scale( 2.6 );
	}
}

.wclsn-verified {
	color: var( --wclsn-accent, #128040 );
	font-weight: 700;
	white-space: nowrap;
}

.wclsn-sep {
	color: #d1d5db;
	font-weight: 400;
}

.wclsn-name {
	overflow: hidden;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Two-line clamp so a long product name never hides the "purchased" word. */
.wclsn-line2 {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	font-size: 1.06em;
	white-space: normal;
}

.wclsn-product {
	color: var( --wclsn-accent, #128040 );
	font-weight: 700;
}

.wclsn-purchased {
	font-weight: 600;
}

.wclsn-time {
	color: var( --wclsn-muted, #6b7280 );
	font-size: 0.92em;
	white-space: nowrap;
}

.wclsn-clock {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	color: var( --wclsn-muted, #6b7280 );
}

/* Mobile ----------------------------------------------------------------- */

@media ( max-width: 767px ) {

	.wclsn-root {
		width: auto;
	}

	.wclsn-card {
		gap: 12px;
		padding: 10px;
		border-radius: 16px;
		font-size: 13.5px;
		transform: translateY( var( --wclsn-m-slide, 16px ) ) scale( 0.98 );
	}

	.wclsn-card.is-visible {
		transform: translateY( 0 ) scale( 1 );
	}

	.wclsn-media {
		width: 62px;
		height: 62px;
		border-radius: 11px;
	}

	.wclsn-row + .wclsn-row {
		margin-top: 3px;
	}

	.wclsn-dot {
		width: 9px;
		height: 9px;
	}

	.wclsn-clock {
		width: 14px;
		height: 14px;
	}
}

/* Accessibility ---------------------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {

	.wclsn-card {
		transform: none !important;
		transition: opacity 0.2s linear;
	}

	.wclsn-dot.is-blinking::after {
		animation: none;
	}
}

@media print {

	.wclsn-root {
		display: none !important;
	}
}
