/* ==========================================================================
   CAVAC Header & Footer - Design System Organique Premium
   ========================================================================== */

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
	position: relative;
	background: var(--cavac-blanc);
	z-index: var(--z-sticky);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header Sticky - Toujours fixe en haut */
.site-header.is-sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	box-shadow: none;
}

/* État scrolled - Header compact */
.site-header.is-scrolled {
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 4px 30px rgba(0, 98, 71, 0.1);
}

.site-header.is-scrolled .header-content {
	height: var(--header-height-scrolled, 64px);
}

.site-header.is-scrolled .header-logo img {
	height: 40px;
}

.site-header.is-scrolled .mega-menu-item > a {
	padding-top: var(--space-4);
	padding-bottom: var(--space-4);
}

/* Header caché (scroll down) - optionnel */
.site-header.is-hidden {
	transform: translateY(-100%);
}

/* Spacer pour compenser le header fixed */
.header-spacer {
	height: var(--header-height, 80px);
	transition: height 0.3s ease;
}

.header-spacer.is-scrolled {
	height: var(--header-height-scrolled, 64px);
}

.header-inner {
	border-bottom: 1px solid var(--cavac-gris-100);
}

.header-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-6);
	height: var(--header-height, 80px);
	transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo */
.header-logo {
	flex-shrink: 0;
}

.header-logo a {
	display: flex;
	align-items: center;
}

.header-logo img {
	height: 50px;
	width: auto;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-logo a:hover img {
	transform: scale(1.02);
}

/* Header actions */
.header-actions {
	display: flex;
	align-items: center;
	gap: var(--space-4);
}

.header-search-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: var(--cavac-vert-menthe);
	border: none;
	border-radius: var(--radius-blob-2);
	color: var(--cavac-vert-fonce);
	cursor: pointer;
	transition: all var(--transition-base) var(--ease-out-back);
}

.header-search-toggle:hover {
	background: var(--cavac-vert-fonce);
	color: var(--cavac-blanc);
	border-radius: var(--radius-blob-1);
	transform: rotate(-5deg);
}

/* Header CTA */
.header-cta {
	display: none;
}

@media (min-width: 1024px) {
	.header-cta {
		display: inline-flex;
	}
}

/* Menu secondaire */
.nav-menu--secondary {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: var(--space-4);
}

@media (min-width: 1024px) {
	.nav-menu--secondary {
		display: flex;
	}
}

.nav-menu--secondary li a {
	font-size: var(--text-sm);
	font-weight: var(--font-medium);
	color: var(--cavac-gris-600);
	text-decoration: none;
	transition: color var(--transition-fast);
}

.nav-menu--secondary li a:hover {
	color: var(--cavac-vert-fonce);
}

/* Header menu toggle (mobile) */
.header-menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

@media (min-width: 1024px) {
	.header-menu-toggle {
		display: none;
	}
}

/* Search bar */
.header-search {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--cavac-blanc);
	padding: var(--space-6) 0;
	box-shadow: 0 20px 40px rgba(0, 98, 71, 0.15);
	transform: translateY(-20px);
	opacity: 0;
	visibility: hidden;
	transition: all var(--transition-base) var(--ease-out-expo);
	z-index: 100;
}

.header-search[aria-hidden="false"] {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
}

.header-search .search-form {
	display: flex;
	gap: var(--space-3);
	max-width: 700px;
	margin: 0 auto;
}

.header-search .form-input {
	flex: 1;
	padding: var(--space-4) var(--space-6);
	font-size: var(--text-lg);
	border-radius: var(--radius-full);
	border: 2px solid var(--cavac-vert-menthe);
}

.header-search .form-input:focus {
	border-color: var(--cavac-vert-clair);
}

.header-search .btn {
	padding: var(--space-4) var(--space-6);
}

.header-search .search-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	background: var(--cavac-gris-100);
	border: none;
	border-radius: 50%;
	color: var(--cavac-gris-600);
	cursor: pointer;
	transition: all var(--transition-fast);
}

.header-search .search-close:hover {
	background: var(--cavac-corail);
	color: var(--cavac-blanc);
}

/* Mobile CTA */
.mobile-cta {
	margin-top: var(--space-6);
	text-align: center;
}

.mobile-cta .btn {
	width: 100%;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
	position: relative;
	background: var(--cavac-vert-fonce);
	color: var(--cavac-blanc);
	overflow: hidden;
}

/* Wave separator */
.footer-wave {
	position: relative;
	height: 120px;
	background: transparent;
	margin-bottom: -1px;
	margin-top: 0;
}

/* Zone blanche UNIQUEMENT si pas de CTA avant */
.site-content:not(:has(.cta-section:last-child)) + .site-footer .footer-wave,
.site-footer .footer-wave {
	background: #fff;
}

/* Quand CTA est la dernière section - pas de wave blanc */
.cta-section ~ .site-footer .footer-wave,
main:has(.cta-section:last-of-type) + footer .footer-wave {
	display: none;
}

/* S'assurer que la zone avant le footer est blanche sauf après CTA */
.footer-wave::before {
	content: '';
	position: absolute;
	top: -60px;
	left: 0;
	right: 0;
	height: 60px;
	background: #fff;
	z-index: 1;
}

.footer-wave svg {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Blobs décoratifs footer */
.footer-blob {
	position: absolute;
	border-radius: var(--radius-blob-1);
	pointer-events: none;
	z-index: 0;
}

.footer-blob--1 {
	width: 400px;
	height: 400px;
	background: rgba(122, 186, 73, 0.15);
	top: -150px;
	right: -100px;
	animation: blobMorph1 20s ease-in-out infinite;
}

.footer-blob--2 {
	width: 300px;
	height: 300px;
	background: rgba(75, 183, 167, 0.1);
	bottom: -100px;
	left: -100px;
	animation: blobMorph2 25s ease-in-out infinite;
}

/* Footer main */
.footer-main {
	position: relative;
	padding: var(--space-16) 0 var(--space-12);
	z-index: 1;
}

/* Footer sans wave (après CTA vert) */
.footer-no-wave .footer-wave {
	display: none !important;
}

.footer-no-wave .footer-main {
	padding-top: var(--space-10);
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.5fr repeat(3, 1fr) 1.2fr;
	gap: var(--space-10);
}

@media (max-width: 1024px) {
	.footer-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.footer-grid {
		grid-template-columns: 1fr;
		gap: var(--space-8);
	}
}

/* Footer logo */
.footer-logo {
	margin-bottom: var(--space-4);
}

.footer-logo img {
	height: 50px;
	width: auto;
	filter: brightness(0) invert(1);
}

/* Footer tagline */
.footer-tagline {
	font-size: var(--text-lg);
	line-height: var(--leading-relaxed);
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: var(--space-6);
}

/* Footer label Positive Agriculture */
.footer-label {
	margin-bottom: var(--space-6);
}

.footer-label img {
	opacity: 0.8;
	transition: all var(--transition-base);
}

.footer-label img:hover {
	opacity: 1;
	transform: rotate(10deg);
}

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

.footer-social-label {
	font-size: var(--text-sm);
	font-weight: var(--font-semibold);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: rgba(255, 255, 255, 0.6);
}

.social-list {
	display: flex;
	gap: var(--space-2);
	list-style: none;
	margin: 0;
	padding: 0;
}

.social-list li a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-blob-2);
	color: var(--cavac-blanc);
	transition: all var(--transition-base) var(--ease-out-back);
}

.social-list li a:hover {
	background: var(--cavac-vert-clair);
	color: var(--cavac-vert-fonce);
	transform: translateY(-4px) rotate(5deg);
	border-radius: var(--radius-blob-1);
}

/* Footer columns */
.footer-col--widgets {
	padding-top: var(--space-2);
}

.footer-title {
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: var(--font-bold);
	color: var(--cavac-blanc);
	margin-bottom: var(--space-5);
	padding-bottom: var(--space-3);
	border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

/* Footer widgets list */
.footer-col--widgets .widget {
	margin-bottom: var(--space-6);
}

.footer-col--widgets .widget-title {
	font-family: var(--font-display);
	font-size: var(--text-base);
	font-weight: var(--font-bold);
	color: var(--cavac-blanc);
	margin-bottom: var(--space-4);
}

.footer-col--widgets ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-col--widgets ul li {
	margin-bottom: var(--space-2);
}

.footer-col--widgets ul li a {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	transition: all var(--transition-fast);
}

.footer-col--widgets ul li a::before {
	content: '';
	width: 5px;
	height: 5px;
	background: var(--cavac-vert-clair);
	border-radius: 50%;
	opacity: 0;
	transition: opacity var(--transition-fast);
}

.footer-col--widgets ul li a:hover {
	color: var(--cavac-blanc);
	padding-left: var(--space-3);
}

.footer-col--widgets ul li a:hover::before {
	opacity: 1;
}

/* Footer contact */
.footer-col--contact {
	padding-top: var(--space-2);
}

.footer-address,
.footer-phone,
.footer-email {
	margin-bottom: var(--space-4);
}

.footer-address {
	font-style: normal;
	font-size: var(--text-sm);
	line-height: var(--leading-relaxed);
	color: rgba(255, 255, 255, 0.8);
}

.footer-contact-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-lg);
	margin-right: var(--space-3);
	vertical-align: middle;
}

.footer-phone a,
.footer-email a {
	display: inline-flex;
	align-items: center;
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	transition: color var(--transition-fast);
}

.footer-phone a:hover,
.footer-email a:hover {
	color: var(--cavac-vert-clair);
}

/* Footer CTA */
.footer-cta {
	margin-top: var(--space-6);
	border-color: rgba(255, 255, 255, 0.3);
	color: var(--cavac-blanc);
}

.footer-cta:hover {
	background: var(--cavac-blanc);
	border-color: var(--cavac-blanc);
	color: var(--cavac-vert-fonce);
}

/* Footer bottom */
.footer-bottom {
	position: relative;
	padding: var(--space-6) 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	z-index: 1;
}

.footer-bottom-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
}

@media (max-width: 768px) {
	.footer-bottom-inner {
		flex-direction: column;
		text-align: center;
	}
}

.footer-copyright {
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.6);
}

/* Legal menu */
.legal-menu {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	list-style: none;
	margin: 0;
	padding: 0;
}

.legal-menu li a {
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
	transition: color var(--transition-fast);
}

.legal-menu li a:hover {
	color: var(--cavac-blanc);
	text-decoration: underline;
}

/* Footer phyto mentions */
.footer-phyto {
	width: 100%;
	margin-top: var(--space-4);
	padding-top: var(--space-4);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-phyto small {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.5);
	line-height: var(--leading-relaxed);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: fixed;
	top: var(--space-4);
	left: var(--space-4);
	padding: var(--space-3) var(--space-5);
	background: var(--cavac-vert-fonce);
	color: var(--cavac-blanc);
	font-weight: var(--font-semibold);
	border-radius: var(--radius-lg);
	z-index: 9999;
	transform: translateY(-200%);
	transition: transform var(--transition-fast);
}

.skip-link:focus {
	transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
	.footer-wave {
		height: 60px;
	}

	.footer-main {
		padding: var(--space-10) 0 var(--space-8);
	}

	.footer-blob {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.footer-blob,
	.footer-label img,
	.social-list li a,
	.header-search-toggle {
		animation: none;
		transition: none;
	}
}