/**
 * GDV Toast — styles for the shared toast notifications (assets/js/gdv-toast.js).
 *
 * Loaded in both the public theme and the admin. Colours chain to the gdv-admin-ui
 * tokens where present (admin), falling back to literal semantic values so the
 * toast looks correct on the public front end too. The dismiss control resets the
 * theme's global <button> styling so it stays a plain icon.
 */

.gdv-toast-region {
	position: fixed;
	z-index: 100000;
	right: 24px;
	bottom: 24px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: min( 360px, calc( 100vw - 32px ) );
	pointer-events: none;
}

.gdv-toast {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var( --gdv-ui-radius-sm, 6px );
	border-left: 4px solid var( --gdv-toast-accent, #50575e );
	background: var( --gdv-ui-surface, #ffffff );
	color: var( --gdv-ui-text, #1d2327 );
	box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.16 );
	font-size: 14px;
	line-height: 1.45;
	pointer-events: auto;
	opacity: 0;
	transform: translateY( 12px );
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.gdv-toast.is-visible {
	opacity: 1;
	transform: translateY( 0 );
}

.gdv-toast--success {
	--gdv-toast-accent: var( --gdv-ui-success, #2e7d32 );
}

.gdv-toast--error {
	--gdv-toast-accent: var( --gdv-ui-danger, #c0392b );
}

.gdv-toast--warning {
	--gdv-toast-accent: var( --gdv-ui-warning, #b7791f );
}

.gdv-toast--info {
	--gdv-toast-accent: var( --gdv-ui-info, #2271b1 );
}

.gdv-toast__message {
	flex: 1 1 auto;
}

.gdv-toast__dismiss {
	flex: 0 0 auto;
	width: auto;
	min-width: 0;
	margin: -4px -4px -4px 0;
	padding: 0 6px;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
}

.gdv-toast__dismiss:hover,
.gdv-toast__dismiss:focus-visible {
	opacity: 1;
}

@media ( max-width: 600px ) {
	.gdv-toast-region {
		right: 16px;
		bottom: 16px;
		left: 16px;
		max-width: none;
	}

	.gdv-toast__dismiss {
		width: auto;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.gdv-toast {
		transform: none;
		transition: opacity 0.2s ease;
	}
}
