/**
 * Trustie Pro reviews toast.
 *
 * Brand Hub variables only - no CSS filters, no hard-coded brand colours.
 * Font falls back to the page's own (inherit), never a system stack.
 * The owner picks the corner and nudges it in pixels (--trustie-toast-x /
 * --trustie-toast-y, set by the script) to clear logins, back-to-top buttons
 * and the like; on phones it spans the screen at that corner's top or bottom.
 * Sits below the fly-out panel (z-index 99999).
 */

.trustie-toast {
	position: fixed;
	z-index: 99990;
	width: 320px;
	max-width: calc(100vw - 32px);
	box-sizing: border-box;
	padding: 14px 36px 14px 16px;
	background: var(--tracksies-color-surface, #fff);
	color: var(--tracksies-color-text, inherit);
	border: 1px solid var(--tracksies-color-border, #e5e7eb);
	border-radius: var(--tracksies-radius-medium, 8px);
	box-shadow: var(--tracksies-shadow-elevated, 0 8px 24px rgba(0, 0, 0, 0.12));
	font-family: var(--tracksies-font-body, inherit);
	font-size: var(--tracksies-font-size-small, 14px);
	line-height: 1.45;
	animation: trustie-toast-in 0.3s ease-out;
}

.trustie-toast--bottom-left { left: var(--trustie-toast-x, 16px); bottom: var(--trustie-toast-y, 16px); }
.trustie-toast--bottom-right { right: var(--trustie-toast-x, 16px); bottom: var(--trustie-toast-y, 16px); }
.trustie-toast--top-left { left: var(--trustie-toast-x, 16px); top: var(--trustie-toast-y, 16px); }
.trustie-toast--top-right { right: var(--trustie-toast-x, 16px); top: var(--trustie-toast-y, 16px); }

/* The fly-out's tab sits in this bottom corner: stack above it. */
.trustie-toast--above-widget.trustie-toast--bottom-left,
.trustie-toast--above-widget.trustie-toast--bottom-right {
	bottom: calc(var(--trustie-toast-y, 16px) + 72px);
}

.trustie-toast__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--tracksies-color-text, inherit);
	font: inherit;
	font-size: 20px;
	line-height: 28px;
	cursor: pointer;
	border-radius: var(--tracksies-radius-small, 4px);
}

.trustie-toast__close:focus-visible,
.trustie-toast__card:focus-visible {
	outline: 2px solid var(--tracksies-color-primary, currentColor);
	outline-offset: 2px;
}

.trustie-toast__card {
	display: block;
	color: inherit;
	text-decoration: none;
}

a.trustie-toast__card:hover .trustie-toast__text {
	text-decoration: underline;
}

.trustie-toast__stars {
	display: block;
	margin-bottom: 4px;
	letter-spacing: 1px;
}

.trustie-toast__stars-on { color: var(--tracksies-rating-star-color, #f4af30); }
.trustie-toast__stars-off { color: var(--tracksies-rating-star-empty, #d1d5db); }

.trustie-toast__text {
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.trustie-toast__meta {
	display: block;
	margin-top: 6px;
	color: var(--tracksies-color-text-light, inherit);
	font-size: 0.9em;
}

@keyframes trustie-toast-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

/* Header: the fly-out's header colours (Designer's widget header settings),
   with the close button in it. */
.trustie-toast--has-header {
	padding: 0;
	overflow: hidden;
}

.trustie-toast__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 14px;
	background: var(--tracksies-widget-header-bg, var(--tracksies-color-primary, #3E7CB1));
	color: var(--tracksies-widget-header-text, #fff);
	font-weight: 500;
}

.trustie-toast__title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.trustie-toast__header .trustie-toast__close {
	position: static;
	flex-shrink: 0;
	color: inherit;
}

.trustie-toast__header .trustie-toast__close:focus-visible {
	outline-color: currentColor;
}

.trustie-toast--has-header .trustie-toast__slot {
	padding: 12px 16px 14px;
}

/* Phones: full width, at the top or bottom of the corner the owner chose. */
@media (max-width: 599px) {
	.trustie-toast {
		left: 12px;
		right: 12px;
		width: auto;
		max-width: none;
		padding: 10px 34px 10px 12px;
	}

	.trustie-toast--has-header {
		padding: 0;
	}

	.trustie-toast__header {
		padding: 4px 4px 4px 12px;
	}

	.trustie-toast--has-header .trustie-toast__slot {
		padding: 8px 12px 10px;
	}

	.trustie-toast__text {
		-webkit-line-clamp: 2;
	}
}

/* The fly-out's phone "Reviews" bar (trustie.css, max-width 480px) is about
   50px tall along the bottom: a bottom toast sits just above it. */
@media (max-width: 480px) {
	.trustie-toast--clear-mobile-bar.trustie-toast--bottom-left,
	.trustie-toast--clear-mobile-bar.trustie-toast--bottom-right {
		bottom: calc(var(--trustie-toast-y, 16px) + 50px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.trustie-toast {
		animation: none;
	}
}
