/*
 * Trioni cookie banner (ADR-15, ADR-16).
 * Uses the theme tokens when present (tokens.css) with literal fallbacks, so it also works on its own.
 * The three first-layer buttons share one style on purpose: equal prominence for Rechazar / Configurar / Aceptar.
 * Motion only on transform/opacity and disabled under prefers-reduced-motion.
 */
.trioni-consent[hidden],
.trioni-consent [hidden] {
	display: none !important;
}

.trioni-consent {
	--tc-surface: var(--surface, #ffffff);
	--tc-ink: var(--ink, #191914);
	--tc-on-ink: var(--on-ink, #f1ede3);
	--tc-text-soft: var(--text-soft, #3a3931);
	--tc-muted: var(--muted, #67645a);
	--tc-line: var(--line-strong, #cfcbc0);
	--tc-field: var(--field-border, #8a877c);
	--tc-gold: var(--gold-text, #7a6640);
	--tc-radius: var(--radius, 2px);
	--tc-shadow: var(--shadow-pop, 0 24px 48px -24px rgba(25, 25, 20, 0.38), 0 2px 8px rgba(25, 25, 20, 0.08));
	--tc-gutter: var(--gutter, 16px);

	position: fixed;
	inset: auto 0 0 0;
	z-index: 1000;
	display: flex;
	justify-content: flex-start;
	padding: 0 var(--tc-gutter) calc(var(--tc-gutter) + env(safe-area-inset-bottom, 0px));
	pointer-events: none;
}

.trioni-consent__dialog {
	pointer-events: auto;
	box-sizing: border-box;
	width: 100%;
	max-width: 34rem;
	max-height: calc(100vh - 2 * var(--tc-gutter));
	max-height: calc(100dvh - 2 * var(--tc-gutter));
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: var(--s-5, 24px);
	background: var(--tc-surface);
	color: var(--tc-ink);
	border: 1px solid var(--tc-ink);
	border-top: 3px solid var(--tc-ink);
	border-radius: var(--tc-radius);
	box-shadow: var(--tc-shadow);
	font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif);
	font-size: var(--fs-sm, 0.875rem);
	line-height: var(--lh-body, 1.6);
	animation: trioni-consent-in 220ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.trioni-consent__dialog:focus {
	outline: none;
}

.trioni-consent__dialog:focus-visible {
	outline: 2px solid var(--tc-ink);
	outline-offset: 3px;
}

.trioni-consent__title {
	margin: 0 0 var(--s-2, 8px);
	font-family: var(--font-serif, Georgia, 'Times New Roman', serif);
	font-size: var(--fs-lg, 1.25rem);
	font-weight: 400;
	line-height: var(--lh-snug, 1.3);
	letter-spacing: 0;
}

.trioni-consent__text {
	margin: 0 0 var(--s-4, 16px);
	color: var(--tc-text-soft);
}

.trioni-consent a {
	color: var(--tc-ink);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.trioni-consent a:hover {
	color: var(--tc-gold);
}

.trioni-consent__prefs {
	margin: 0 0 var(--s-4, 16px);
	padding-top: var(--s-3, 12px);
	border-top: 1px solid var(--tc-line);
}

.trioni-consent__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.trioni-consent__legend {
	margin: 0 0 var(--s-3, 12px);
	padding: 0;
	font-size: var(--fs-2xs, 0.75rem);
	font-weight: 600;
	letter-spacing: var(--tracking-caps, 0.14em);
	text-transform: uppercase;
	color: var(--tc-muted);
}

.trioni-consent__option {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: var(--s-3, 12px);
	align-items: start;
	padding: var(--s-2, 8px) 0;
}

.trioni-consent__option + .trioni-consent__option {
	border-top: 1px solid var(--tc-line);
}

.trioni-consent__option input[type='checkbox'] {
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.15rem 0 0;
	accent-color: var(--tc-ink);
	cursor: pointer;
}

.trioni-consent__option input[type='checkbox']:disabled {
	cursor: not-allowed;
}

.trioni-consent__option input[type='checkbox']:focus-visible {
	outline: 2px solid var(--tc-ink);
	outline-offset: 2px;
}

.trioni-consent__option label {
	font-weight: 600;
	cursor: pointer;
}

.trioni-consent__hint {
	grid-column: 2;
	margin: var(--s-1, 4px) 0 0;
	color: var(--tc-muted);
	font-size: var(--fs-xs, 0.8125rem);
}

.trioni-consent__actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--s-2, 8px);
}

.trioni-consent__save {
	margin-top: var(--s-2, 8px);
}

.trioni-consent__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: var(--s-2, 8px) var(--s-3, 12px);
	border: 1px solid var(--tc-ink);
	border-radius: var(--tc-radius);
	background: transparent;
	color: var(--tc-ink);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease;
}

.trioni-consent__button:hover {
	background: var(--tc-ink);
	color: var(--tc-on-ink);
}

.trioni-consent__button:active {
	transform: translateY(1px);
}

.trioni-consent__button:focus-visible {
	outline: 2px solid var(--tc-ink);
	outline-offset: 2px;
}

.trioni-consent__button[aria-expanded='true'] {
	background: var(--tc-ink);
	color: var(--tc-on-ink);
}

/* «Configurar cookies» opener (footer legal links, shortcode): looks like the surrounding links. */
.trioni-consent-open {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: inherit;
	cursor: pointer;
}

.trioni-consent-open:hover {
	text-decoration: underline;
}

.trioni-consent-open:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/*
 * The banner is fixed and not modal: while it is open (class and height set by consent.js), scrolling a
 * focused element into view stops above it, and the page can scroll far enough for its last elements
 * to clear it, so focus is never fully hidden (WCAG 2.4.11). The extra room is below the footer.
 */
html.has-trioni-consent {
	scroll-padding-bottom: calc(var(--trioni-consent-h, 0px) + var(--s-2, 8px));
}

html.has-trioni-consent > body {
	padding-bottom: calc(var(--trioni-consent-h, 0px) + var(--s-2, 8px));
}

/* 320 px wide (or 400 % zoom): tighter padding so the three equal buttons still share one row. */
@media (max-width: 359px) {
	.trioni-consent__dialog {
		padding: var(--s-4, 16px);
	}

	.trioni-consent__button {
		padding-inline: var(--s-1, 4px);
		font-size: var(--fs-xs, 0.8125rem);
	}
}

/* Short viewports (landscape phones, 400 % zoom): the banner scrolls inside and leaves part of the page in view. */
@media (max-height: 480px) {
	.trioni-consent__dialog {
		max-height: 60vh;
		max-height: 60dvh;
	}
}

@media (min-width: 768px) {
	.trioni-consent {
		padding-left: calc(var(--tc-gutter) + env(safe-area-inset-left, 0px));
	}
}

@keyframes trioni-consent-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.trioni-consent__dialog {
		animation: none;
	}

	.trioni-consent__button {
		transition: none;
	}

	.trioni-consent__button:active {
		transform: none;
	}
}

@media print {
	.trioni-consent {
		display: none !important;
	}
}
