/**
 * Frontend CSS styling for Announcement Banner.
 *
 * @package Nimbus\Essentials\Toolkit
 */

#nimbus-announcement-banner {
	/* Colors are driven by CSS custom variables injected dynamically by BannerAssets */
	background-color: var(--nimbus-banner-bg);
	color: var(--nimbus-banner-color);
	width: 100%;
	box-sizing: border-box;
	padding: 16px 24px; /* Increased breathing room */
	z-index: 99999;
	font-family: "Times New Roman", Times, Baskerville, Georgia, serif;
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Sticky positioning */
#nimbus-announcement-banner.nimbus-banner-sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Container limits width and centers content */
.nimbus-banner-container {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
	padding-right: 40px; /* Space for close button on the right */
}

/* Rows holder */
.nimbus-banner-rows {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	gap: 12px; /* Increased spacing between Row 1 and Row 2 */
}

/* Individual row styling */
.nimbus-banner-row {
	width: 100%;
}

/* Wiersz 1: Announcement */
.nimbus-banner-row-announcement {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
}

.nimbus-banner-line {
	display: block;
	width: 100%;
	line-height: 1.2;
	margin-bottom: 6px;
}

.nimbus-banner-line:last-child {
	margin-bottom: 0;
}

/* Wiersz 2: Promotion Bar */
.nimbus-banner-row-promo {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 20px; /* Balanced element spacing */
	font-size: 14px;
	width: 100%;
}

/* Promo Text block */
.nimbus-banner-promo-text {
	font-weight: 600;
	letter-spacing: 0.2px;
}

/* Countdown cells styling (Premium Store Layout) */
.nimbus-banner-countdown {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px; /* Gap between segments */
}

.nimbus-cd-segment {
	display: inline-flex;
	flex-direction: column; /* Stacked: number on top, text below */
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.14); /* Subtle card overlay */
	padding: 10px 18px;
	border-radius: 8px;
	min-width: 72px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
	box-sizing: border-box;
}

.nimbus-cd-val {
	font-size: 34px; /* Significantly larger premium numbers (32-36px) */
	font-weight: 700;
	line-height: 1;
	display: block;
	letter-spacing: -0.5px;
}

.nimbus-cd-lbl {
	font-size: 10px; /* Smaller labels underneath (10-11px) */
	font-weight: 700;
	letter-spacing: 1px;
	margin-top: 5px;
	opacity: 0.85;
	line-height: 1;
}

/* CTA Button styling closer to Blocksy */
.nimbus-banner-cta-button {
	display: inline-block;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	padding: 8px 20px; /* Improved padding */
	border-radius: 30px; /* Blocksy-like premium rounded pill */
	background-color: var(--nimbus-banner-color);
	color: var(--nimbus-banner-bg);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	border: 1px solid transparent;
	line-height: 1.3;
}

.nimbus-banner-cta-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
	text-decoration: none;
	color: var(--nimbus-banner-bg);
}

.nimbus-banner-cta-button:active {
	transform: translateY(0);
}

/* Dismiss / Close button */
.nimbus-banner-close {
	background: none;
	border: none;
	color: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	opacity: 0.7;
	transition: opacity 0.2s ease;
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
}

.nimbus-banner-close:hover {
	opacity: 1;
}

/* Single-row layouts spacing tweaks */
.nimbus-banner-single-row {
	padding: 12px 24px;
}

.nimbus-banner-single-row .nimbus-banner-rows {
	gap: 0;
}

/* Mobile responsive overrides (max-width: 768px) */
@media (max-width: 768px) {
	#nimbus-announcement-banner {
		padding: 24px 16px; /* Dynamic height, vertical padding 24px */
	}

	.nimbus-banner-container {
		width: 100%;
		display: flex;
		justify-content: center;
		padding-right: 0;
	}

	.nimbus-banner-rows {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 16px; /* Spacing between rows */
	}

	.nimbus-banner-row {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	/* 1. Sekcja komunikatu */
	.nimbus-banner-row-announcement {
		text-align: center;
	}

	.nimbus-banner-line {
		display: block;
		width: 100%;
		line-height: 1.2;
		margin-bottom: 6px;
	}

	.nimbus-banner-line:last-child {
		margin-bottom: 0;
	}

	/* 2. Pasek promocji ułożony pionowo */
	.nimbus-banner-row-promo {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 16px;
	}

	/* 3. Licznik */
	.nimbus-banner-countdown {
		display: flex;
		justify-content: center;
		width: 100%;
		gap: 8px; /* gap 8px */
	}

	.nimbus-cd-segment {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 64px; /* Box 64x64px */
		height: 64px;
		min-width: 64px;
		padding: 0;
		border-radius: 8px;
		box-sizing: border-box;
	}

	.nimbus-cd-val {
		font-size: 32px;
		font-weight: 700;
		line-height: 1.1;
		margin: 0;
	}

	.nimbus-cd-lbl {
		font-size: 9px;
		font-weight: 700;
		letter-spacing: 0.5px;
		margin-top: 3px;
		line-height: 1;
	}

	/* 4. CTA */
	.nimbus-banner-cta-button {
		display: inline-block;
		width: auto;
		padding: 12px 26px;
		text-align: center;
		line-height: 1.3;
	}

	/* Adjust close button to prevent content shift on narrow screens */
	.nimbus-banner-close {
		position: absolute;
		right: 8px;
		top: 8px;
		transform: none;
	}
}
