/* CampaignFlow — Compact Global Promotional Bar (Phase 3) */
.cf-promo-root {
	--cf-bg-primary: #0D0D10;
	--cf-bg-secondary: #18181B;
	--cf-text: #FAFAFA;
	--cf-accent: #EAB308;
	--cf-badge-text: #0D0D10;
	--cf-border: #CA8A04;
	--cf-top-offset: 0px;
	box-sizing: border-box;
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	max-width: 100vw;
	z-index: var(--cf-z-index, 99990);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	line-height: 1.25;
	color: var(--cf-text);
	background: linear-gradient(90deg, var(--cf-bg-primary) 0%, var(--cf-bg-secondary) 100%);
	overflow: hidden;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.cf-promo-root[hidden] {
	display: none !important;
}

.cf-promo-root.cf-pos-top_fixed {
	top: var(--cf-top-offset, 0px);
	border-bottom: 1px solid var(--cf-border);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}

.cf-promo-root.cf-pos-bottom_fixed {
	bottom: 0;
	border-top: 1px solid var(--cf-border);
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.16);
}

body.admin-bar .cf-promo-root.cf-pos-top_fixed {
	--cf-top-offset: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .cf-promo-root.cf-pos-top_fixed {
		--cf-top-offset: 46px;
	}
}

body.cf-has-top-bar {
	padding-top: var(--cf-active-bar-height, 0px);
}

body.cf-has-bottom-bar {
	padding-bottom: var(--cf-active-bar-height, 0px);
}

.cf-promo-root.cf-has-glow {
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.24), inset 0 -1px 0 var(--cf-accent);
}

.cf-bar-inner {
	box-sizing: border-box;
	max-width: 1320px;
	margin: 0 auto;
	height: var(--cf-h-desktop, 44px);
	padding: 0 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.cf-bar-left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1 1 auto;
}

.cf-campaign-tag {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--cf-accent);
	color: var(--cf-badge-text);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.cf-message {
	margin: 0;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--cf-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: opacity 0.25s ease;
}

.cf-message.cf-msg-fading {
	opacity: 0;
}

.cf-bar-right {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
}

.cf-coupon-group {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--cf-accent);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.cf-coupon-code {
	padding: 4px 9px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--cf-text);
	white-space: nowrap;
}

.cf-copy-btn {
	appearance: none;
	border: 0;
	border-left: 1px solid var(--cf-accent);
	margin: 0;
	padding: 5px 10px;
	background: var(--cf-accent);
	color: var(--cf-badge-text);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.cf-copy-btn:hover:not(:disabled) {
	filter: brightness(1.08);
}

.cf-copy-btn:focus-visible {
	outline: 2px solid var(--cf-text);
	outline-offset: -2px;
}

.cf-copy-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.cf-countdown {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--cf-text);
	white-space: nowrap;
}

.cf-countdown-label {
	opacity: 0.85;
	font-weight: 500;
}

.cf-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* Tablet: 60-72px target */
@media (max-width: 1023px) {
	.cf-bar-inner {
		height: var(--cf-h-tablet, 64px);
		padding: 6px 14px;
		flex-direction: column;
		justify-content: center;
		align-items: stretch;
		gap: 4px;
	}

	.cf-bar-left {
		justify-content: center;
	}

	.cf-bar-right {
		justify-content: center;
		gap: 10px;
	}

	.cf-message {
		font-size: 13px;
	}
}

/* Mobile: 70-85px max target */
@media (max-width: 639px) {
	.cf-bar-inner {
		height: var(--cf-h-mobile, 76px);
		padding: 6px 10px;
		gap: 5px;
	}

	.cf-bar-left {
		justify-content: flex-start;
		gap: 6px;
	}

	.cf-campaign-tag {
		padding: 2px 7px;
		font-size: 10px;
	}

	.cf-message {
		font-size: 12px;
	}

	.cf-bar-right {
		justify-content: space-between;
		gap: 6px;
	}

	.cf-coupon-code {
		padding: 3px 7px;
		font-size: 11.5px;
	}

	.cf-copy-btn {
		padding: 4px 8px;
		font-size: 11px;
	}

	.cf-countdown {
		font-size: 11.5px;
	}

	.cf-countdown-label {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cf-promo-root,
	.cf-message,
	.cf-copy-btn {
		transition: none !important;
	}
}

/* Shoptimizer (2.8.x / 2.9.x & child themes) sticky/fixed navigation offset */
@media (min-width: 993px) {
	body.cf-theme-shoptimizer.cf-has-top-bar:not(.header-4).sticky-d .col-full-nav,
	body.cf-theme-shoptimizer.cf-has-top-bar:not(.header-4).sticky-d .col-full-nav.is_stuck,
	body.cf-theme-shoptimizer.cf-has-top-bar:not(.header-4).sticky-d.admin-bar .col-full-nav.is_stuck,
	body.cf-theme-shoptimizer.cf-has-top-bar .shoptimizer-primary-navigation.is_stuck,
	body.cf-theme-shoptimizer.cf-has-top-bar.sticky-d.header-4:not(.single-product.sticky-t) .header-4-container,
	body.cf-theme-shoptimizer.cf-has-top-bar.admin-bar.sticky-d.header-4:not(.woocommerce-checkout):not(.single-product.sticky-t) .header-4-container,
	body.cf-theme-shoptimizer.cf-has-top-bar.admin-bar.sticky-d.header-4.single-product:not(.sticky-t) .header-4-container {
		top: var(--cf-sticky-top-offset, var(--cf-active-bar-height, 0px));
	}
}

@media (max-width: 992px) {
	body.cf-theme-shoptimizer.cf-has-top-bar:not(.mobile-toggled).sticky-m .site-header,
	body.cf-theme-shoptimizer.cf-has-top-bar.sticky-m .header-4-container,
	body.cf-theme-shoptimizer.cf-has-top-bar.admin-bar.sticky-m .header-4-container {
		top: var(--cf-sticky-top-offset, var(--cf-active-bar-height, 0px));
	}
}
