/**
 * Notificação (toast) do bloqueio de carrinho misto pré-venda/disponível.
 *
 * Card retangular fixo no canto inferior direito; no mobile ocupa a largura
 * disponível com margens laterais. Entra deslizando de baixo para cima
 * (float up) e sai com a animação inversa. Não usa modal nem overlay e
 * nunca bloqueia a interação com a página.
 *
 * A duração do temporizador vem da variável --ec-toast-duration, definida
 * pelo JS no próprio elemento, para barra e fechamento automático ficarem
 * sempre sincronizados.
 */

.ec-presale-toast {
	--ec-toast-duration: 4000ms;
	--ec-toast-accent: #d3242a;

	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	width: 380px;
	max-width: calc( 100vw - 40px );
	box-sizing: border-box;
	overflow: hidden;
	padding: 18px 44px 18px 18px;
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 8px 28px rgba( 0, 0, 0, 0.16 );
	font-size: 14px;
	line-height: 1.5;
	color: #2b2b2b;

	opacity: 0;
	transform: translateY( 24px );
	transition: opacity 0.32s ease, transform 0.32s cubic-bezier( 0.22, 1, 0.36, 1 );
}

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

/* Saída: desce e some suavemente. */
.ec-presale-toast.is-leaving {
	opacity: 0;
	transform: translateY( 24px );
}

/* Barra fina no topo, encolhendo durante a duração do toast. */
.ec-presale-toast__timer {
	position: absolute;
	top: 0;
	left: 0;
	height: 3px;
	width: 100%;
	background: var( --ec-toast-accent );
	transform-origin: left center;
	border-top-left-radius: 8px;
}

.ec-presale-toast.is-visible .ec-presale-toast__timer {
	animation: ec-presale-toast-timer var( --ec-toast-duration ) linear forwards;
}

@keyframes ec-presale-toast-timer {
	from { transform: scaleX( 1 ); }
	to   { transform: scaleX( 0 ); }
}

/* Botão fechar, canto superior direito. */
.ec-presale-toast__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: #8a8a8a;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ec-presale-toast__close:hover {
	background: rgba( 0, 0, 0, 0.06 );
	color: #2b2b2b;
}

/* Ícone de alerta: branco dentro de círculo vermelho translúcido. */
.ec-presale-toast__body {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.ec-presale-toast__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba( 211, 36, 42, 0.85 );
}

.ec-presale-toast__content {
	min-width: 0;
}

.ec-presale-toast__message {
	margin: 0;
}

/* Botão "Ver carrinho", abaixo da mensagem. */
.ec-presale-toast__view-cart {
	display: inline-block;
	margin-top: 12px;
	padding: 8px 16px;
	background: var( --ec-toast-accent );
	color: #ffffff;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.ec-presale-toast__view-cart:hover,
.ec-presale-toast__view-cart:focus {
	background: #b31d22;
	color: #ffffff;
	text-decoration: none;
}

.ec-presale-toast__view-cart:focus-visible,
.ec-presale-toast__close:focus-visible {
	outline: 2px solid var( --ec-toast-accent );
	outline-offset: 2px;
}

/* Mobile: largura disponível com margens laterais. */
@media ( max-width: 600px ) {
	.ec-presale-toast {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
	}
}

/* Respeita quem pediu menos movimento no sistema. */
@media ( prefers-reduced-motion: reduce ) {
	.ec-presale-toast {
		transition: opacity 0.2s ease;
		transform: none;
	}

	.ec-presale-toast.is-visible,
	.ec-presale-toast.is-leaving {
		transform: none;
	}
}
