/**
 * Site footer: template-parts/footer/footer.php.
 * Mobile first (2289:1287): stacked, 2x2 link columns, wordmark at the bottom.
 * Desktop from 1280 (2133:351): brand + four columns split by thin lines, a
 * full-width line above the copyright row, wordmark bottom right.
 * Link hover states are not designed: docs/designer-questions.md item 12.
 */

.site-footer {
	--footer-line: rgb(255 255 255 / 10%); /* Figma: white lines at 10% opacity */
	--footer-pad: max(var(--container-gutter), (100% - var(--container-max)) / 2);

	position: relative;
	overflow: hidden;
	background: var(--color-green-deep);
	color: var(--color-cream);
	font-size: var(--text-body-m);
	line-height: var(--leading-body-m);
}

.site-footer a {
	color: inherit;
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--color-yellow);
}

/* "Cookie settings" in the Legal column: a button that reads as the links. */
.site-footer__button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-align: left;
	cursor: pointer;
	transition: all 0.2s ease;
}

.site-footer__button:hover {
	color: var(--color-yellow);
}

@media (prefers-reduced-motion: reduce) {
	.site-footer__button {
		transition: none;
	}
}

/* Top: brand and columns. */

.site-footer__top {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px 16px;
	padding: 40px var(--footer-pad) 0;
}

.site-footer__brand {
	display: flex;
	grid-column: 1 / -1;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-sm);
	margin-bottom: 0;
}

.site-footer__logo {
	display: block;
	line-height: 0;
}

.site-footer__logo img {
	display: block;
	width: 173px;
	height: 63px;
}

.site-footer__text {
	max-width: 320px;
	margin: 0;
	color: var(--color-white); /* mobile: white; desktop: cream at 75%, below */
	font-size: var(--text-body-s);
	line-height: var(--leading-body-s);
}

/* Language and currency: UI only. */

.site-footer__selects {
	display: flex;
	gap: 10px;
}

.footer-select {
	position: relative;
	display: inline-flex;
	align-items: center;
	color: var(--color-white);
}

/* The select is the whole pill, so the full button is clickable. The flag
 * and caret sit on top of it and let clicks through. */
.footer-select__control {
	margin: 0;
	padding: 10px 14px;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-green-dark);
	color: inherit;
	font-family: inherit;
	font-size: var(--text-label-m);
	font-weight: var(--weight-semibold);
	line-height: 1.3;
	appearance: none;
	cursor: pointer;
	transition: all 0.2s ease;
}

.footer-select--language .footer-select__control {
	padding-right: 40px; /* 10 gap + 16 caret + 14 */
	padding-left: 46px; /* 14 + 22 flag + 10 gap */
}

.footer-select__control:hover {
	background: var(--color-green);
}

.footer-select__control option {
	color: var(--color-ink);
}

.footer-select__flag,
.footer-select__caret {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
}

.footer-select__flag {
	left: 14px;
	display: block;
	width: 22px;
	height: 16px;
	border-radius: 3px;
	object-fit: cover;
}

.footer-select__caret {
	right: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.footer-select__control {
		transition: none;
	}
}

/* Columns. */

.site-footer__col {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.site-footer__heading {
	margin: 0;
	color: var(--color-yellow);
	font-size: var(--text-label-s);
	font-weight: var(--weight-medium);
	letter-spacing: var(--tracking-label-s);
	line-height: var(--leading-label-s);
	text-transform: uppercase;
}

.site-footer__links {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__hours {
	margin: 0;
}

.site-footer a.site-footer__email {
	color: var(--color-yellow);
	overflow-wrap: anywhere;
}

.site-footer a.site-footer__email:hover {
	color: var(--color-cream);
}

/* Email and phone as one group, closer together than the column gap (not
 * designed), so the column stays clear of the desktop wordmark. */
.site-footer__reach {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

/* Phone link (decision 15.4, not designed): like the email. WhatsApp and
 * Telegram are icons in the social row. */
.site-footer a.site-footer__phone {
	color: var(--color-yellow);
	white-space: nowrap;
}

.site-footer a.site-footer__phone:hover {
	color: var(--color-cream);
}

.site-footer__social {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Icons are the Figma SVG exports, circle included (WhatsApp and Telegram drawn
 * in the same style, designer question 41). */
.site-footer__social-link {
	display: block;
	width: 35px;
	height: 35px;
	border-radius: 50%;
	line-height: 0;
}

.site-footer__social-link img {
	display: block;
	width: 35px;
	height: 35px;
}

.site-footer a.site-footer__social-link:hover {
	opacity: 0.8;
}

/* Bottom: payment icons and copyright. On mobile the payments come first. */

/* No z-index here: it would make a stacking context and keep the payment
 * icons (z-index 3) under the wordmark. */
.site-footer__bottom {
	position: relative;
	display: flex;
	flex-direction: column-reverse;
	align-items: flex-start;
	gap: 28px;
	margin: 28px var(--footer-pad) 0;
	padding-top: 28px;
	border-top: 1px solid var(--footer-line);
}

.site-footer__legal {
	max-width: 100%;
	margin: 0;
	font-size: var(--text-body-s);
	line-height: 1.2;
}

.site-footer__legal span + span::before {
	content: " ";
}

/* Company line (decision 15.4): its own line under the copyright. */
.site-footer__legal .site-footer__company {
	display: block;
	margin-top: 8px;
	opacity: 0.7;
}

.site-footer__legal .site-footer__company::before {
	content: none;
}

.site-footer__payments {
	position: relative;
	z-index: 3;
	display: block;
	width: 228px;
	height: 28px;
}

/* Wordmark: decorative ::before, cut off by the footer's bottom edge.
 * Positioned from the content container's left edge, not the viewport's
 * right edge, so it stays in the same place next to the content on any
 * screen width. Mobile (2289:1430): 400 wide at the footer's left edge. */

.site-footer {
	padding-bottom: 128px;
}

/* Stacking: columns and copyright 1, wordmark 2 (over the lines), payment icons 3. */
.site-footer::before {
	content: "";
	position: absolute;
	z-index: 2;
	bottom: -38px;
	left: calc(var(--footer-pad) - 20px);
	width: 400px;
	height: 138px;
	background: url("../../images/footer-wordmark.svg") no-repeat 0 0 / 100% 100%;
	pointer-events: none;
}

@media (min-width: 768px) {
	.site-footer__top {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.site-footer__bottom {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

/* Desktop: lines between the columns run from the footer's top edge to the
 * full-width line; content starts 90px down (2133:351). */
@media (min-width: 1280px) {
	.site-footer {
		--footer-col-pad: clamp(24px, 4.2vw - 10px, 60px);
	}

	/* Frame 380 / 197 / 261 / 180 / 262; Legal gets 30 from Help so "Cookie
	 * settings" (not in the frame) keeps one line from 1280. */
	.site-footer__top {
		grid-template-columns: 380fr 197fr 231fr 210fr 262fr;
		gap: 0;
		padding-top: 0;
		border-bottom: 1px solid var(--footer-line);
	}

	.site-footer__brand {
		grid-column: auto;
		gap: 20px;
		padding: 90px 24px 90px 0;
	}

	.site-footer__text {
		color: var(--color-cream);
		opacity: 0.75;
		font-size: var(--text-body-m);
		line-height: var(--leading-body-m);
	}

	.site-footer__col {
		gap: 25px;
		padding: 90px 16px 90px var(--footer-col-pad);
		border-left: 1px solid var(--footer-line);
	}

	.site-footer__links {
		gap: 25px;
	}

	/* The wordmark reaches 106px above the columns' bottom edge (its top is the
	 * footer bottom - 293 + 75, the bottom row is 112), so this column's icons
	 * keep 24px above it, whatever its content (not designed). */
	.site-footer__col--contact {
		gap: 16px;
		padding-bottom: 130px;
	}

	.site-footer__bottom {
		align-self: flex-start;
		min-height: 112px;
		box-sizing: border-box;
		margin-top: 0;
		padding: 36px 0 0;
		border-top: 0;
		align-items: flex-start;
	}

	.site-footer__legal {
		padding-top: 4px;
	}

	/* Desktop (2138:353): 847 x 293, starting 855px into the 1280 container
	 * (x 1045 at 1660), top 285px down; the rest runs past the footer's
	 * bottom and, on narrower screens, past its right edge. */
	.site-footer {
		padding-bottom: 0;
	}

	.site-footer::before {
		bottom: -75px;
		left: calc(var(--footer-pad) + 855px);
		width: 847px;
		height: 293px;
	}
}
