/*
 * Consent & Analytics - the banner.
 *
 * Everything is scoped to .consent-banner and .consent-choice, so nothing here reaches the rest of
 * the site. The colours and the type come from the Elementor Kit's global tokens, with the kit's
 * own values as fallbacks, so the banner follows Site Settings rather than a second design system.
 */

.consent-banner {
	--consent-ink: var( --e-global-color-tzgreendk, #1B3A31 );
	--consent-body: var( --e-global-color-tzbodytext, #4A5A50 );
	--consent-surface: var( --e-global-color-tzcard, #FDF8EF );
	--consent-line: rgba( 27, 58, 49, .14 );
	--consent-on-dark: var( --e-global-color-tzonwhite, #FFFFFF );
	--consent-accent: var( --e-global-color-tzgreentint, #E8EEE4 );

	position: fixed;
	z-index: 9999;
	inset-inline: 0;
	inset-block-end: 0;
	display: flex;
	justify-content: center;
	padding: 16px;
	font-family: "Manrope", sans-serif;
	pointer-events: none;
}

.consent-banner.is-visible {
	pointer-events: auto;
}

.consent-banner__inner {
	width: 100%;
	max-width: 1140px;
	padding: 24px 28px;
	border: 1px solid var( --consent-line );
	border-radius: 14px;
	background: var( --consent-surface );
	box-shadow: 0 12px 40px rgba( 27, 58, 49, .16 );
}

.consent-banner .consent-banner__title {
	margin: 0 0 8px;
	color: var( --consent-ink );
	font-size: 20px;
	font-weight: 700;
	line-height: 27px;
}

.consent-banner__text,
.consent-banner__text p {
	margin: 0;
	color: var( --consent-body );
	font-size: 14.5px;
	line-height: 22px;
}

.consent-banner__links {
	margin: 10px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
}

.consent-banner .consent-banner__links a {
	color: var( --consent-ink );
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.consent-banner .consent-banner__links a:hover,
.consent-banner .consent-banner__links a:focus-visible {
	color: var( --e-global-color-tzgreen, #679257 );
}

/* The categories, shown when the visitor asks to choose. */
.consent-banner__choices {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 14px 28px;
	margin-block-start: 18px;
	padding-block-start: 18px;
	border-block-start: 1px solid var( --consent-line );
}

.consent-choice {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 4px 14px;
}

.consent-choice__label {
	color: var( --consent-ink );
	font-size: 14px;
	font-weight: 700;
}

.consent-choice__always {
	color: var( --consent-body );
	font-size: 12.5px;
	font-weight: 600;
}

.consent-choice__description {
	grid-column: 1 / -1;
	margin: 0;
	color: var( --consent-body );
	font-size: 12.5px;
	line-height: 18px;
}

/* The switch: a real button, so the keyboard and screen readers get it for free. */
.consent-banner .consent-choice__toggle {
	position: relative;
	width: 44px;
	height: 24px;
	padding: 0;
	border: 1px solid var( --consent-line );
	border-radius: 999px;
	background: var( --consent-accent );
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease;
}

.consent-choice__knob {
	position: absolute;
	inset-block-start: 2px;
	inset-inline-start: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var( --consent-on-dark );
	box-shadow: 0 1px 3px rgba( 27, 58, 49, .25 );
	transition: transform .18s ease;
}

.consent-banner .consent-choice__toggle[aria-checked="true"] {
	background: var( --consent-ink );
	border-color: var( --consent-ink );
}

.consent-banner .consent-choice__toggle[aria-checked="true"] .consent-choice__knob {
	transform: translateX( 20px );
}

.consent-banner .consent-choice__toggle:focus-visible {
	outline: 2px solid var( --consent-ink );
	outline-offset: 3px;
}

/* Buttons: the same shapes the cookie settings page uses. */
.consent-banner .consent-banner__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-block-start: 18px;
}

.consent-banner .consent-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.consent-banner .consent-button--solid {
	background: var( --consent-ink );
	color: var( --consent-on-dark );
}

.consent-banner .consent-button--solid:hover,
.consent-banner .consent-button--solid:focus-visible {
	background: var( --e-global-color-tzfooter, #2E4B3E );
}

.consent-banner .consent-button--outline {
	background: transparent;
	border-color: rgba( 27, 58, 49, .24 );
	color: var( --consent-ink );
}

.consent-banner .consent-button--outline:hover,
.consent-banner .consent-button--outline:focus-visible {
	border-color: var( --consent-ink );
}

.consent-banner .consent-button--text {
	min-height: 44px;
	padding: 0 6px;
	background: transparent;
	color: var( --consent-ink );
	text-decoration: underline;
	text-underline-offset: 3px;
}

.consent-banner .consent-button:focus-visible {
	outline: 2px solid var( --consent-ink );
	outline-offset: 3px;
}

@media ( max-width: 1024px ) {
	.consent-banner__choices {
		grid-template-columns: 1fr;
	}
}

@media ( max-width: 767px ) {
	.consent-banner {
		padding: 10px;
	}

	.consent-banner__inner {
		max-height: 82vh;
		overflow-y: auto;
		padding: 20px 18px;
		border-radius: 12px;
	}

	.consent-banner__actions {
		gap: 10px;
	}

	.consent-banner .consent-banner__actions .consent-button {
		flex: 1 1 100%;
	}

	.consent-banner .consent-banner__title {
		font-size: 18px;
		line-height: 25px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.consent-banner .consent-choice__toggle,
	.consent-banner .consent-choice__knob,
	.consent-banner .consent-button {
		transition: none;
	}
}

/*
 * Last, so it outranks the rules above: an element carrying [hidden] stays hidden, whatever the
 * kit or this stylesheet say about how buttons and panels are displayed.
 */
.consent-banner [hidden] {
	display: none;
}
