/**
 * EW Enhance - floating sales ticker.
 * Scoped to .ew-ticker so the theme and page builders stay untouched.
 */

.ew-ticker {
	position: fixed;
	bottom: 24px;
	left: 24px;
	z-index: 9000;
	width: 360px;
	max-width: calc(100vw - 32px);
	pointer-events: none;
	font-size: 13px;
	line-height: 1.4;
}

.ew-ticker[data-pos="bottom-right"] {
	left: auto;
	right: 24px;
}

.ew-ticker,
.ew-ticker *,
.ew-ticker *::before,
.ew-ticker *::after {
	box-sizing: border-box;
}

/* ---------- Toast card ---------- */

.ew-ticker-toast {
	display: flex;
	align-items: stretch;
	gap: 12px;
	padding: 12px;
	background: #ffffff;
	border: 1px solid rgba(22, 24, 35, 0.08);
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(22, 24, 35, 0.16), 0 2px 6px rgba(22, 24, 35, 0.06);
	color: #161823;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0.28s;
}

.ew-ticker-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s;
}

/* ---------- Thumbnail + bag badge ---------- */

.ew-ticker-media {
	position: relative;
	flex: 0 0 auto;
	width: 76px;
}

.ew-ticker-thumb {
	display: block;
	width: 76px;
	height: 76px;
	border-radius: 10px;
	object-fit: cover;
	background: #f6f6f8;
}

.ew-ticker-badge {
	position: absolute;
	top: -8px;
	left: -8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #161823;
	color: #ffffff;
	box-shadow: 0 2px 6px rgba(22, 24, 35, 0.3);
}

.ew-ticker-badge svg {
	display: block;
	width: 14px;
	height: 14px;
}

/* ---------- Copy ---------- */

.ew-ticker-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 4px;
	min-width: 0;
	/* Match the thumbnail so the timer row can sit on the card's bottom edge. */
	min-height: 76px;
}

.ew-ticker-title {
	display: -webkit-box;
	margin: 0;
	padding: 0;
	overflow: hidden;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	color: #161823;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ew-ticker-title strong {
	font-weight: 700;
}

.ew-ticker-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 4px;
}

.ew-ticker-time {
	font-size: 12px;
	line-height: 1.3;
	color: #8a8b91;
	white-space: nowrap;
}

.ew-ticker-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	padding: 7px 14px;
	border-radius: 999px;
	background: #161823;
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.ew-ticker-btn:hover,
.ew-ticker-btn:focus {
	background: #2b2d3a;
	color: #ffffff;
	text-decoration: none;
}

.ew-ticker-btn:focus-visible {
	outline: 2px solid #fe2c55;
	outline-offset: 2px;
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
	.ew-ticker,
	.ew-ticker[data-pos="bottom-right"] {
		right: 12px;
		left: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
	}

	.ew-ticker-media,
	.ew-ticker-thumb {
		width: 64px;
	}

	.ew-ticker-thumb {
		height: 64px;
	}

	.ew-ticker-body {
		min-height: 64px;
	}

	.ew-ticker-title {
		font-size: 12px;
	}

	.ew-ticker-btn {
		padding: 6px 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ew-ticker-toast,
	.ew-ticker-toast.is-visible {
		transform: none;
		transition: opacity 0.1s linear, visibility 0s;
	}
}
