/* ==========================================================================
   AAS Trust Badges - "Experienced Team / Fully Insured / Accredited
   Contractor / Northampton & Surrounding Areas" strip.

   Desktop (> 767px): a single static row, evenly spaced, separated by
   thin vertical dividers - matches the reference screenshot.

   Mobile (<= 767px): automatically becomes a continuously auto-sliding
   marquee (pure CSS @keyframes animation, no JavaScript) so all items are
   visible without wrapping into a cramped 2x2 grid. The row is duplicated
   once in the markup and the animation slides exactly -50%, so the loop
   is perfectly seamless.
   ========================================================================== */

.aas-trust-badges {
	--aas-accent: var(--e-global-color-accent, #FE212A);
	--aas-dark: var(--e-global-color-primary, #0D0D0D);
	--aas-text: var(--e-global-color-text, #666666);
	--aas-white: var(--e-global-color-white, #FFFFFF);
	--aas-light: var(--e-global-color-secondary, #F5F5F5);
	--aas-font-heading: var(--e-global-typography-primary-font-family, "Space Grotesk", sans-serif);
	--aas-font-text: var(--e-global-typography-text-font-family, "DM Sans", sans-serif);
	--aas-tb-speed: 18s;

	background: var(--aas-light);
	padding: 28px 0;
	overflow: hidden;
}

.aas-tb-track {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 40px;
	box-sizing: border-box;
}

/* ---- Desktop: static evenly-spaced row ----------------------------------- */
.aas-tb-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px 0;
}

.aas-tb-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 28px;
	border-right: 1px solid rgba(13,13,13,0.1);
	white-space: nowrap;
}
.aas-tb-item:first-child {
	padding-left: 0;
}
.aas-tb-item:last-child {
	border-right: none;
	padding-right: 0;
}

/* The duplicate row (aria-hidden="true") exists only to make the mobile
   marquee loop seamless. On every other size it must stay hidden -
   otherwise it shows up as a second, identical, stacked row. */
.aas-tb-row[aria-hidden="true"] {
	display: none;
}

.aas-tb-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--aas-accent);
	flex-shrink: 0;
}
.aas-tb-icon svg,
.aas-tb-icon i {
	width: 30px;
	height: 30px;
	font-size: 30px;
}

.aas-tb-text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}
.aas-tb-title {
	font-family: var(--aas-font-heading);
	font-weight: 700;
	font-size: 15px;
	color: var(--aas-dark);
}
.aas-tb-subtitle {
	font-family: var(--aas-font-text);
	font-size: 13px;
	color: var(--aas-text);
}

/* ---- Mobile: auto-sliding marquee ----------------------------------------
   Only takes effect when the widget's "Auto-Slide on Mobile" option is on
   (the .aas-tb-marquee-enabled class) AND the viewport is 767px or less -
   above that width it always shows as the normal static row, even with the
   option turned on. */
@media (max-width: 767px) {
	.aas-tb-track {
		padding: 0 20px;
		max-width: none;
	}

	/* The two duplicated ".aas-tb-row" blocks sit side by side as one wide
	   flex strip (".aas-tb-track" becomes the flex container). Animating
	   the TRACK itself by exactly -50% (half of its own total width, i.e.
	   one row's width) slides the first row fully out of view at the exact
	   moment the identical duplicate row reaches the start position - a
	   perfectly seamless, gap-free loop. */
	.aas-tb-marquee-enabled.aas-trust-badges {
		overflow: hidden;
	}
	.aas-tb-marquee-enabled .aas-tb-track {
		display: flex;
		flex-wrap: nowrap;
		width: max-content;
		padding: 0;
		animation: aas-tb-scroll var(--aas-tb-speed) linear infinite;
	}
	.aas-tb-marquee-enabled .aas-tb-row {
		display: flex;
		flex-wrap: nowrap;
		justify-content: flex-start;
		width: max-content;
		flex-shrink: 0;
		padding-right: 40px;
	}
	.aas-tb-marquee-enabled .aas-tb-row[aria-hidden="true"] {
		display: flex;
	}

	.aas-tb-pause-on-hover.aas-tb-marquee-enabled:hover .aas-tb-track,
	.aas-tb-pause-on-hover.aas-tb-marquee-enabled:active .aas-tb-track {
		animation-play-state: paused;
	}

	.aas-tb-item {
		padding: 0 22px;
		border-right-color: rgba(13,13,13,0.12);
	}
	.aas-tb-icon svg,
	.aas-tb-icon i {
		width: 24px;
		height: 24px;
		font-size: 24px;
	}
	.aas-tb-title {
		font-size: 14px;
	}
	.aas-tb-subtitle {
		font-size: 12px;
	}

	/* Non-marquee mobile fallback (option turned off): wrap into a tidy
	   2-column grid instead of one cramped line. */
	.aas-trust-badges:not(.aas-tb-marquee-enabled) .aas-tb-row {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 18px 16px;
	}
	.aas-trust-badges:not(.aas-tb-marquee-enabled) .aas-tb-item {
		border-right: none;
		padding: 0;
	}
}

@keyframes aas-tb-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* Respect users who've asked the OS for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.aas-tb-marquee-enabled .aas-tb-row {
		animation: none;
	}
}
