/**
 * Frontend popup styles for Smart Sales Popup.
 *
 * Uses CSS custom properties injected by PHP layout presets.
 *
 * @package WC_Smart_Sales_Popup
 */

/* ---- Popup Base ---- */

#wc-ssp-popup {
	position: fixed;
	z-index: 999999;
	max-width: 380px;
	display: none;
	background: var(--wc-ssp-popup-bg, #fff);
	color: var(--wc-ssp-popup-text, #1a1a2e);
	border-radius: var(--wc-ssp-popup-radius, 12px);
	box-shadow: var(--wc-ssp-popup-shadow, 0 8px 32px rgba(0, 0, 0, 0.12));
	padding: var(--wc-ssp-popup-padding, 16px);
	font-size: var(--wc-ssp-popup-font-size, 13px);
}

#wc-ssp-popup.wc-ssp-bottom-right {
	bottom: 20px;
	right: 20px;
}

#wc-ssp-popup.wc-ssp-bottom-left {
	bottom: 20px;
	left: 20px;
}

#wc-ssp-popup.wc-ssp-top-right {
	top: 20px;
	right: 20px;
}

#wc-ssp-popup.wc-ssp-top-left {
	top: 20px;
	left: 20px;
}

/* ---- Popup Inner ---- */

#wc-ssp-popup .wc-ssp-popup-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	border-left: var(--wc-ssp-popup-border-left, none);
	border-top: var(--wc-ssp-popup-border-top, none);
}

/* ---- Popup Item ---- */

.wc-ssp-popup-item {
	animation: wc-ssp-slide-in 0.5s ease-out;
}

.wc-ssp-popup-item.wc-ssp-hide {
	animation: wc-ssp-slide-out 0.5s ease-in forwards;
}

/* ---- Popup Image ---- */

.wc-ssp-popup-image {
	flex: 0 0 auto;
}

.wc-ssp-popup-image img {
	display: block;
	width: var(--wc-ssp-popup-img-size, 60px);
	height: var(--wc-ssp-popup-img-size, 60px);
	object-fit: cover;
	border-radius: var(--wc-ssp-popup-avatar, 0px);
}

.wc-ssp-popup-image.wc-ssp-image-rounded img {
	border-radius: 50%;
}

/* ---- Popup Content ---- */

.wc-ssp-popup-content {
	flex: 1;
	min-width: 0;
}

/* ---- Message & Time ---- */

.wc-ssp-message {
	margin: 0 0 4px;
	font-size: inherit;
	line-height: 1.4;
}

.wc-ssp-message a {
	color: inherit;
	text-decoration: underline;
}

.wc-ssp-time {
	opacity: 0.7;
	font-size: 0.85em;
}

/* ---- Close Button ---- */

.wc-ssp-popup-close {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.1);
	color: inherit;
	transition: background 0.2s;
	z-index: 10;
	line-height: 1;
}

.wc-ssp-popup-close:hover {
	background: rgba(0, 0, 0, 0.25);
}

.wc-ssp-popup-close img {
	display: block;
	pointer-events: none;
}

/* ---- Legacy close (kept for backward compat) ---- */

.wc-ssp-close {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
	background: rgba(0, 0, 0, 0.1);
	color: inherit;
	transition: background 0.2s;
	z-index: 10;
}

.wc-ssp-close:hover {
	background: rgba(0, 0, 0, 0.25);
}

/* ---- Popup Animations ---- */

@keyframes wc-ssp-slide-in {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes wc-ssp-slide-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(30px);
	}
}

/* ---- Responsive Popup ---- */

@media (max-width: 480px) {
	#wc-ssp-popup {
		max-width: 90vw;
		left: 5% !important;
		right: 5% !important;
	}
}
