/* Countdown Campañas WooCommerce — frontend styles
 * Theme-agnostic. Colors come from CSS custom properties set inline by PHP.
 */

.ccw-banner {
	width: 100%;
	background-color: var(--ccw-bg, #000);
	background-image: var(--ccw-bg-image, none);
	background-size: cover;
	background-position: var(--ccw-bg-pos, center center);
	background-repeat: no-repeat;
	color: var(--ccw-text, #fff);
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
	z-index: 999999;
}

.ccw-banner *,
.ccw-banner *::before,
.ccw-banner *::after {
	box-sizing: border-box;
}

/* Sticky in flow: banner takes space at the top of body and keeps stuck
 * during scroll. Plays nicely with theme headers that use position:absolute
 * because the banner is part of the document flow rather than overlaying it. */
.ccw-banner--top-sticky {
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
}

.ccw-banner__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 16px;
	padding: 12px 48px;
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
}

.ccw-banner__message {
	font-weight: 600;
}

.ccw-banner__countdown {
	display: flex;
	gap: 6px;
}

.ccw-unit {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 40px;
}

.ccw-unit > b {
	display: block;
	background: var(--ccw-num-bg, #fff);
	color: var(--ccw-num-text, #000);
	padding: 4px 8px;
	border-radius: 3px;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.2;
	min-width: 28px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.ccw-unit > i {
	font-style: normal;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 4px;
	opacity: 0.85;
}

.ccw-unit--hidden {
	display: none;
}

.ccw-banner__close {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	padding: 4px 10px;
	cursor: pointer;
	opacity: 0.7;
}

.ccw-banner__close:hover,
.ccw-banner__close:focus {
	opacity: 1;
	outline: none;
}

.ccw-banner--hidden {
	display: none !important;
}

/* ----- Product page countdown ----- */

.ccw-product-countdown {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 12px 0;
	padding: 12px 16px;
	background-color: var(--ccw-bg, #000);
	background-image: var(--ccw-bg-image, none);
	background-size: cover;
	background-position: var(--ccw-bg-pos, center center);
	background-repeat: no-repeat;
	color: var(--ccw-text, #fff);
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
}

.ccw-product-countdown *,
.ccw-product-countdown *::before,
.ccw-product-countdown *::after {
	box-sizing: border-box;
}

.ccw-product-countdown__message {
	font-weight: 600;
	text-align: center;
}

.ccw-product-countdown__countdown {
	display: flex;
	gap: 6px;
}

@media (max-width: 600px) {
	.ccw-product-countdown {
		font-size: 13px;
		padding: 10px 12px;
	}
}

@media (max-width: 600px) {
	.ccw-banner {
		font-size: 13px;
	}

	.ccw-banner__inner {
		gap: 8px;
		padding: 8px 36px;
	}

	.ccw-unit {
		min-width: 32px;
	}

	.ccw-unit > b {
		font-size: 14px;
		padding: 3px 6px;
		min-width: 24px;
	}

	.ccw-unit > i {
		font-size: 9px;
	}

	.ccw-banner__close {
		right: 6px;
		font-size: 20px;
		padding: 4px 8px;
	}
}
