/* Site footer. */

.site-footer {
	background-color: var(--color-surface-footer);
	color: var(--color-text-on-brand);
}

.site-footer__inner {
	display: grid;
	/*
	 * Reproduces the Figma x positions (112 / 632 / 885 / 1235) as proportions instead
	 * of absolute layout. The support column hugs its content so "Fale conosco" does
	 * not wrap at the 93px the design gives it.
	 */
	grid-template-columns: minmax(0, 520fr) minmax(0, 253fr) minmax(0, 350fr) auto;
	column-gap: 0;
	row-gap: var(--space-6);
	padding-block: 91px var(--space-6);
}

.site-footer__brand {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
}

.site-footer__logo-image {
	width: 224px;
	height: 203px;
	object-fit: contain;
}

.site-footer__social {
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

/*
 * Pendency 2: the Figma frame uses Playfair Display here. Adding a third family is
 * out of scope, so this follows the heading family at the H7 size.
 */
.site-footer__social-label {
	font-family: var(--font-heading);
	font-size: var(--font-h7);
	font-weight: var(--weight-heading);
	line-height: var(--lh-heading);
}

.site-footer__social-list {
	display: flex;
	align-items: center;
	gap: var(--space-1);
}

.site-footer__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-pill);
	background-color: var(--color-hairline-light);
	color: var(--color-text-on-brand);
	transition: background-color var(--duration-base) var(--ease-out);
}

.site-footer__social-link:hover {
	background-color: var(--color-social-hover);
}

.site-footer__social-icon {
	width: 20px;
	height: 20px;
}

/* Link columns */

.site-footer__columns {
	display: grid;
	grid-column: 2 / -1;
	grid-template-columns: subgrid;
	gap: inherit;
}

@supports not (grid-template-columns: subgrid) {
	.site-footer__columns {
		grid-template-columns: repeat(3, 1fr);
	}
}

.footer-column {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.footer-column__title {
	margin: 0;
	color: var(--color-text-on-brand);
	font-family: var(--font-body);
	font-size: var(--font-p1);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: var(--ls-body);
}

.footer-column__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-1);
	width: 100%;
	padding: 0;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: default;
}

.footer-column__chevron {
	width: 13px;
	height: 8px;
	transition: transform var(--duration-fast) var(--ease-out);
}

/* The column headers only collapse below 768px, so the chevron is hidden until then. */
.footer-column__title .footer-column__chevron {
	display: none;
}

.footer-column__list {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.footer-column__list[hidden] {
	display: none;
}

.footer-column__link {
	--underline-offset: -1px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-1);
	width: 100%;
	/* LINK | FOOTER is a 36px box (281:20356), on a 44 pitch with the 8 of the list gap. */
	min-height: 36px;
	padding-block: 0;
	color: var(--color-link-on-brand);
	font-size: var(--font-p3);
	font-weight: 400;
	line-height: 1.3;
	text-align: left;
}

/* 281:20367 keeps the #E6E6E6 of the default and only draws the line (.has-underline). */
.footer-column__link:hover,
.footer-column__link:focus-visible {
	color: var(--color-link-on-brand);
}

/*
 * Items whose destination is still undefined render as plain text (pendency 8). They keep
 * the normal reading color instead of being dimmed: Gray BRAND fails AA here (3.21:1 on
 * white) and the design never specified a disabled state anyway.
 */
.footer-column__link--static,
.footer-column__link--static:hover {
	color: var(--color-link-on-brand);
	cursor: default;
	text-decoration: none;
}

.footer-column__link--toggle[aria-expanded='true'] .footer-column__chevron {
	transform: rotate(180deg);
}

/*
 * Anchored popover of "A Tirolez", overlay 317:16625: 200x103, white, no scrim and no
 * close button. Closes on click outside.
 */
.footer-column__item--anchor {
	position: relative;
}

.footer-popover {
	position: absolute;
	top: calc(100% + 4px);
	left: -24px;
	z-index: 1;
	width: 200px;
	border-radius: var(--radius-card);
	background-color: var(--color-surface);
	box-shadow: var(--shadow-popover);
	overflow: hidden;
}

.footer-popover[hidden] {
	display: none;
}

.footer-popover__link {
	display: block;
	padding: 14px var(--space-4);
	color: var(--color-text);
	font-size: var(--font-p2);
	line-height: 1.4;
	transition: background-color var(--duration-base) var(--ease-out);
}

/* 281:21143: Light Gray row, Dark Red Medium text. */
a.footer-popover__link:hover {
	background-color: var(--color-hover-surface);
	color: var(--color-dark-red);
	font-weight: 500;
}

.footer-popover :focus-visible {
	outline-color: var(--color-focus-ring);
}

/* Bottom bar */

/* In 657:23337 the hairline spans the 1216px content, not the whole footer. */
.site-footer__bottom-inner {
	border-top: 1px solid var(--color-hairline-light);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	/* CONTENT 2 of 657:23334 is 76 tall: 20 of padding around the 36px legal links. */
	min-height: 76px;
	padding-block: 0;
}

.site-footer__copyright {
	color: var(--color-text-on-brand);
	font-size: var(--font-p3);
	line-height: 1.3;
}

.site-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
}

.site-footer__legal-link {
	--underline-offset: -2px;
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	color: var(--color-link-on-brand);
	font-size: var(--font-p3);
	line-height: 1.3;
}

.site-footer__legal-link:hover,
.site-footer__legal-link:focus-visible {
	color: var(--color-link-on-brand);
}

.site-footer__legal-link--static {
	color: var(--color-link-on-brand);
	cursor: default;
}

@media (max-width: 1023px) {
	/* Below the desktop the line keeps running edge to edge, as before the change. */
	.site-footer__bottom {
		border-top: 1px solid var(--color-hairline-light);
	}

	.site-footer__bottom-inner {
		border-top: 0;
	}

	.site-footer__inner {
		grid-template-columns: repeat(2, 1fr);
		column-gap: var(--space-6);
		padding-block: var(--space-7) var(--space-5);
	}

	.site-footer__columns {
		grid-column: 1 / -1;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-6) var(--space-5);
	}
}

@media (max-width: 767px) {
	.site-footer__inner {
		grid-template-columns: 1fr;
		gap: var(--space-5);
	}

	.site-footer__columns {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.footer-column {
		gap: 0;
		border-bottom: 1px solid var(--color-hairline-light);
	}

	.footer-column__toggle {
		padding-block: var(--space-3);
		cursor: pointer;
	}

	/* The -24px of the node would put the popover 4px off the left edge at 375px. */
	.footer-popover {
		left: 0;
	}

	.footer-column__title .footer-column__chevron {
		display: block;
	}

	.footer-column__toggle[aria-expanded='true'] .footer-column__chevron {
		transform: rotate(180deg);
	}

	.footer-column__list {
		padding-block-end: var(--space-3);
	}

	.site-footer__bottom-inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.site-footer__legal {
		flex-direction: column;
		gap: var(--space-1);
	}
}
