/**
 * Smart Campaign Manager - Public styles.
 */

/* ── Announcement Bar ── */
#scm-bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	padding: 0 48px 0 16px; /* right padding reserves space for close btn */
	min-height: 44px;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Inner content group — centered, all items together */
.scm-bar-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 10px 0;
}

#scm-bar-text {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.1px;
}

/* Separator dot between bar text and social proof */
.scm-bar-separator {
	opacity: 0.5;
	font-size: 12px;
	flex-shrink: 0;
}

.scm-social-proof {
	font-size: 12px;
	font-weight: 500;
	opacity: 0.85;
}

/* Timer — styled as a subtle pill */
#scm-timer {
	font-family: 'Courier New', Courier, monospace;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	background: rgba(0, 0, 0, 0.18);
	padding: 3px 10px;
	border-radius: 4px;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Close button — absolutely positioned top-right, always visible */
#scm-bar-close {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: inherit;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
	padding: 3px 7px;
	transition: background 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	flex-shrink: 0;
}
#scm-bar-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

body.scm-bar-visible {
	padding-top: var(--scm-bar-height, 44px);
}

/* ── Body offset when admin bar is present ── */
.admin-bar #scm-bar {
	top: 32px;
}
@media screen and (max-width: 782px) {
	.admin-bar #scm-bar {
		top: 46px;
	}
}

/* ── Mobile responsive ── */
@media (max-width: 640px) {
	#scm-bar {
		font-size: 13px;
		padding: 0 40px 0 12px;
	}
	#scm-bar-text {
		font-size: 13px;
	}
	.scm-social-proof {
		font-size: 11px;
	}
	#scm-timer {
		font-size: 12px;
		padding: 2px 8px;
	}
}

/* ── Urgency badge on product cards ── */
.scm-urgency-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: linear-gradient(135deg, #ef4444, #dc2626);
	color: #ffffff;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	z-index: 5;
	letter-spacing: 0.2px;
	box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
	pointer-events: none;
	white-space: nowrap;
}

/* Ensure the WooCommerce product image wrapper has relative positioning */
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce ul.products li.product a.woocommerce-loop-product__link {
	position: relative;
	display: block;
}

/* ── Cart urgency notice ── */
.scm-cart-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	padding: 12px 18px;
	border-radius: 8px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	font-weight: 600;
	font-size: 14px;
	width: 100%;
	box-sizing: border-box;
}
.scm-cart-notice::before {
	content: '⏳';
	font-size: 16px;
	flex-shrink: 0;
}
.scm-cart-text {
	flex: 1;
}
.scm-cart-countdown {
	font-family: 'Courier New', monospace;
	font-weight: 700;
	color: #c2410c;
}

/* ── Product page urgency text ── */
.scm-product-urgency {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 12px;
	padding: 8px 14px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-left: 3px solid #f97316;
	border-radius: 0 6px 6px 0;
	font-size: 13px;
	font-weight: 600;
	color: #9a3412;
}
.scm-product-urgency::before {
	content: '🔥';
	font-size: 14px;
}

/* ── Bar position: bottom ── */
#scm-bar.scm-bar-bottom {
	top: auto;
	bottom: 0;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
}

/* ── Last-hour urgency mode ── */
@keyframes scm-final-hour-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
	50%      { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
#scm-bar.scm-bar-final-hour {
	animation: scm-final-hour-pulse 1.4s ease-in-out infinite;
}
#scm-bar.scm-bar-final-hour #scm-timer,
#scm-bar.scm-bar-final-hour .scm-shortcode-countdown-timer {
	background: rgba(220, 38, 38, 0.95);
	color: #fff;
	font-weight: 800;
}
.scm-cart-notice.scm-bar-final-hour,
body.scm-bar-final-hour .scm-cart-notice {
	border-color: #dc2626;
	background: #fef2f2;
}

/* ── Low-stock urgency badges ── */
.scm-low-stock-badge {
	display: inline-block;
	margin: 6px 0;
	padding: 3px 10px;
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fcd34d;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.2px;
	line-height: 1.4;
}
.scm-low-stock-message {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 12px;
	padding: 8px 14px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-left: 3px solid #f59e0b;
	border-radius: 0 6px 6px 0;
	font-size: 13px;
	font-weight: 600;
	color: #92400e;
}
.scm-low-stock-icon {
	font-size: 14px;
	line-height: 1;
}

/* ── Shortcode countdown ── */
.scm-shortcode-countdown {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
}
.scm-shortcode-countdown-timer {
	font-family: 'Courier New', Courier, monospace;
	font-weight: 700;
	letter-spacing: 1px;
	background: rgba(0, 0, 0, 0.08);
	padding: 3px 10px;
	border-radius: 4px;
	white-space: nowrap;
}
.scm-shortcode-banner-timer {
	font-family: 'Courier New', Courier, monospace;
	font-weight: 700;
	letter-spacing: 1px;
	background: rgba(0, 0, 0, 0.18);
	padding: 3px 10px;
	border-radius: 4px;
	white-space: nowrap;
}
.scm-shortcode-banner-proof {
	opacity: 0.6;
}

