/**
 * FG Free Shipping Notifier — Toast Styles
 *
 * Each of the six positions is defined explicitly so that the required
 * translateX(-50%) for centered variants can be combined cleanly with
 * the entry/exit translateY animation without CSS specificity fights.
 */

/* -----------------------------------------------------------------------
   Base — shared across all positions and types
   ---------------------------------------------------------------------- */

.fg-fsn-toast {
	position: fixed;
	z-index: 9999999; /* above side-cart premium modal (9999997) */
	max-width: 360px;
	width: calc(100% - 40px); /* stays within viewport on mobile */
	padding: 14px 48px 14px 16px;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
	font-size: 14px;
	line-height: 1.55;
	color: #ffffff;
	background-color: #1a1a1a;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
	box-sizing: border-box;
}

.fg-fsn-toast.fg-fsn-toast--visible {
	opacity: 1;
	pointer-events: auto;
}

/* -----------------------------------------------------------------------
   Positions — hidden / visible transforms defined per variant
   ---------------------------------------------------------------------- */

/* Top-left */
.fg-fsn-toast.fg-fsn-position--top-left {
	top: 20px;
	left: 20px;
	transform: translateY(-10px);
}
.fg-fsn-toast.fg-fsn-position--top-left.fg-fsn-toast--visible {
	transform: translateY(0);
}

/* Top-center */
.fg-fsn-toast.fg-fsn-position--top-center {
	top: 20px;
	left: 50%;
	transform: translateX(-50%) translateY(-10px);
}
.fg-fsn-toast.fg-fsn-position--top-center.fg-fsn-toast--visible {
	transform: translateX(-50%) translateY(0);
}

/* Top-right */
.fg-fsn-toast.fg-fsn-position--top-right {
	top: 20px;
	right: 20px;
	transform: translateY(-10px);
}
.fg-fsn-toast.fg-fsn-position--top-right.fg-fsn-toast--visible {
	transform: translateY(0);
}

/* Bottom-left */
.fg-fsn-toast.fg-fsn-position--bottom-left {
	bottom: 20px;
	left: 20px;
	transform: translateY(10px);
}
.fg-fsn-toast.fg-fsn-position--bottom-left.fg-fsn-toast--visible {
	transform: translateY(0);
}

/* Bottom-center */
.fg-fsn-toast.fg-fsn-position--bottom-center {
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
}
.fg-fsn-toast.fg-fsn-position--bottom-center.fg-fsn-toast--visible {
	transform: translateX(-50%) translateY(0);
}

/* Bottom-right */
.fg-fsn-toast.fg-fsn-position--bottom-right {
	bottom: 20px;
	right: 20px;
	transform: translateY(10px);
}
.fg-fsn-toast.fg-fsn-position--bottom-right.fg-fsn-toast--visible {
	transform: translateY(0);
}

/* -----------------------------------------------------------------------
   Types
   ---------------------------------------------------------------------- */

.fg-fsn-toast.fg-fsn-toast--success {
	background-color: #1e7e4e;
}

/* -----------------------------------------------------------------------
   Inner elements
   ---------------------------------------------------------------------- */

.fg-fsn-toast__message {
	display: block;
}

/* wc_price() wraps the amount in <span class="woocommerce-Price-amount"><bdi>…</bdi></span>.
   Ensure those inherit the white text colour so the price is legible. */
.fg-fsn-toast .woocommerce-Price-amount,
.fg-fsn-toast bdi {
	color: inherit;
}

/* Close button */
.fg-fsn-toast__close {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 3px;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.fg-fsn-toast__close:hover,
.fg-fsn-toast__close:focus {
	opacity: 1;
	background-color: rgba(255, 255, 255, 0.15);
	outline: none;
}

/* -----------------------------------------------------------------------
   Responsive — on narrow screens stick to the edges with a small margin
   ---------------------------------------------------------------------- */

@media (max-width: 480px) {
	.fg-fsn-toast {
		max-width: calc(100% - 20px);
	}

	/* Override specific positioning for mobile to prevent off-screen clipping */
	.fg-fsn-toast.fg-fsn-position--top-left,
	.fg-fsn-toast.fg-fsn-position--top-right,
	.fg-fsn-toast.fg-fsn-position--top-center {
		top: 10px;
	}

	.fg-fsn-toast.fg-fsn-position--bottom-left,
	.fg-fsn-toast.fg-fsn-position--bottom-right,
	.fg-fsn-toast.fg-fsn-position--bottom-center {
		bottom: 10px;
	}

	/* Left/right anchored — let them stay near their edge */
	.fg-fsn-toast.fg-fsn-position--top-left,
	.fg-fsn-toast.fg-fsn-position--bottom-left {
		left: 10px;
	}

	.fg-fsn-toast.fg-fsn-position--top-right,
	.fg-fsn-toast.fg-fsn-position--bottom-right {
		right: 10px;
	}
}
