/**
 * ALVIA-DIVI-Child – Header global (Theme Builder)
 * Layout : logo gauche | menu centre | mini-panier + compte droite
 */

/* ----- Conteneur principal (shortcode [alvia_header] ou 3 colonnes Divi) ----- */
.alvia-header,
.et_pb_row.alvia-header {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	width: 100%;
	box-sizing: border-box;
}

/* Annuler les largeurs fixes 1/3 de Divi pour éviter le grand vide */
.et_pb_row.alvia-header .et_pb_column_1_3 {
	flex: none;
}

/* Colonne gauche : largeur au contenu (logo) */
.et_pb_row.alvia-header > .et_pb_column.alvia-header-left,
.alvia-header .alvia-header-left {
	order: 1;
	flex: 0 0 auto;
	width: auto !important;
	max-width: none !important;
}

.et_pb_row.alvia-header > .et_pb_column.alvia-header-left .et_pb_module {
	margin-bottom: 0;
}

/* Colonne centre : occupe l'espace restant, menu centré */
.et_pb_row.alvia-header > .et_pb_column.alvia-header-center,
.alvia-header .alvia-header-center {
	order: 2;
	flex: 1 1 auto;
	width: auto !important;
	max-width: none !important;
	min-width: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

.et_pb_row.alvia-header > .et_pb_column.alvia-header-center .et_pb_module {
	margin-bottom: 0;
}

/* Colonne droite : largeur au contenu (panier + compte), tout sur une ligne */
.et_pb_row.alvia-header > .et_pb_column.alvia-header-right,
.alvia-header .alvia-header-right {
	order: 3;
	flex: 0 0 auto;
	width: auto !important;
	max-width: none !important;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.25rem;
}

.et_pb_row.alvia-header > .et_pb_column.alvia-header-right > .et_pb_module {
	flex-shrink: 0;
	margin-bottom: 0;
	margin-right: 0;
	width: auto;
}

.et_pb_row.alvia-header > .et_pb_column.alvia-header-right .et_pb_code_inner {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.25rem;
}

/* ----- Override Divi : forcer une seule ligne + z-index (dropdown au-dessus du contenu) ----- */
body .et_pb_row.alvia-header {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	position: relative;
	z-index: 99999;
}

/* Header global (shortcode [alvia_header]) */
header.alvia-header {
	position: relative;
	z-index: 99999;
}

/* Supprimer marges externes gauche/droite */
.alvia-header {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Marges 20px gauche/droite mobile : header Theme Builder – conteneur racine (priorité max) */
@media (max-width: 980px) {
	header.et-l--header:has(.et_pb_row.alvia-header),
	header.et-l.et-l--header:has(.et_pb_row.alvia-header) {
		padding-left: 20px !important;
		padding-right: 20px !important;
		box-sizing: border-box !important;
	}
	/* Annuler tout padding interne pour éviter cumul */
	header.et-l--header:has(.et_pb_row.alvia-header) .et_builder_inner_content,
	header.et-l--header:has(.et_pb_row.alvia-header) .et_pb_section {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}
/* Marges 20px : section header (desktop + fallback) */
.et_pb_section:has(.et_pb_row.alvia-header),
.et_pb_section:has(.alvia-header-shortcode-wrap),
.et_pb_section:has(header.alvia-header) {
	padding-left: 20px !important;
	padding-right: 20px !important;
	box-sizing: border-box;
}
/* Mobile : section sans padding si header a déjà 20px */
@media (max-width: 980px) {
	header.et-l--header:has(.et_pb_row.alvia-header) .et_pb_section:has(.et_pb_row.alvia-header) {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}
/* Annuler gutters Divi sur le header */
.et-l--header .et_builder_inner_content:has(.et_pb_row.alvia-header),
header.et-l--header .et_builder_inner_content:has(.et_pb_row.alvia-header),
.et_builder_inner_content.et_pb_gutters3:has(.et_pb_row.alvia-header) {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Wrapper shortcode [alvia_header] : forcer visibilité dans module Code Divi */
.alvia-header-shortcode-wrap {
	display: block !important;
	width: 100% !important;
}

/* Header injecté via header.php sur pages produit (Theme Builder contourné) */
.alvia-header-product-inline {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	background: #fff;
	padding: 0.5rem 20px;
	box-sizing: border-box;
	overflow: visible;
	position: static !important;
}

body .et_pb_row.alvia-header > .et_pb_column.alvia-header-right {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
}

body .et_pb_row.alvia-header > .et_pb_column.alvia-header-right > .et_pb_module {
	display: inline-block !important;
	width: auto !important;
	max-width: none !important;
}

/* ----- Logo ----- */
.alvia-header-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.alvia-header-logo img,
.alvia-header-logo .alvia-header-logo-img {
	display: block;
	max-height: 85px;
	min-height: 50px;
	width: auto;
	height: auto;
	object-fit: contain;
	vertical-align: middle;
}

.alvia-header-logo-text {
	font-weight: 700;
	font-size: 1.5rem;
}

/* ----- Menu principal (Adamina, #a1c636) ----- */
.alvia-header-menu {
	--alvia-menu-inactive: #a1c636;
	--alvia-menu-active: #7fa82e;
	display: flex;
	justify-content: center;
}
ul.alvia-header-nav {
	list-style: none!important;
	margin: 0!important;
	padding: 0!important;
	list-style-type: none!important;
}
ul.alvia-header-nav li {
	list-style: none!important;
	margin: 0!important;
	padding: 0!important;
	list-style-type: none!important;
}
.alvia-header-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.25rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	list-style-type: none!important;
	list-style: none!important;
}

.alvia-header-nav > li {
	display: flex;
	align-items: center;
}

/* Supprimer les points de liste (priorité max sur Divi) */
body .alvia-header-nav,
body .alvia-header-nav li,
body .alvia-header-menu ul,
body .alvia-header-menu ul li,
body .et_pb_code_inner .alvia-header-nav,
body .et_pb_code_inner .alvia-header-nav li,
body .et_pb_module .et_pb_code_inner .alvia-header-nav li,
body #main-content .alvia-header-nav li {
	list-style: none !important;
	list-style-type: none !important;
	list-style-position: outside !important;
}

/* Cibler toute la chaîne Divi (Theme Builder) pour écraser les ::before/::after */
body .alvia-header-nav li::before,
body .alvia-header-nav li::after,
body .alvia-header-nav .menu-item::before,
body .alvia-header-nav .menu-item::after,
body .alvia-header-menu .alvia-header-nav li::before,
body .alvia-header-menu .alvia-header-nav li::after,
body .et_pb_row .et_pb_column .et_pb_module .et_pb_code_inner .alvia-header-nav li::before,
body .et_pb_row .et_pb_column .et_pb_module .et_pb_code_inner .alvia-header-nav li::after,
body .et_pb_code_inner ul.alvia-header-nav li::before,
body .et_pb_code_inner ul.alvia-header-nav li::after {
	display: none !important;
	content: none !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
	font-size: 0 !important;
	line-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

.alvia-header-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 1.82rem;
	font-family: 'Adamina', Georgia, serif;
	font-size: 1.3rem;
	line-height: 1.4;
	color: var(--alvia-menu-inactive, #a1c636);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease, opacity 0.2s ease;
}

/* Survol = même couleur que l’état actif */
.alvia-header-nav a:hover {
	color: var(--alvia-menu-active, #7fa82e);
	opacity: 1;
}

.alvia-header-nav .current-menu-item a {
	color: var(--alvia-menu-active, #7fa82e);
	font-weight: 600;
}

/* Accueil : icône maison — alignement + couleur active uniquement sur la page d’accueil */
.alvia-header-nav .home-icon a {
	justify-content: center;
	height: 1.82rem;
	min-height: 1.82rem;
	font-size: 0 !important;
	line-height: 0 !important;
	overflow: hidden !important;
	padding: 0 0.4rem;
	box-sizing: content-box;
	transform: translateY(0.04rem);
}

body .alvia-header-nav .home-icon,
body .alvia-header-nav li.home-icon {
	align-self: center;
}

/* Inactif (hors page d’accueil) : vert standard */
.alvia-header-nav .home-icon a::before,
.alvia-header-nav .home-icon:not(.current-menu-item) a::before {
	content: '';
	display: block;
	width: 1.35rem;
	height: 1.25rem;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a1c636'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
}

/* Actif (page d’accueil) ou survol : vert actif */
.alvia-header-nav .home-icon.current-menu-item a::before,
.alvia-header-nav .home-icon a:hover::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237fa82e'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

/* Documentation : bouton avec bordure arrondie */
.alvia-header-nav .btn-brochure a {
	padding: 0.45em 1.1em;
	border: 2px solid var(--alvia-menu-inactive, #a1c636);
	border-radius: 999px;
}

.alvia-header-nav .btn-brochure a:hover {
	border-color: var(--alvia-menu-active, #7fa82e);
	background-color: rgba(127, 168, 46, 0.08);
}

/* ----- Mini-panier + Compte (icônes harmonisées #a1c636) ----- */
.alvia-header-mini-cart {
	position: relative;
	z-index: 100000;
}

.alvia-header-mini-cart-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	width: 50px;
	height: 50px;
	padding: 0;
	background: transparent !important;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	color: #a1c636;
	font: inherit;
	line-height: 1;
	position: relative;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.alvia-header-mini-cart-trigger:hover {
	color: #7fa82e!important;
}

.alvia-header-mini-cart-icon {
	display: inline-flex;
	width: 28px;
	height: 28px;
}

.alvia-header-mini-cart-icon svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
}

.alvia-header-mini-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.4rem;
	height: 1.4rem;
	padding: 0 0.3rem;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	border-radius: 999px;
	background: #a1c636;
	color: #fff;
}

.alvia-header-mini-cart-dropdown {
	position: fixed;
	/* top/right définis en JS pour alignement sous le bouton */
	min-width: 320px;
	max-width: 90vw;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	pointer-events: none;
}

.alvia-header-mini-cart-dropdown.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

/* Mobile : garder le dropdown dans le viewport (éviter débordement à gauche) */
@media (max-width: 980px) {
	.alvia-header-mini-cart-dropdown {
		left: 20px !important;
		right: 20px !important;
		width: auto !important;
		min-width: 0 !important;
		max-width: none !important;
		box-sizing: border-box;
	}
	.alvia-header-mini-cart-dropdown.is-open {
		transform: translateY(0);
	}
}

.alvia-header-mini-cart .widget_shopping_cart_content {
	padding: 1rem;
	max-height: 70vh;
	overflow-y: auto;
}

.alvia-header-mini-cart .cart_list {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}

.alvia-header-mini-cart .woocommerce-mini-cart__buttons {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.alvia-header-mini-cart .woocommerce-mini-cart__buttons .button {
	display: block;
	text-align: center;
	text-decoration: none;
	padding: 0.6rem 1rem;
	border-radius: 4px;
	font-weight: 600;
}

.alvia-header-mini-cart .woocommerce-mini-cart__buttons .button:hover {
	color: #5a7a1f !important;
	border-color: #5a7a1f !important;
	background-color: rgba(90, 122, 31, 0.08) !important;
}

/* ----- Lien compte (icône, même style que panier) ----- */
.alvia-header-account {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	padding: 0;
	text-decoration: none;
	color: #a1c636;
	background: transparent;
	border-radius: 50%;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.alvia-header-account:hover {
	background-color: rgba(161, 198, 54, 0.12);
	color: #8aad2e;
}

.alvia-header-account-icon {
	display: inline-flex;
	width: 28px;
	height: 28px;
}

.alvia-header-account-icon svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
}

/* ----- Bouton hamburger (masqué sur desktop) ----- */
.alvia-header-mobile-toggle {
	display: none;
}

/* ----- Bouton X fermer : masqué partout sauf dans le portail menu mobile ----- */
.alvia-header-mobile-close {
	display: none !important;
}

/* ----- Version mobile (menu hamburger) ----- */
/* CRITIQUE : Divi met width:100% sur les colonnes en dessous de 980px/767px, ce qui masque
   la colonne droite. On force le layout horizontal et la visibilité des colonnes. */
@media (max-width: 980px) {
	/* Row header : TOUJOURS en ligne, jamais en colonne (override Divi) */
	body .et_pb_row.alvia-header,
	body .et_pb_section .et_pb_row.alvia-header {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		overflow: visible !important;
	}
	/* Colonne droite : NE PAS mettre 100% (Divi le fait par défaut) */
	body .et_pb_row.alvia-header > .et_pb_column.alvia-header-right,
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-right {
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		flex: 0 0 auto !important;
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
	/* Colonne gauche : idem */
	body .et_pb_row.alvia-header > .et_pb_column.alvia-header-left {
		width: auto !important;
		max-width: none !important;
		flex: 0 0 auto !important;
	}
	/* Section header : pas de overflow qui coupe */
	body .et_pb_section .et_pb_row.alvia-header {
		overflow: visible !important;
	}
	body .et_pb_section:has(.et_pb_row.alvia-header) {
		overflow: visible !important;
	}

	/* Shortcode [alvia_header] dans module Code : forcer visibilité (Divi peut masquer le parent) */
	.et_pb_section:has(.alvia-header-shortcode-wrap),
	.et_pb_section:has(header.alvia-header),
	.et_pb_row:has(.alvia-header-shortcode-wrap),
	.et_pb_row:has(header.alvia-header),
	.et_pb_column:has(.alvia-header-shortcode-wrap),
	.et_pb_column:has(header.alvia-header),
	.et_pb_code:has(.alvia-header-shortcode-wrap),
	.et_pb_code:has(header.alvia-header),
	.et_pb_code_inner:has(.alvia-header-shortcode-wrap),
	.et_pb_code_inner:has(header.alvia-header) {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		width: 100% !important;
		max-width: none !important;
	}
	.et_pb_row:has(.alvia-header-shortcode-wrap),
	.et_pb_row:has(header.alvia-header) {
		display: flex !important;
	}
	.alvia-header-shortcode-wrap {
		display: block !important;
		width: 100% !important;
		visibility: visible !important;
	}
	/* Section header : éviter collapse sur mobile */
	.et_pb_section:has(header.alvia-header) {
		min-height: auto !important;
		padding-top: 0.5rem !important;
		padding-bottom: 0.5rem !important;
	}

	/* Theme Builder : nowrap. Marges 20px sur section uniquement (row sans padding horizontal) */
	body .et_pb_row.alvia-header,
	body .et_pb_row.alvia-header .et_pb_row_inner {
		flex-wrap: nowrap;
		gap: 0.35rem 0.5rem;
		padding: 0.35rem 0 !important;
		margin: 0 !important;
	}
	/* Pages produit (shortcode) : grid 2 colonnes [logo|icônes] pour tout garder sur une ligne */
	.alvia-header-product-inline .alvia-header,
	.alvia-header-shortcode-wrap .alvia-header {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) auto !important;
		gap: 0.5rem 1rem !important;
		align-items: center !important;
		width: 100% !important;
		max-width: 100% !important;
		padding: 0.35rem 0 !important;
		margin: 0 !important;
	}
	.alvia-header-product-inline .alvia-header-left,
	.alvia-header-shortcode-wrap .alvia-header-left {
		min-width: 0 !important;
	}
	.alvia-header-product-inline .alvia-header-center,
	.alvia-header-shortcode-wrap .alvia-header-center {
		display: none !important;
	}
	.alvia-header-product-inline .alvia-header-right,
	.alvia-header-shortcode-wrap .alvia-header-right {
		display: flex !important;
		flex-shrink: 0 !important;
	}

	/* Masquer le centre dans la barre (le menu devient un tiroir) */
	.alvia-header .alvia-header-center,
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) {
		position: static;
		flex: 0 0 0 !important;
		width: 0 !important;
		min-width: 0 !important;
		max-width: 0 !important;
		overflow: visible;
		padding: 0 !important;
	}

	/* Popup menu : plein écran par-dessus tout le contenu ([alvia_header]) */
	.alvia-header-menu-wrap {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999999;
		background: rgba(0, 0, 0, 0.5);
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 1rem;
		box-sizing: border-box;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.25s ease, visibility 0.25s ease;
	}
	.alvia-header.menu-is-open .alvia-header-menu-wrap {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}
	.alvia-header-menu-popup-inner {
		position: relative;
		background: #fff;
		border-radius: 8px;
		box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
		max-height: 85vh;
		overflow-y: auto;
		width: 100%;
		max-width: 360px;
		padding: 3rem 1.25rem 1.5rem;
	}
	.alvia-header-mobile-close {
		position: absolute;
		top: 0.75rem;
		right: 0.75rem;
		z-index: 2;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: transparent;
		border: none;
		border-radius: 50%;
		cursor: pointer;
		color: #333;
		transition: background-color 0.2s ease, color 0.2s ease;
	}
	.alvia-header-mobile-close:hover {
		background: rgba(0, 0, 0, 0.06);
		color: #000;
	}
	.alvia-header-mobile-close-icon {
		display: inline-flex;
		width: 24px;
		height: 24px;
	}
	.alvia-header-mobile-close-icon svg {
		width: 100%;
		height: 100%;
		stroke: currentColor;
	}

	/* Theme Builder 3 colonnes : popup plein écran (même style que [alvia_header]) */
	/* Fallback : colonne qui contient le menu (.alvia-header-nav) si pas de classe alvia-header-center */
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: 100% !important;
		z-index: 999999 !important;
		background: rgba(0, 0, 0, 0.5) !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 1rem !important;
		box-sizing: border-box !important;
		margin: 0 !important;
		border: none !important;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
		transition: opacity 0.25s ease, visibility 0.25s ease !important;
		max-height: none !important;
		overflow: visible !important;
	}
	body .et_pb_row.alvia-header.menu-is-open .et_pb_column.alvia-header-center,
	body .et_pb_row.menu-is-open .et_pb_column:has(.alvia-header-nav) {
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-menu,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-menu {
		position: relative;
		background: #fff;
		border-radius: 8px;
		box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
		max-height: 85vh;
		overflow-y: auto;
		width: 100%;
		max-width: 360px;
		padding: 3rem 1.25rem 1.5rem;
		margin: 0 auto;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-mobile-close,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-mobile-close {
		position: absolute;
		top: 0.75rem;
		right: 0.75rem;
		z-index: 2;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: transparent;
		border: none;
		border-radius: 50%;
		cursor: pointer;
		color: #333;
		transition: background-color 0.2s ease, color 0.2s ease;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-mobile-close:hover,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-mobile-close:hover {
		background: rgba(0, 0, 0, 0.06);
		color: #000;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-mobile-close-icon,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-mobile-close-icon {
		display: inline-flex;
		width: 24px;
		height: 24px;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-mobile-close-icon svg,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-mobile-close-icon svg {
		width: 100%;
		height: 100%;
		stroke: currentColor;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-menu,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-menu {
		padding: 1rem 1.25rem 1.5rem;
		margin-top: 0;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-nav,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-nav {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-nav > li,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-nav > li {
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-nav > li:last-child,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-nav > li:last-child {
		border-bottom: none;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-nav a,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-nav a {
		display: flex;
		align-items: center;
		min-height: 2.75rem;
		padding: 0.5rem 0;
		font-size: 1.15rem;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-nav .home-icon a,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-nav .home-icon a {
		justify-content: flex-start;
		padding-left: 0;
	}
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-center .alvia-header-nav .btn-brochure a,
	body .et_pb_row .et_pb_column:has(.alvia-header-nav) .alvia-header-nav .btn-brochure a {
		margin-top: 20px;
		justify-content: center;
	}

	/* Padding du contenu du tiroir (sous la barre header) */
	.alvia-header-menu-wrap .alvia-header-menu {
		padding: 1rem 1.25rem 1.5rem;
		margin-top: 0;
	}
	.alvia-header-menu-wrap .alvia-header-nav {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}
	.alvia-header-menu-wrap .alvia-header-nav > li {
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	}
	.alvia-header-menu-wrap .alvia-header-nav > li:last-child {
		border-bottom: none;
	}
	.alvia-header-menu-wrap .alvia-header-nav a {
		display: flex;
		align-items: center;
		min-height: 2.75rem;
		padding: 0.5rem 0;
		font-size: 1.15rem;
	}
	.alvia-header-menu-wrap .alvia-header-nav .home-icon a {
		justify-content: flex-start;
		padding-left: 0;
	}
	.alvia-header-menu-wrap .alvia-header-nav .btn-brochure a {
		margin-top: 20px;
		justify-content: center;
	}

	/* Bouton hamburger visible, même style que compte/panier */
	.alvia-header-mobile-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 50px;
		height: 50px;
		padding: 0;
		background: transparent !important;
		border: none;
		border-radius: 50%;
		cursor: pointer;
		color: #a1c636;
		font: inherit;
		line-height: 1;
		appearance: none;
		-webkit-appearance: none;
		box-shadow: none;
		transition: background-color 0.2s ease, color 0.2s ease;
		flex-shrink: 0;
	}
	.alvia-header-mobile-toggle:hover {
		background-color: rgba(161, 198, 54, 0.12) !important;
		color: #8aad2e;
	}
	.alvia-header-mobile-toggle[aria-expanded="true"] {
		background-color: rgba(161, 198, 54, 0.12) !important;
		color: #7fa82e;
	}
	.alvia-header-mobile-toggle-icon {
		display: inline-flex;
		width: 28px;
		height: 28px;
	}
	.alvia-header-mobile-toggle-icon svg {
		width: 100%;
		height: 100%;
		stroke: currentColor;
	}

	/* Logo plus petit sur mobile, peut rétrécir pour laisser place aux icônes */
	.alvia-header-logo img,
	.alvia-header-logo .alvia-header-logo-img {
		max-height: 50px;
		min-height: 40px;
		max-width: 100%;
		width: auto;
		height: auto;
		object-fit: contain;
	}

	/* Ordre : logo | toggle + panier + compte */
	.alvia-header-right {
		display: flex !important;
		flex-direction: row !important;
		align-items: center !important;
		gap: 0.15rem !important;
	}

	/* Forcer la colonne droite visible : override Divi qui met width:100% sur mobile */
	body .et_pb_row.alvia-header > .et_pb_column.alvia-header-right,
	body .alvia-header .alvia-header-right {
		flex: 0 0 auto !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
	}
	/* Forcer la colonne gauche (logo) : éviter overflow */
	body .et_pb_row.alvia-header > .et_pb_column.alvia-header-left,
	body .alvia-header .alvia-header-left {
		flex: 0 0 auto !important;
		width: auto !important;
		max-width: none !important;
	}
	/* Section header : pas de overflow qui masque la colonne droite */
	body .et_pb_row.alvia-header {
		overflow: visible !important;
	}
}

/* Breakpoint 767px (Divi "phone") : mêmes overrides car Divi recharge des styles */
@media (max-width: 767px) {
	body .et_pb_row.alvia-header,
	body .et_pb_section .et_pb_row.alvia-header {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		overflow: visible !important;
	}
	body .et_pb_row.alvia-header > .et_pb_column.alvia-header-right,
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-right {
		width: auto !important;
		max-width: none !important;
		flex: 0 0 auto !important;
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
		width: 180px!important;
	}
}

/* Décalage du contenu quand le tiroir est ouvert (éviter scroll derrière) */
body.alvia-menu-open {
	overflow: hidden;
}

/* ----- Portail menu mobile : fullscreen, overlay injectée dans body ----- */
@media (max-width: 980px) {
	.alvia-mobile-menu-portal,
	#alvia-mobile-menu-portal {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100vw !important;
		height: 100vh !important;
		max-width: none !important;
		z-index: 999999 !important;
		background: #fff !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 0 !important;
		box-sizing: border-box !important;
		margin: 0 !important;
		transform: none !important;
		overflow: auto !important;
	}
	.alvia-mobile-menu-portal .alvia-header-menu-popup-inner,
	#alvia-mobile-menu-portal .alvia-header-menu-popup-inner {
		position: relative;
		background: #fff;
		border-radius: 0;
		box-shadow: none;
		max-height: none;
		height: 100%;
		min-height: 100vh;
		overflow-y: auto;
		width: 100%;
		max-width: none;
		padding: 3rem 1.5rem 2rem;
		box-sizing: border-box;
		text-align: left;
	}
	.alvia-mobile-menu-portal .alvia-header-mobile-close,
	#alvia-mobile-menu-portal .alvia-header-mobile-close {
		position: absolute;
		top: 0.75rem;
		right: 0.75rem;
		z-index: 2;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: transparent;
		border: none;
		border-radius: 50%;
		cursor: pointer;
		color: #333;
	}
	.alvia-mobile-menu-portal .alvia-header-mobile-close:hover,
	#alvia-mobile-menu-portal .alvia-header-mobile-close:hover {
		background: rgba(0, 0, 0, 0.06);
		color: #000;
	}
	.alvia-mobile-menu-portal .alvia-header-nav,
	#alvia-mobile-menu-portal .alvia-header-nav {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		list-style: none;
		margin: 0;
		padding: 0;
		text-align: left;
	}
	.alvia-mobile-menu-portal .alvia-header-nav > li,
	#alvia-mobile-menu-portal .alvia-header-nav > li {
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	}
	.alvia-mobile-menu-portal .alvia-header-nav > li:last-child,
	#alvia-mobile-menu-portal .alvia-header-nav > li:last-child {
		border-bottom: none;
	}
	.alvia-mobile-menu-portal .alvia-header-nav a,
	#alvia-mobile-menu-portal .alvia-header-nav a {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		min-height: 2.75rem;
		padding: 0.5rem 0;
		font-size: 1.15rem;
		color: #a1c636;
		text-decoration: none;
		text-align: left;
	}
	.alvia-mobile-menu-portal .alvia-header-nav a:hover,
	#alvia-mobile-menu-portal .alvia-header-nav a:hover {
		color: #7fa82e;
	}
	/* Portail : afficher « Accueil » à la place de l’icône maison */
	.alvia-mobile-menu-portal .alvia-header-nav .home-icon a::before,
	#alvia-mobile-menu-portal .alvia-header-nav .home-icon a::before {
		display: none !important;
	}
	.alvia-mobile-menu-portal .alvia-header-nav .home-icon a,
	#alvia-mobile-menu-portal .alvia-header-nav .home-icon a {
		font-size: 1.15rem !important;
		line-height: normal !important;
		overflow: visible !important;
		min-height: 2.75rem;
		justify-content: flex-start !important;
		text-align: left !important;
	}
	.alvia-mobile-menu-portal .alvia-header-nav .home-icon,
	.alvia-mobile-menu-portal .alvia-header-nav li.home-icon,
	#alvia-mobile-menu-portal .alvia-header-nav .home-icon,
	#alvia-mobile-menu-portal .alvia-header-nav li.home-icon {
		align-self: stretch !important;
	}
	.alvia-mobile-menu-portal .alvia-header-nav .home-icon a:empty::after,
	#alvia-mobile-menu-portal .alvia-header-nav .home-icon a:empty::after {
		content: 'Accueil';
	}
	/* Portail : bouton Documentation — padding gauche / droite + marge top */
	.alvia-mobile-menu-portal .alvia-header-nav .btn-brochure a,
	#alvia-mobile-menu-portal .alvia-header-nav .btn-brochure a {
		margin-top: 20px;
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}
	/* Quand le portail est affiché, masquer l’overlay d’origine (évite double fond) */
	body:has(#alvia-mobile-menu-portal) .alvia-header-menu-wrap,
	body:has(#alvia-mobile-menu-portal) .et_pb_row .et_pb_column.alvia-header-center,
	body:has(#alvia-mobile-menu-portal) .et_pb_row .et_pb_column:has(.alvia-header-nav) {
		display: none !important;
	}
}

/* Override Divi width:100% sur colonnes à 479px – header uniquement (spécificité > .et-db #et-boc .et-l) */
@media (max-width: 479px) {
	body.alvia-woocommerce #et-boc .et-l--header .et_pb_column,
	body.alvia-woocommerce #et-boc .et-l .et_pb_row.alvia-header .et_pb_column,
	body.alvia-woocommerce .et-l--header .et_pb_column,
	body.alvia-woocommerce .et_pb_row.alvia-header .et_pb_column {
		width: auto !important;
	}

	body .et_pb_row.alvia-header > .et_pb_column.alvia-header-right,
	body .et_pb_row.alvia-header .et_pb_column.alvia-header-right {
		margin-left: -57px!important;
	}
}