/**
 * Façade site public — source unique cosmétique pour :
 * - templates/header-site.php
 * - templates/footer-site.php
 * - alignement shell 1200px (Home, Local Audit, Onboarding B2B)
 *
 * Ne pas réutiliser sur les dashboards Premium / Agency.
 */

:root {
	--avi-site-facade-max: 1200px;
}

/* --------------------------------------------------------------------------
   Shell : même largeur max que header/footer, centré (pages publiques)
   -------------------------------------------------------------------------- */
.avi-site-public-shell {
	max-width: var(--avi-site-facade-max);
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	box-sizing: border-box;
}

/* Home : toutes les sections .av-container alignées sur le shell */
body.avi-site-public-home .av-container {
	max-width: var(--avi-site-facade-max) !important;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

/* Audit : contenu formulaire / rapport dans la même grille que le header */
body.avi-local-audit-page .avi-local-audit-main .av-container {
	max-width: var(--avi-site-facade-max) !important;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

/* ——— Header ——— */
.avi-site-header {
	position: relative;
	z-index: 50;
	flex-shrink: 0;
	background: #ffffff !important;
	border-bottom: 1px solid #e2e8f0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.avi-site-header-inner {
	max-width: var(--avi-site-facade-max);
	margin: 0 auto;
	padding: 0.75rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	flex-wrap: wrap;
	box-sizing: border-box;
}
.avi-site-header-logo-link {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	text-decoration: none;
}
/* Logo header : hauteur imposée (toutes pages publiques) */
.avi-site-header-logo,
.avi-site-header-logo-link img {
	display: block;
	height: 40px !important;
	width: auto !important;
	max-height: 40px !important;
	object-fit: contain;
}
.avi-site-header-nav {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin-left: auto;
}
.avi-site-header-nav a {
	color: #334155;
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 600;
	transition: color 0.2s ease;
}
.avi-site-header-nav a:hover {
	color: #2563eb;
}
.avi-site-header-lang {
	display: flex;
	align-items: center;
}


@media (max-width: 640px) {
	.avi-site-header-inner {
		justify-content: center;
	}
	.avi-site-header-nav {
		margin-left: 0;
		justify-content: center;
		width: 100%;
	}
	.avi-site-header-lang {
		width: 100%;
		justify-content: center;
	}
}

/* ——— Footer ——— */
.avi-site-footer {
	flex-shrink: 0;
	background: #ffffff;
	color: #1e293b;
	padding: 28px 24px;
	border-top: 1px solid #e2e8f0;
	width: 100%;
	box-sizing: border-box;
}
.avi-site-footer-inner {
	max-width: var(--avi-site-facade-max);
	margin: 0 auto;
	padding: 0 1.5rem;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	align-items: center;
	gap: 20px 32px;
	box-sizing: border-box;
}
.avi-site-footer-col--brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 10px;
	min-width: 0;
}
.avi-site-footer-logo-wrap {
	display: inline-block;
	line-height: 0;
}
/* Logo footer : même hauteur 40px que le header */
.avi-site-footer-logo,
.avi-site-footer-logo-wrap img {
	height: 40px !important;
	width: auto !important;
	max-height: 40px !important;
	object-fit: contain;
	display: block;
}
.avi-site-footer-copyright {
	font-size: 11px;
	font-weight: 500;
	color: #64748b;
	margin: 0;
	line-height: 1.4;
}
.avi-site-footer-col--legal {
	text-align: center;
	min-width: 0;
}
.avi-site-footer-legal-nav {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 20px;
}
.avi-site-footer-legal-nav a {
	color: #64748b;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}
.avi-site-footer-legal-nav a:hover {
	color: #3b82f6;
}
.avi-site-footer-col--nav {
	text-align: right;
	min-width: 0;
}
.avi-site-footer-site-nav {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px 20px;
}
.avi-site-footer-site-nav a {
	color: #64748b;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}
.avi-site-footer-site-nav a:hover {
	color: #3b82f6;
}

@media (max-width: 782px) {
	.avi-site-footer-inner {
		grid-template-columns: 1fr;
		text-align: center;
	}
	.avi-site-footer-col--brand {
		align-items: center;
	}
	.avi-site-footer-col--legal {
		margin-top: 8px;
	}
	.avi-site-footer-col--nav {
		text-align: center;
	}
	.avi-site-footer-site-nav {
		justify-content: center;
	}
}

/* Page audit : colonne principale sous le header */
body.avi-local-audit-page {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: #f8fafc;
}

body.avi-local-audit-page .avi-local-audit-main {
	flex: 1;
	padding-top: 2rem;
	padding-bottom: 2rem;
}

/* Landing B2B : header/footer blancs ; zone signature centrée 1200px */
body.avi-b2b-page {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
body.avi-b2b-page .avi-signature-inner {
	flex: 1;
	position: relative;
	z-index: 1;
}

/* Home standalone */
body.avi-site-public-home {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
body.avi-site-public-home .av-wrapper {
	flex: 1;
}

/* Main B2B (front-page) : occupe l’espace entre header et footer */
body.avi-site-public-home .site-main.avision-b2b-home,
body.avi-site-public-home main#primary {
	flex: 1;
	width: 100%;
}

/* Landing B2B : section features Z-pattern — empilement mobile */
@media (max-width: 900px) {
	body.avi-site-public-home .avision-b2b-home .b2b-features-section .feature-item {
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 28px !important;
		margin-bottom: 4rem !important;
	}
	body.avi-site-public-home .avision-b2b-home .b2b-features-section .feature-image {
		flex: none !important;
		min-height: 220px;
		height: auto !important;
	}
}

/* --------------------------------------------------------------------------
   Footer universel (site-footer) — 3 colonnes + drapeaux (source unique ici
   pour les pages qui ne chargent pas avi-lang-switcher-global.css)
   -------------------------------------------------------------------------- */
.avi-site-footer.avi-universal-footer.site-footer {
	background: #0f172a !important;
	color: #cbd5e1 !important;
	border-top: 1px solid rgba(148, 163, 184, 0.25) !important;
	padding: 20px 16px !important;
	width: 100%;
	box-sizing: border-box;
}

.site-footer .container.avi-footer-three-col {
	max-width: var(--avi-site-facade-max);
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.25rem 1.5rem;
	flex-wrap: wrap;
}

.footer-left,
.footer-center,
.footer-right {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	gap: 15px;
	align-items: center;
}

.footer-left {
	justify-content: flex-start;
	flex-wrap: wrap;
}

.footer-center {
	justify-content: center;
}

.footer-right {
	justify-content: flex-end;
}

.avi-universal-footer-legal {
	margin: 0;
	font-size: 12px;
	line-height: 1.45;
	color: #cbd5e1;
	white-space: nowrap;
}

.avi-lang-switcher {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 4px 10px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	border: 1px solid rgba(148, 163, 184, 0.4);
	flex-shrink: 0;
}

.flag-icon {
	width: 22px;
	height: 16px;
	border-radius: 4px;
	cursor: pointer;
	display: inline-block;
	text-decoration: none;
	background-size: 100% 100%;
	background-position: center;
	background-repeat: no-repeat;
	border: 1px solid rgba(255, 255, 255, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.flag-icon:hover {
	transform: scale(1.15);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.flag-icon.active,
.flag-icon[aria-current="true"] {
	border-color: #4285f4;
	box-shadow: 0 0 0 1px rgba(66, 133, 244, 0.25), 0 0 8px rgba(66, 133, 244, 0.35);
}

.flag-fr {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect x='0' y='0' width='9.333' height='20' fill='%230055A4'/%3E%3Crect x='9.333' y='0' width='9.333' height='20' fill='%23FFFFFF'/%3E%3Crect x='18.666' y='0' width='9.334' height='20' fill='%23EF4135'/%3E%3C/svg%3E");
}

.flag-es {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect x='0' y='0' width='28' height='5' fill='%23AA151B'/%3E%3Crect x='0' y='5' width='28' height='10' fill='%23F1BF00'/%3E%3Crect x='0' y='15' width='28' height='5' fill='%23AA151B'/%3E%3C/svg%3E");
}

.flag-us-uk {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect x='0' y='0' width='14' height='20' fill='%23FFFFFF'/%3E%3Cg fill='%23B22234'%3E%3Crect x='0' y='0' width='14' height='1.66'/%3E%3Crect x='0' y='3.32' width='14' height='1.66'/%3E%3Crect x='0' y='6.64' width='14' height='1.66'/%3E%3Crect x='0' y='9.96' width='14' height='1.66'/%3E%3Crect x='0' y='13.28' width='14' height='1.66'/%3E%3Crect x='0' y='16.6' width='14' height='1.66'/%3E%3Crect x='0' y='19.92' width='14' height='1.66'/%3E%3C/g%3E%3Crect x='0' y='0' width='6.5' height='9.2' fill='%233C3B6E'/%3E%3Cg fill='%23FFFFFF'%3E%3Ccircle cx='1.2' cy='1.2' r='0.3'/%3E%3Ccircle cx='2.8' cy='1.2' r='0.3'/%3E%3Ccircle cx='4.4' cy='1.2' r='0.3'/%3E%3Ccircle cx='6.0' cy='1.2' r='0.3'/%3E%3Ccircle cx='2.0' cy='2.8' r='0.3'/%3E%3Ccircle cx='3.6' cy='2.8' r='0.3'/%3E%3Ccircle cx='5.2' cy='2.8' r='0.3'/%3E%3Ccircle cx='1.2' cy='4.4' r='0.3'/%3E%3Ccircle cx='2.8' cy='4.4' r='0.3'/%3E%3Ccircle cx='4.4' cy='4.4' r='0.3'/%3E%3Ccircle cx='6.0' cy='4.4' r='0.3'/%3E%3C/g%3E%3Crect x='14' y='0' width='14' height='20' fill='%23012169'/%3E%3Cg stroke='%23FFFFFF' stroke-width='2'%3E%3Cline x1='14' y1='0' x2='28' y2='20'/%3E%3Cline x1='28' y1='0' x2='14' y2='20'/%3E%3C/g%3E%3Cg stroke='%23C8102E' stroke-width='1'%3E%3Cline x1='14' y1='0' x2='28' y2='20'/%3E%3Cline x1='28' y1='0' x2='14' y2='20'/%3E%3C/g%3E%3Crect x='14' y='8' width='14' height='4' fill='%23FFFFFF'/%3E%3Crect x='19' y='0' width='4' height='20' fill='%23FFFFFF'/%3E%3Crect x='14' y='8.5' width='14' height='3' fill='%23C8102E'/%3E%3Crect x='19.5' y='0' width='3' height='20' fill='%23C8102E'/%3E%3C/svg%3E");
}

.site-footer .avi-universal-footer-links {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.site-footer .avi-universal-footer-links a {
	color: #cbd5e1;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

.site-footer .avi-universal-footer-links a:hover {
	color: #ffffff;
}

@media (max-width: 768px) {
	.site-footer .container.avi-footer-three-col {
		flex-direction: column;
		text-align: center;
		padding-top: 0.5rem;
		padding-bottom: 0.5rem;
	}

	.footer-left,
	.footer-center,
	.footer-right {
		justify-content: center;
		flex: 1 1 100%;
	}

	.avi-universal-footer-legal {
		white-space: normal;
	}
}

@media (max-width: 640px) {
	.avi-lang-switcher {
		padding: 4px 8px;
		gap: 8px;
	}
}
