/**
 * Amentara Timed Free Shipping banner.
 *
 * All colour comes from custom properties set inline on the element from the
 * settings, so this stylesheet stays static and cacheable.
 */

.amtfs-banner {
	display: flex;
	align-items: center !important;
	gap: 14px;
	box-sizing: border-box;
	margin: 0 0 1em;
	padding: 9px 18px;
	border-radius: 6px;
	background: var( --amtfs-bg, #1a1a1a );
	color: var( --amtfs-text, #ffffff );
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0.005em;
	text-align: left;
}

.amtfs-banner[hidden] {
	display: none !important;
}

.amtfs-text {
	flex: 0 1 auto;
	margin: 0;
}

/* ---------------------------------------------------------------------
 * Circular countdown. Sweeps a full 360 degrees down to 0 as the
 * countdown runs, with the digits centred inside it.
 * ------------------------------------------------------------------ */

.amtfs-ring {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	transform-origin: 50% 50%;
}

.amtfs-ring__svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	/* Start the sweep at 12 o'clock rather than 3 o'clock. */
	transform: rotate( -90deg );
	overflow: visible;
}

.amtfs-ring__track {
	fill: none;
	stroke: currentColor;
	stroke-width: 2.75;
	opacity: 0.18;
}

.amtfs-ring__bar {
	fill: none;
	stroke: var( --amtfs-timer-bg, #dc3545 );
	stroke-width: 2.75;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.25s linear;
}

.amtfs-timer {
	position: relative;
	display: block;
	padding: 0;
	background: none;
	border-radius: 0;
	color: var( --amtfs-timer-text, #ffffff );
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
	line-height: 1;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

/* ---------------------------------------------------------------------
 * Call to action. Ghost pill by default so it stays legible on any banner
 * colour, filling with the timer colour on hover and keyboard focus.
 * ------------------------------------------------------------------ */

/*
 * Scoped and hardened. Elementor global kit CSS targets `.elementor-kit-N
 * button` at specificity (0,1,1), which beats a lone class, and Astra adds
 * its own button rules on top. Both were overriding the fill, the casing and
 * the padding, and the taller padding was what knocked the button off centre.
 * Two-class scoping plus explicit resets keeps this looking the same in any
 * theme.
 */
.amtfs-banner button.amtfs-cta {
	flex: 0 0 auto;
	align-self: center !important;
	box-sizing: border-box !important;
	appearance: none;
	-webkit-appearance: none;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 6px 15px !important;
	border: 1px solid currentColor !important;
	border-radius: 100px !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	font-family: inherit !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: 0.01em !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	white-space: nowrap;
	vertical-align: middle;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.amtfs-banner button.amtfs-cta:hover,
.amtfs-banner button.amtfs-cta:focus-visible {
	background: var( --amtfs-timer-bg, #dc3545 ) !important;
	border-color: var( --amtfs-timer-bg, #dc3545 ) !important;
	color: var( --amtfs-timer-text, #ffffff ) !important;
}

.amtfs-banner button.amtfs-cta:focus-visible {
	outline: 2px solid currentColor !important;
	outline-offset: 2px !important;
}

/* First stage: message only, no countdown ring yet. */
.amtfs-banner.is-teaser .amtfs-ring {
	display: none;
}

/* Final ten seconds. */
.amtfs-banner.is-urgent .amtfs-ring {
	animation: amtfs-pulse 1s ease-in-out infinite;
}

@keyframes amtfs-pulse {
	0%, 100% { transform: scale( 1 ); }
	50%      { transform: scale( 1.07 ); }
}

/* ---------------------------------------------------------------------
 * Sticky positions. Fixed overlay so the banner cannot be scrolled past,
 * and so revealing it does not shift the page under the shopper.
 * ------------------------------------------------------------------ */

.amtfs-banner--sticky_top,
.amtfs-banner--sticky_bottom {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	margin: 0;
	border-radius: 0;
	justify-content: center;
	padding: 7px 18px;
}

.amtfs-banner--sticky_top {
	top: 0;
	box-shadow: inset 0 -1px 0 rgba( 255, 255, 255, 0.07 ), 0 6px 22px rgba( 0, 0, 0, 0.34 );
	animation: amtfs-slide-down 0.32s cubic-bezier( 0.22, 0.9, 0.3, 1 );
}

.amtfs-banner--sticky_bottom {
	bottom: 0;
	box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.07 ), 0 -6px 22px rgba( 0, 0, 0, 0.34 );
	animation: amtfs-slide-up 0.32s cubic-bezier( 0.22, 0.9, 0.3, 1 );
}

@keyframes amtfs-slide-down {
	from { transform: translateY( -100% ); }
	to   { transform: translateY( 0 ); }
}

@keyframes amtfs-slide-up {
	from { transform: translateY( 100% ); }
	to   { transform: translateY( 0 ); }
}

@media ( max-width: 600px ) {
	.amtfs-banner {
		gap: 11px;
		padding: 7px 13px;
		font-size: 13.5px;
		line-height: 1.3;
	}

	.amtfs-ring {
		width: 42px;
		height: 42px;
	}

	.amtfs-timer {
		font-size: 11px;
	}

	.amtfs-banner button.amtfs-cta {
		padding: 5px 11px !important;
		font-size: 12px !important;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.amtfs-banner--sticky_top,
	.amtfs-banner--sticky_bottom,
	.amtfs-banner.is-urgent .amtfs-ring {
		animation: none;
	}

	.amtfs-ring__bar {
		transition: none;
	}

	.amtfs-banner button.amtfs-cta {
		transition: none;
	}
}
