/*
 * Site-wide footer: brand, legal navigation and the accepted payment
 * methods (FOOTER-1, alpha.50). Loaded only when at least one published
 * compliance page has been selected in wp-admin.
 *
 * Two looks: plain (legal pages, or no photo configured) and
 * `.rso-legal-footer--photo`, which lays the text over the entry page's
 * food photo behind a green-black veil — the same picture guests saw on
 * the landing screen. Colours: brand green / white / black.
 */
.rso-legal-footer {
	box-sizing: border-box;
	width: 100%;
	border-top: 1px solid #e8e1d2;
	background: #f6f7f1;
	color: #241a10;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.45;
	--rso-footer-ink: #241a10;
	--rso-footer-muted: #5e5347;
	--rso-footer-link: #4f4336;
	--rso-footer-link-hover: #35800a;
	--rso-footer-rule: rgba(36, 26, 16, 0.12);
	--rso-footer-chip: #fff;
	--rso-footer-chip-border: #e8e1d2;
}

.rso-legal-footer--photo {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	border-top: 0;
	background-color: #0c1407;
	color: #f6f3ea;
	--rso-footer-ink: #f6f3ea;
	--rso-footer-muted: rgba(246, 243, 234, 0.72);
	--rso-footer-link: rgba(246, 243, 234, 0.9);
	--rso-footer-link-hover: #a4e26a;
	--rso-footer-rule: rgba(255, 255, 255, 0.16);
	--rso-footer-chip: rgba(255, 255, 255, 0.96);
	--rso-footer-chip-border: transparent;
}

/* The photo, then a veil that keeps the text readable: nearly clear at
   the top so the food shows through, solid green-black at the bottom. */
.rso-legal-footer--photo::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background: var(--rso-footer-photo) center / cover no-repeat;
	transform: scale(1.03);
}

.rso-legal-footer--photo::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(8, 14, 5, 0.58) 0%, rgba(8, 14, 5, 0.8) 45%, rgba(6, 12, 4, 0.94) 100%);
}

.rso-legal-footer__inner {
	box-sizing: border-box;
	max-width: 1180px;
	margin: 0 auto;
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* FOOTER-3 (alpha.56): one slim line — company | street | town | phone on
   the left, Impressum | AGB | Datenschutz on the right, same baseline. */
.rso-legal-footer__row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 24px;
}

.rso-legal-footer__identity,
.rso-legal-footer__nav {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	font-size: .875rem;
	font-weight: 600;
	color: var(--rso-footer-ink);
	line-height: 1.5;
}

.rso-legal-footer__nav {
	justify-content: flex-end;
	margin-left: auto;
}

.rso-legal-footer__identity a,
.rso-legal-footer__nav a {
	color: var(--rso-footer-ink);
	text-decoration: none;
}

.rso-legal-footer__identity a:hover,
.rso-legal-footer__identity a:focus-visible,
.rso-legal-footer__nav a:hover,
.rso-legal-footer__nav a:focus-visible {
	color: var(--rso-footer-link-hover);
	text-decoration: none;
}

.rso-legal-footer__nav a:focus-visible,
.rso-legal-footer__identity a:focus-visible {
	border-radius: 3px;
	outline: 3px solid #46a500;
	outline-offset: 3px;
}

.rso-legal-footer__sep {
	color: var(--rso-footer-muted);
	font-weight: 400;
	opacity: .8;
}

/* Payment methods ------------------------------------------------------- */
.rso-legal-footer__pay {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
}

.rso-legal-footer__pay-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.rso-legal-footer__pay-item {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 26px;
	padding: 4px;
	border-radius: 5px;
	background: var(--rso-footer-chip);
	border: 1px solid var(--rso-footer-chip-border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* FOOTER-2, owner 2026-10-13: every mark looks alike — the same chip in
   TWINT's proportions (64 x 26, TWINT's own badge is 2.64 : 1) and every
   logo exactly 18 px tall, whatever the shape of Wallee's image (a square
   Amex, a wide Visa). Only a very wide wordmark is capped at 52 px wide
   (Visa ends at ~17 px tall) so it does not outweigh the others. */
.rso-legal-footer__pay-item img {
	display: block;
	width: auto;
	height: 18px;
	max-width: 52px;
	max-height: 18px;
	object-fit: contain;
}

.rso-legal-footer__pay-item--text {
	width: auto;
	padding: 2px 10px;
}

/* COMPLIANCE-PAGES (owner 2026-10-12): Google's official Google Pay
   acceptance mark — the multicolour G followed by Pay inside its own
   outlined pill — is shown unaltered instead of inside a chip (the pill
   IS its frame; a chip around it would double it). Its SVG canvas
   (1094 x 742) carries generous built-in clear space around the pill
   (752 x 400); the negative margins let that transparent space overlap
   the gap so the pill itself is exactly as tall as the other chips
   (26 px, owner 2026-10-13) and in the same row.
   Clear space: Google asks for half the capital G's height on every side.
   The G is ≈ 171 of the 742 canvas units ≈ 11.1 px here → ≥ 5.6 px; the
   2 px margin plus the 6 px list gap keeps 8 px clear around the pill.
   No filter, no recolour. */
.rso-legal-footer__pay-item--mark {
	width: 49px;
	margin: 2px;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
	overflow: visible;
}

.rso-legal-footer__pay-item--mark img {
	flex: none;
	width: 71.1px;
	height: 48.2px;
	max-width: none;
	max-height: none;
	margin: -11.1px -11.05px;
}

/* The image failed to load: the same text chip as any unknown mark. */
.rso-legal-footer__pay-item--mark.rso-legal-footer__pay-item--text {
	width: auto;
	padding: 2px 10px;
	background: var(--rso-footer-chip);
	border: 1px solid var(--rso-footer-chip-border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.rso-legal-footer__pay-text {
	font-size: .8125rem;
	font-weight: 700;
	color: #241a10;
	white-space: nowrap;
}

@media (max-width: 720px) {
	.rso-legal-footer__inner {
		padding: 14px 16px 16px;
		gap: 10px;
		text-align: center;
	}

	.rso-legal-footer__row {
		flex-direction: column;
		align-items: center;
		gap: 4px;
	}

	.rso-legal-footer__identity,
	.rso-legal-footer__nav {
		justify-content: center;
		margin-left: 0;
	}

	.rso-legal-footer__pay,
	.rso-legal-footer__pay-list {
		justify-content: center;
	}
}

@media (prefers-color-scheme: dark) {
	.rso-legal-footer:not(.rso-legal-footer--photo) {
		border-top-color: #3a2d1d;
		background: #18130d;
		color: #f3ecdf;
		--rso-footer-ink: #f3ecdf;
		--rso-footer-muted: #b8ab97;
		--rso-footer-link: #c7b9a4;
		--rso-footer-link-hover: #8ed95e;
		--rso-footer-rule: rgba(255, 255, 255, 0.14);
		--rso-footer-chip: #f6f3ea;
		--rso-footer-chip-border: transparent;
	}

}

@media (prefers-reduced-motion: no-preference) {
	.rso-legal-footer__pay-item {
		transition: transform .15s ease;
	}

	.rso-legal-footer__pay-item:hover {
		transform: translateY(-1px);
	}
}

/* FOOTER-5 (alpha.68, owner): on phones the footer stays at the bottom of
   the menu even while the floating "View basket" bar is up — a guest who
   scrolls all the way down still finds it, and the last line clears the
   bar (52 px bar + 16 px margin + breathing room). FOOTER-4 used to hide
   it here. The body class is set by storefront.js; :has() covers the
   moment before the script runs. */
@media (max-width: 979px) {
	body.rso-basket-bar .rso-legal-footer,
	body:has(#rso-storefront .rso-mobile-bar:not([hidden])) .rso-legal-footer {
		padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
	}
}

/* FOOTER-5: on the checkout the fixed "Pay" bar (CHK) covers the bottom
   of the viewport on every width — the footer is the last thing on the
   page and must not disappear under it. */
body.woocommerce-checkout .rso-legal-footer {
	padding-bottom: calc(var(--rso-placebar-h, 96px) + 12px + env(safe-area-inset-bottom, 0px)); /* CHECKOUT-11: the bar's measured height */
}

/* Owner 2026-10-13: "AGB | Datenschutz | Impressum | Herkunft" on ONE line,
   also on phones — the text scales down a little on narrow screens instead
   of breaking. The payment marks: one line where there is room; on phones
   even rows (--rso-pay-cols from the footer: up to five per row), every chip
   the same width, the 18 px logo height kept where the chip allows. */
.rso-legal-footer__nav {
	flex-wrap: nowrap;
	white-space: nowrap;
}

@media (max-width: 720px) {
	.rso-legal-footer__nav {
		font-size: clamp(.6875rem, 3.9vw, .875rem);
		gap: 0 .45em;
	}

	/* French names are the longest ("Confidentialité", "Mentions légales"). */
	:lang(fr) .rso-legal-footer__nav {
		font-size: clamp(.625rem, 3.3vw, .875rem);
	}

	/* 125.79 (owner 2026-10-24): the last link reads "Allergene & Herkunft"
	   (German, and the English interface, which shows the German labels).
	   That line is about 27.5 em long, so it scales a little smaller to stay
	   on one line from 360 px up. French and Italian keep their 125.55 sizes. */
	.rso-legal-footer__nav--origin:not(:lang(fr)):not(:lang(it)) {
		font-size: clamp(.6875rem, 3.05vw, .875rem);
	}

	.rso-legal-footer__pay-list {
		display: grid;
		grid-template-columns: repeat(var(--rso-pay-cols, 5), minmax(0, 64px));
		justify-content: center;
		gap: 6px;
		width: 100%;
	}

	.rso-legal-footer__pay-item {
		width: 100%;
		min-width: 0;
	}

	.rso-legal-footer__pay-item img {
		max-width: 100%;
	}

	.rso-legal-footer__pay-item--mark {
		width: 49px;
		justify-self: center;
	}

	.rso-legal-footer__pay-item--text {
		overflow: hidden;
	}

	.rso-legal-footer__pay-text {
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

/* 125.79: below 360 px the one line no longer fits at a readable size —
   the "Allergene & Herkunft" link moves to its own centred line, without
   its separator, instead of running off the screen. Keyed on the server's
   markers, so a footer without that link is unchanged. */
@media (max-width: 359px) {
	.rso-legal-footer__nav--origin:not(:lang(fr)):not(:lang(it)) {
		flex-wrap: wrap;
		justify-content: center;
		row-gap: 4px;
		font-size: .78125rem;
	}

	.rso-legal-footer__nav--origin:not(:lang(fr)):not(:lang(it)) > .rso-legal-footer__sep--origin {
		display: none;
	}

	.rso-legal-footer__nav--origin:not(:lang(fr)):not(:lang(it)) > .rso-legal-footer__link--origin {
		flex-basis: 100%;
		text-align: center;
	}
}
