#spp-container,
#spp-container * {
	box-sizing: border-box;
}

#spp-container {
	position: fixed !important;
	z-index: 2147483000 !important;
	pointer-events: none;
	max-width: var(--spp-max-width, 360px);
	width: calc(100% - 32px);
	display: block;
}

#spp-container.spp-pos-bottom-left {
	left: 16px;
	right: auto;
	top: auto;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
#spp-container.spp-pos-bottom-right {
	right: 16px;
	left: auto;
	top: auto;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
#spp-container.spp-pos-top-left {
	left: 16px;
	right: auto;
	bottom: auto;
	top: calc(16px + env(safe-area-inset-top, 0px));
}
#spp-container.spp-pos-top-right {
	right: 16px;
	left: auto;
	bottom: auto;
	top: calc(16px + env(safe-area-inset-top, 0px));
}

.spp-toast {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	max-width: 100%;
	background: var(--spp-bg, #ffffff);
	color: var(--spp-text, #1a1a1a);
	border-radius: var(--spp-radius, 12px);
	border: var(--spp-border-width, 0px) solid var(--spp-border-color, transparent);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
	padding: var(--spp-pad-y, 14px) var(--spp-pad-right, 34px) var(--spp-pad-y, 14px) var(--spp-pad-x, 14px);
	pointer-events: auto;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.2s ease, border-width 0.2s ease, border-radius 0.2s ease, padding 0.15s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	text-decoration: none;
	position: relative;
	overflow: hidden;
}

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

#spp-container.spp-pos-top-left .spp-toast,
#spp-container.spp-pos-top-right .spp-toast {
	transform: translateY(-20px);
}
#spp-container.spp-pos-top-left .spp-toast.spp-visible,
#spp-container.spp-pos-top-right .spp-toast.spp-visible {
	transform: translateY(0);
}

/* ---------- Icon (letter avatar OR image: cart / custom / product) ---------- */

.spp-toast-icon {
	flex: 0 0 auto;
	width: var(--spp-icon-size, 38px);
	height: var(--spp-icon-size, 38px);
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.spp-icon-letter {
	background: var(--spp-icon, var(--spp-accent, #2e7d32));
	color: #fff;
	font-size: calc(var(--spp-icon-size, 38px) * 0.42);
	font-weight: 700;
	text-transform: uppercase;
	line-height: 1;
}

.spp-icon-image {
	background: #f3f4f6;
	border: 2px solid var(--spp-icon, var(--spp-accent, #2e7d32));
}

.spp-icon-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.spp-toast-body {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
}

.spp-toast-title {
	margin: 0 0 2px;
	font-size: var(--spp-title-size, 13.5px);
	line-height: 1.4;
	color: var(--spp-text, #1a1a1a);
	overflow-wrap: break-word;
	word-break: break-word;
	hyphens: auto;
}

.spp-toast-title .spp-accent {
	color: var(--spp-accent, #2e7d32);
}

.spp-toast-meta {
	margin: 0;
	font-size: var(--spp-meta-size, 11.5px);
	color: var(--spp-sub, #6b7280);
	display: flex;
	align-items: center;
	gap: 6px;
	overflow-wrap: break-word;
	word-break: break-word;
}

.spp-toast-close {
	position: absolute;
	top: 0;
	right: 0;
	width: var(--spp-close-size, 34px);
	height: var(--spp-close-size, 34px);
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: var(--spp-sub, #6b7280);
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.spp-toast-close:hover,
.spp-toast-close:focus {
	color: var(--spp-text, #1a1a1a);
	outline: none;
}

/* ---------- Shapes ---------- */

/* Pill: fully rounded stadium shape, always overrides the radius setting. */
#spp-container.spp-shape-pill .spp-toast {
	border-radius: 999px !important;
}

/* Ribbon: angled cut on the bottom-right corner for a banner/ticket look.
   The cut sits on the bottom-right, away from the close button (top-right),
   and extra bottom padding keeps text clear of the diagonal edge. */
#spp-container.spp-shape-ribbon .spp-toast {
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
	padding-bottom: calc(var(--spp-pad-y, 14px) + 6px);
	border-radius: var(--spp-radius, 12px);
}

/* ---------- Responsive: keep screen-edge margins safe on small phones ---------- */
@media (max-width: 600px) {
	#spp-container {
		width: calc(100% - 24px);
	}
	#spp-container.spp-pos-bottom-left {
		left: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}
	#spp-container.spp-pos-bottom-right {
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}
	#spp-container.spp-pos-top-left {
		left: 12px;
		top: calc(12px + env(safe-area-inset-top, 0px));
	}
	#spp-container.spp-pos-top-right {
		right: 12px;
		top: calc(12px + env(safe-area-inset-top, 0px));
	}
}

@media (max-width: 380px) {
	#spp-container.spp-shape-ribbon .spp-toast {
		clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%);
	}
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
	.spp-toast {
		transition: opacity 0.15s linear;
		transform: none !important;
	}
}
