@import url('https://fonts.googleapis.com/css2?family=Average+Sans&family=Montserrat:wght@400;600;700&display=swap');

* { box-sizing: border-box; }

body { margin: 0; padding: 0; overflow-x: hidden; }
html { overflow-x: hidden; max-width: 100%; }

/* ─── HEADER ─── */
.site-header {
	background: #030A4B;
	height: 70px;
	position: sticky;
	top: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	padding: 0 40px;
}

.header-inner {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
}

/* ─── LOGO ─── */
.header-logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	text-decoration: none;
}
.header-logo img {
	height: 42px;
	width: auto;
	display: block;
	transition: opacity .2s;
}
.header-logo:hover img { opacity: .8; }

/* ─── NAV ─── */
.header-nav {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.header-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
}

/* Items top-level */
.header-nav > ul > li {
	position: relative;
	display: flex;
	align-items: center;
}

.header-nav > ul > li > a {
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #ffffff;
	text-decoration: none;
	padding: 0 14px;
	height: 70px;
	display: flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
	transition: opacity .2s;
}
.header-nav > ul > li > a:hover,
.header-nav > ul > li.current-menu-item > a {
	opacity: .75;
}

/* Séparateurs pipe */
.header-nav > ul > li + li::before {
	content: '|';
	color: rgba(255,255,255,.3);
	font-size: 13px;
	font-weight: 300;
	flex-shrink: 0;
}

/* Flèche dropdown */
.header-nav > ul > li.menu-item-has-children > a::after {
	content: '▾';
	font-size: 10px;
	margin-left: 3px;
	line-height: 1;
}

/* ─── SOUS-MENU niveau 2 ─── */
.header-nav ul ul {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 99999;
	background: #ffffff;
	border-radius: 0 0 4px 4px;
	box-shadow: 0 10px 30px rgba(0,0,0,.2);
	min-width: 200px;
	padding: 6px 0;
	margin: 0;
	list-style: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-6px);
	transition: opacity .18s, visibility .18s, transform .18s;
}

.header-nav > ul > li:hover > ul {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.header-nav ul ul li {
	display: block;
	position: relative;
}

.header-nav ul ul li a {
	font-family: 'Montserrat', sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #030A4B;
	text-decoration: none;
	padding: 10px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	white-space: nowrap;
	transition: color .15s, background .15s;
}
.header-nav ul ul li a:hover {
	color: #3B5EE8;
	background: #f0f4ff;
}

/* Flèche ▾ sur les items niveau 2 qui ont un sous-menu */
.header-nav ul ul li.menu-item-has-children > a::after {
	content: '▾';
	font-size: 9px;
	margin-left: 8px;
	flex-shrink: 0;
}

/* ─── SOUS-MENU niveau 3 – panneau séparé sous l'item ─── */
.header-nav ul ul ul {
	display: block;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100000;
	background: #2a3ea8;
	border-radius: 0 4px 4px 4px;
	box-shadow: 0 10px 28px rgba(0,0,0,.25);
	min-width: 200px;
	max-height: 320px;
	overflow-y: auto;
	padding: 6px 0;
	/* Masqué par défaut – override des règles niveau 2 */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-4px);
	transition: opacity .18s, visibility .18s, transform .18s;
}

.header-nav ul ul li:hover > ul {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

/* Items niveau 3 */
.header-nav ul ul ul li a {
	font-size: 9px;
	letter-spacing: 1.5px;
	color: rgba(255,255,255,.85);
	background: transparent;
	padding: 9px 18px;
	justify-content: flex-start;
}
.header-nav ul ul ul li a:hover {
	color: #fff;
	background: rgba(255,255,255,.12);
}

/* ─── ICÔNE RECHERCHE ─── */
.header-search {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0;
	position: relative;
}
.header-search-form {
	display: flex;
	align-items: center;
	overflow: hidden;
	max-width: 0;
	height: 40px;
	opacity: 0;
	transition: max-width .35s ease, opacity .25s ease, height .35s ease;
	background: rgba(255,255,255,.12);
	border-radius: 30px;
	margin-right: 6px;
}
.header-search-form.open {
	max-width: 240px;
	height: 40px;
	opacity: 1;
}
/* [type="search"] : nécessaire pour battre le style global Kadence sur les inputs */
.header-search-form input[type="search"] {
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	appearance: none;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	padding: 7px 14px;
	width: 200px;
	min-width: 0;
}
.header-search-form input[type="search"]:focus {
	background: transparent;
	color: #fff;
	border: none;
	box-shadow: none;
}
.header-search-form input[type="search"]::placeholder { color: rgba(255,255,255,.5); }
.header-search-form input[type="search"]::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }
.header-search-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	color: #fff;
	display: flex;
	align-items: center;
	opacity: .8;
	transition: opacity .2s;
	flex-shrink: 0;
}
.header-search-toggle:hover { opacity: 1; }

/* ─── DROPDOWN RÉSULTATS RECHERCHE ─── */
.header-search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: rgba(15,20,80,0.98);
	border-radius: 0 0 12px 12px;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height .3s ease, opacity .25s ease;
	border-top: 1px solid rgba(255,255,255,0.1);
	margin-top: -1px;
	z-index: 1000;
	min-width: 240px;
}
.header-search-results.show {
	max-height: 350px;
	overflow-y: auto;
	opacity: 1;
}
.header-search-group {
	padding: 8px 0;
}
.header-search-group:not(:last-child) {
	border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-search-group-title {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.5);
	padding: 8px 14px 4px;
	margin: 0;
}
.header-search-group-items {
	list-style: none;
	margin: 0;
	padding: 0;
}
.header-search-item {
	display: block;
}
.header-search-item a {
	display: block;
	padding: 8px 14px;
	color: #fff;
	text-decoration: none;
	font-size: 12px;
	transition: background .15s;
}
.header-search-item a:hover {
	background: rgba(255,255,255,0.08);
}
.header-search-item__title {
	font-weight: 600;
	display: block;
}
.header-search-item__subtitle {
	font-size: 11px;
	color: rgba(255,255,255,0.6);
	display: block;
}

.header-search-empty {
	padding: 14px;
	color: rgba(255,255,255,0.5);
	font-size: 12px;
	text-align: center;
}

/* Supprime le padding-top ajouté par le JS Divi pour son ancien header fixe */
#page-container { padding-top: 0 !important; }

/* ═══════════════════════════════════════════════════════════
   MENU MOBILE
   ═══════════════════════════════════════════════════════════ */

/* Burger + boutons d'accordéon : masqués en desktop */
.header-burger,
.submenu-toggle { display: none; }

/* Kadence repeint tous les <button> au survol/focus (button:hover,:focus,:active).
   Sélecteurs avec pseudo-classe obligatoires pour le battre en spécificité. */
.header-burger, .header-burger:hover, .header-burger:focus, .header-burger:active,
.submenu-toggle, .submenu-toggle:hover, .submenu-toggle:focus, .submenu-toggle:active,
.header-search-toggle, .header-search-toggle:hover, .header-search-toggle:focus, .header-search-toggle:active {
	background: none;
	box-shadow: none;
	border-radius: 0;
}
.header-burger:focus-visible,
.submenu-toggle:focus-visible,
.header-search-toggle:focus-visible {
	outline: 2px solid rgba(255,255,255,.75);
	outline-offset: -2px;
}

@media (max-width: 1024px) {

	.site-header { padding: 0 18px; }
	.header-inner { gap: 10px; }
	.header-logo img { height: 34px; }

	/* ─── Burger ─── */
	.header-burger {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		width: 40px;
		height: 40px;
		padding: 0;
		margin: 0;
		background: none;
		border: none;
		cursor: pointer;
		flex: 0 0 auto;
		position: relative;
		z-index: 10002;
	}
	.header-burger span {
		display: block;
		width: 24px;
		height: 2px;
		margin: 0 auto;
		background: #fff;
		border-radius: 2px;
		transition: transform .25s ease, opacity .2s ease;
	}
	.header-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.header-burger.is-open span:nth-child(2) { opacity: 0; }
	.header-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

	/* ─── Voile ─── */
	.header-nav-overlay {
		position: fixed;
		top: 70px;
		right: 0;
		bottom: 0;
		left: 0;
		background: rgba(0,0,0,.55);
		opacity: 0;
		visibility: hidden;
		transition: opacity .3s ease, visibility .3s ease;
		z-index: 10000;
	}
	.header-nav-overlay.is-open { opacity: 1; visibility: visible; }

	/* ─── Panneau de navigation ─── */
	.header-nav {
		position: fixed;
		top: 70px;
		right: 0;
		bottom: 0;
		width: min(340px, 88vw);
		display: block;
		flex: none;
		background: #030A4B;
		border-left: 1px solid rgba(255,255,255,.08);
		box-shadow: -14px 0 34px rgba(0,0,0,.4);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		padding: 0 0 48px;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform .3s ease, visibility .3s ease;
		z-index: 10001;
	}
	.header-nav.is-open {
		transform: translateX(0);
		visibility: visible;
	}

	.header-nav ul {
		display: block;
		width: 100%;
		flex-wrap: nowrap;
	}

	/* Items avec sous-menu : lien + bouton d'accordéon sur une ligne */
	.header-nav li.menu-item-has-children {
		display: flex;
		flex-wrap: wrap;
		align-items: stretch;
	}
	.header-nav li.menu-item-has-children > a { flex: 1 1 auto; min-width: 0; }
	.header-nav li.menu-item-has-children > ul { flex: 1 0 100%; }

	/* Niveau 1 */
	.header-nav > ul > li {
		display: block;
		position: relative;
		border-bottom: 1px solid rgba(255,255,255,.08);
	}
	.header-nav > ul > li + li::before { content: none; }
	.header-nav > ul > li > a {
		display: flex;
		height: auto;
		padding: 17px 22px;
		font-size: 12px;
		letter-spacing: 1.6px;
		white-space: normal;
	}

	/* La flèche ▾ est remplacée par le bouton d'accordéon */
	.header-nav > ul > li.menu-item-has-children > a::after,
	.header-nav ul ul li.menu-item-has-children > a::after {
		content: none;
	}

	/* Bouton d'accordéon */
	.submenu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 52px;
		padding: 0;
		background: none;
		border: none;
		border-left: 1px solid rgba(255,255,255,.08);
		color: #fff;
		cursor: pointer;
	}
	.submenu-toggle::before {
		content: '';
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translateY(-2px) rotate(45deg);
		transition: transform .25s ease;
	}
	.submenu-toggle[aria-expanded="true"]::before {
		transform: translateY(2px) rotate(-135deg);
	}

	/* Niveaux 2 et 3 : repliés, en flux, plus de survol */
	.header-nav ul ul,
	.header-nav ul ul ul {
		display: none;
		position: static;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
		transition: none;
		box-shadow: none;
		border-radius: 0;
		min-width: 0;
		max-height: none;
		overflow: visible;
		padding: 0;
	}
	.header-nav ul ul.is-open,
	.header-nav ul ul ul.is-open { display: block; }

	.header-nav ul ul { background: rgba(255,255,255,.05); }
	.header-nav ul ul li {
		display: block;
		border-top: 1px solid rgba(255,255,255,.06);
	}
	.header-nav ul ul li a {
		display: flex;
		justify-content: flex-start;
		color: #fff;
		background: transparent;
		font-size: 11px;
		letter-spacing: 1.4px;
		padding: 15px 22px 15px 34px;
		white-space: normal;
	}
	.header-nav ul ul li a:hover,
	.header-nav ul ul li a:focus {
		color: #fff;
		background: rgba(255,255,255,.1);
	}

	.header-nav ul ul ul { background: rgba(0,0,0,.22); }
	.header-nav ul ul ul li a {
		font-size: 10px;
		letter-spacing: 1.2px;
		color: rgba(255,255,255,.82);
		padding: 13px 22px 13px 48px;
	}
	.header-nav ul ul ul li a:hover { background: rgba(255,255,255,.1); }

	/* Blocage du scroll de la page quand le menu est ouvert */
	body.nav-open { overflow: hidden; }

	/* ─── Recherche : barre pleine largeur sous le header ─── */
	.header-search { position: static; }
	.header-search-form {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-width: none;
		width: auto;
		height: 0;
		margin: 0;
		border-radius: 0;
		background: #0a1160;
		box-shadow: 0 8px 20px rgba(0,0,0,.3);
		opacity: 1;
		transition: height .3s ease;
	}
	.header-search-form.open {
		max-width: none;
		height: 54px;
	}
	.header-search-form input[type="search"] {
		width: 100%;
		height: 100%;
		font-size: 14px;
		padding: 0 20px;
	}
	.header-search-results {
		top: calc(100% + 54px);
		left: 0;
		right: 0;
		min-width: 0;
		border-radius: 0;
	}
}

@media (max-width: 420px) {
	.site-header { padding: 0 14px; }
	.header-logo img { height: 30px; }
	.header-nav { width: min(320px, 92vw); }
}
