/* Floating notices (assets/js/cart-toast.js). */

.ideya-toasts {
	position: fixed;
	top: 6.75rem;
	right: clamp(1rem, 2.5vw, 1.6rem);
	z-index: 1160;
	display: grid;
	width: min(24rem, calc(100vw - 2rem));
	gap: 0.6rem;
	pointer-events: none;
}

.ideya-toast {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: start;
	gap: 0.85rem;
	padding: 1rem 0.85rem 1.1rem 1rem;
	overflow: hidden;
	border: 1px solid rgba(93, 134, 202, 0.18);
	border-radius: var(--sd-radius-lg);
	background: #ffffff;
	color: var(--sd-color-text-dark);
	font-family: var(--sd-font);
	box-shadow: 0 24px 60px rgba(9, 13, 21, 0.22);
	pointer-events: auto;
	animation: ideya-toast-in 420ms cubic-bezier(0.2, 1.2, 0.4, 1);
}

.ideya-toast.is-leaving {
	animation: ideya-toast-out 300ms ease forwards;
}

@keyframes ideya-toast-in {
	from {
		opacity: 0;
		transform: translateX(2rem) scale(0.96);
	}
}

@keyframes ideya-toast-out {
	to {
		opacity: 0;
		transform: translateX(2rem);
	}
}

.ideya-toast__icon {
	display: grid;
	width: 2.4rem;
	height: 2.4rem;
	place-items: center;
	border-radius: 50%;
	background: var(--sd-gradient-signature);
	color: #ffffff;
	box-shadow: 0 8px 18px rgba(57, 120, 255, 0.3);
}

.ideya-toast--success .ideya-toast__icon {
	animation: ideya-toast-pop 520ms 160ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes ideya-toast-pop {
	from {
		transform: scale(0.4);
	}
}

.ideya-toast--error .ideya-toast__icon {
	background: linear-gradient(135deg, #f0788a, #c43a52);
	box-shadow: 0 8px 18px rgba(196, 58, 82, 0.28);
}

.ideya-toast svg {
	width: 1.15rem;
	height: 1.15rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ideya-toast__body strong {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
}

.ideya-toast__body p {
	margin: 0.25rem 0 0;
	color: var(--sd-color-text-muted-dark);
	font-size: 0.84rem;
	line-height: 1.45;
}

.ideya-toast__actions {
	display: flex;
	margin-top: 0.8rem;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.9rem;
}

.ideya-toast__cta {
	display: inline-flex;
	padding: 0.5rem 0.95rem;
	border-radius: var(--sd-radius-pill);
	background: var(--sd-gradient-signature);
	color: #ffffff !important;
	font-size: 0.82rem;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 8px 18px rgba(57, 120, 255, 0.28);
	transition: transform var(--sd-transition-fast);
}

.ideya-toast__cta:hover {
	transform: translateY(-1px);
}

.ideya-toast__later {
	padding: 0;
	border: 0;
	background: none;
	color: #3460d4;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
}

.ideya-toast__close {
	display: grid;
	width: 1.9rem;
	height: 1.9rem;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--sd-color-text-muted-dark);
	cursor: pointer;
}

.ideya-toast__close:hover {
	background: rgba(24, 39, 70, 0.06);
}

.ideya-toast__close svg {
	width: 0.95rem;
	height: 0.95rem;
	stroke-width: 2;
}

/* Time left before the notice closes itself. */
.ideya-toast__progress {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 3px;
	background: var(--sd-gradient-signature);
	transform-origin: left;
	animation: ideya-toast-progress var(--toast-duration, 7000ms) linear forwards;
}

.ideya-toast.is-paused .ideya-toast__progress {
	animation-play-state: paused;
}

@keyframes ideya-toast-progress {
	to {
		transform: scaleX(0);
	}
}

.ideya-toast__cta:focus-visible,
.ideya-toast__later:focus-visible,
.ideya-toast__close:focus-visible {
	outline: none;
	box-shadow: var(--sd-focus);
}

/* Header cart badge bounces when an item was just added. */
.ideya-cart-count.is-bumped {
	animation: ideya-cart-bump 700ms 300ms cubic-bezier(0.2, 1.8, 0.4, 1) 2;
}

@keyframes ideya-cart-bump {
	40% {
		transform: scale(1.45);
	}
}

@media (max-width: 600px) {
	.ideya-toasts {
		top: auto;
		right: 0.75rem;
		bottom: 5.5rem;
		left: 0.75rem;
		width: auto;
	}

	.ideya-toast {
		animation-name: ideya-toast-up;
	}

	@keyframes ideya-toast-up {
		from {
			opacity: 0;
			transform: translateY(1.5rem);
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.ideya-toast,
	.ideya-toast__icon,
	.ideya-cart-count.is-bumped {
		animation: none !important;
	}
}

/* The original notice is rebuilt as a toast: never show it, even for a frame. */
.woocommerce-notices-wrapper > .woocommerce-message,
.woocommerce-notices-wrapper > .woocommerce-info,
.woocommerce-notices-wrapper > .woocommerce-error {
	display: none !important;
}

/* Compact size. */
.ideya-toasts {
	width: min(20rem, calc(100vw - 2rem));
}

.ideya-toast {
	gap: 0.7rem;
	padding: 0.75rem 0.65rem 0.85rem 0.8rem;
	border-radius: var(--sd-radius-md);
}

.ideya-toast__icon {
	width: 2rem;
	height: 2rem;
}

.ideya-toast svg {
	width: 1rem;
	height: 1rem;
}

.ideya-toast__body strong {
	font-size: 0.875rem;
}

.ideya-toast__body p {
	margin-top: 0.15rem;
	font-size: 0.78rem;
}

.ideya-toast__actions {
	margin-top: 0.6rem;
	flex-wrap: nowrap;
	gap: 0.75rem;
}

.ideya-toast__cta {
	flex: none;
	padding: 0.4rem 0.8rem;
	font-size: 0.76rem;
	white-space: nowrap;
}

.ideya-toast__later {
	font-size: 0.75rem;
	white-space: nowrap;
}

.ideya-toast__close {
	width: 1.6rem;
	height: 1.6rem;
}
