/* =============================================================================
 * Storzen — Sale Notification
 * Frontend styles. Scoped under .sz-sn-*
 * ========================================================================== */

.sz-sn-container {
	position: fixed;
	z-index: 99998;
	max-width: 340px;
	box-sizing: border-box;
	pointer-events: none;
}

.sz-sn-container * { box-sizing: border-box; }

/* Positions */
.sz-sn-container--bottom-left  { bottom: 20px; left: 20px; }
.sz-sn-container--bottom-right { bottom: 20px; right: 20px; }
.sz-sn-container--top-left     { top: 20px;    left: 20px; }
.sz-sn-container--top-right    { top: 20px;    right: 20px; }

/* Individual notification */
.sz-sn-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	background: #ffffff;
	color: #1f2937;
	border-radius: 10px;
	padding: 12px 14px;
	box-shadow:
		0 10px 25px rgba(0, 0, 0, 0.12),
		0 2px 6px  rgba(0, 0, 0, 0.05);
	font-family: inherit;
	font-size: 13px;
	line-height: 1.4;
	pointer-events: auto;
	min-width: 280px;
	max-width: 340px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	transition: opacity 0.3s, transform 0.3s;
}

/* Avatar / product thumb */
.sz-sn-item__avatar {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background: #f3f4f6;
	flex-shrink: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sz-sn-item__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sz-sn-item__avatar--placeholder {
	background: #FF3636;
	color: #ffffff;
	font-weight: 700;
	font-size: 15px;
}

/* Body */
.sz-sn-item__body {
	flex: 1;
	min-width: 0;
}

.sz-sn-item__message {
	font-size: 13px;
	font-weight: 500;
	color: #1f2937;
	line-height: 1.4;
	margin-bottom: 3px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sz-sn-item__product-link {
	color: #FF3636;
	text-decoration: none;
	font-weight: 600;
}

.sz-sn-item__product-link:hover { text-decoration: underline; }

.sz-sn-item__time {
	font-size: 11px;
	color: #9ca3af;
	display: flex;
	align-items: center;
	gap: 4px;
}

.sz-sn-item__time::before {
	content: '✓';
	color: #16a34a;
	font-weight: 700;
}

/* Close */
.sz-sn-item__close {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.05);
	border: none;
	color: #6b7280;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.sz-sn-item__close:hover { background: rgba(0, 0, 0, 0.1); }

/* ── Animations ─────────────────────────────────────────────────────────── */

/* Slide up (default) */
.sz-sn-container--slide-up .sz-sn-item {
	transform: translateY(20px);
	opacity: 0;
}
.sz-sn-container--slide-up .sz-sn-item.is-visible {
	transform: translateY(0);
	opacity: 1;
}
.sz-sn-container--slide-up .sz-sn-item.is-hiding {
	transform: translateY(10px);
	opacity: 0;
}

/* Slide from side — direction depends on container position */
.sz-sn-container--bottom-left.sz-sn-container--slide-side  .sz-sn-item,
.sz-sn-container--top-left.sz-sn-container--slide-side     .sz-sn-item {
	transform: translateX(-30px);
	opacity: 0;
}
.sz-sn-container--bottom-right.sz-sn-container--slide-side .sz-sn-item,
.sz-sn-container--top-right.sz-sn-container--slide-side    .sz-sn-item {
	transform: translateX(30px);
	opacity: 0;
}
.sz-sn-container--slide-side .sz-sn-item.is-visible {
	transform: translateX(0);
	opacity: 1;
}
.sz-sn-container--slide-side .sz-sn-item.is-hiding { opacity: 0; }

/* Fade */
.sz-sn-container--fade .sz-sn-item             { opacity: 0; }
.sz-sn-container--fade .sz-sn-item.is-visible  { opacity: 1; }
.sz-sn-container--fade .sz-sn-item.is-hiding   { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
	.sz-sn-item { transition: opacity 0.15s; transform: none !important; }
}

/* Mobile — pin to viewport edges */
@media (max-width: 480px) {
	.sz-sn-container--bottom-left,
	.sz-sn-container--bottom-right {
		bottom: 10px;
		left: 10px;
		right: 10px;
		max-width: none;
	}
	.sz-sn-container--top-left,
	.sz-sn-container--top-right {
		top: 10px;
		left: 10px;
		right: 10px;
		max-width: none;
	}
	.sz-sn-item {
		min-width: 0;
		max-width: none;
	}
}

/* Hidden JSON payload */
.sz-sn-data { display: none; }
