/*
 * 15/11/2026 — MENU DU TÉLÉPHONE (burger) de l'en-tête du constructeur : le CSS, sorti de _ShopHeaderBurger.cshtml (qui le charge)
 * pour servir aussi à l'ÉDITEUR (Builder v3), avec Scripts/js/shop-header-burger.js.
 * Portée : `.shop-theme-header` (site, aperçu) OU `.bnav-head` (posée par le script sur l'en-tête mesuré : `.shop-theme-header`, sinon
 * la `.v2-section` de l'en-tête dans le canevas de l'éditeur).
 * Écran étroit : `@media (max-width: 767.98px)` sur le site, ET `.bnav-head.bnav-narrow` (posée par le script quand l'EN-TÊTE fait
 * moins de 768 px) — dans l'éditeur, la fenêtre est large et seul le canevas est étroit. Les deux blocs portent les mêmes règles.
 */

/* Bascule mobile pilotée par l'espace dispo pour le menu de navigation du thème. La couleur du panneau et le côté d'apparition
   (gauche/droite) sont décidés en JS selon où le commerçant a placé le widget navMenu dans la ligne d'en-tête. */
.bnav-burger {
	display: none;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 2.2rem;
	color: inherit;
	padding: 4px 10px;
}

/* Replié : le menu (où qu'il soit dans la ligne) est masqué, le burger (enfant direct de la ligne) s'affiche. */
.bnav-host.bnav-collapsed .builder-nav-menu {
	display: none !important;
}

.bnav-host.bnav-collapsed > .bnav-burger {
	display: inline-flex;
}

/* La colonne du widget ne contient plus que le menu caché : masquée. */
.bnav-host.bnav-collapsed .type-col:has(> .builder-nav-menu, > .type-widget > .builder-nav-menu) {
	display: none !important;
}

/* 06/10/2026 (retour Romain, panneau à ~800 px) : un en-tête replié prend, à toute largeur, la ligne horizontale du mode mobile,
   icônes sur une seule ligne. LOT M3 : la ligne v2 est `.v2-section > .v2-in`, ses colonnes `.v2-in > .v2-box`. */
:is(.shop-theme-header, .bnav-head) .row-section.bnav-host.bnav-collapsed,
.v2-in.bnav-host.bnav-collapsed {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	grid-template-columns: none !important;
	align-items: center !important;
	gap: 8px !important;
}
:is(.shop-theme-header, .bnav-head) .row-section.bnav-host.bnav-collapsed > .type-grid-col,
.v2-in.bnav-host.bnav-collapsed > .v2-box {
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: none !important;
}
:is(.shop-theme-header, .bnav-head) .row-section.bnav-host.bnav-collapsed > .type-grid-col:not(:has(.type-widget)),
.v2-in.bnav-host.bnav-collapsed > .v2-box:not(:has(.type-widget)) {
	flex: 1 1 0 !important;
	min-width: 0 !important;
}
:is(.shop-theme-header, .bnav-head) .row-section.bnav-host.bnav-collapsed .type-col,
.v2-in.bnav-host.bnav-collapsed .type-col {
	flex-wrap: nowrap !important;
}

/* 06/10/2026 : icônes de l'en-tête (recherche, langue, compte, panier) centrées sur la MÊME ligne que le bouton. */
:is(.shop-theme-header, .bnav-head) .type-widget:has(> .menu-action),
:is(.shop-theme-header, .bnav-head) .type-widget[data-wtype="userAccount"] {
	display: flex;
	align-items: center;
}
:is(.shop-theme-header, .bnav-head) .menu-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.bnav-backdrop {
	position: fixed;
	inset: 0;
	/* LOT L9 (D-26) : voile plus marqué (0,32 teal ne se voyait pas sur un site sombre). */
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
	z-index: 1049;
}

	.bnav-backdrop.open {
		opacity: 1;
		pointer-events: auto;
	}

.bnav-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	width: 290px;
	max-width: 85vw;
	background: var(--bnav-panel-bg, #fff);
	color: var(--bnav-panel-fg, var(--blue-dim, #033035));
	box-shadow: 0 0 24px rgba(3, 48, 53, 0.18);
	/* 15/11/2026 (S-Rendu, captures L9) : fermé hors de l'écran, son ombre débordait de 24 px sur le bord (bande grise) — caché
	   (visibility) une fois refermé ; l'ombre et le glissement restent à l'ouverture et à la fermeture. */
	visibility: hidden;
	transition: transform .25s ease, visibility 0s linear .25s;
	z-index: 1050;
	overflow-y: auto;
	padding: 14px 0;
}
/* Côté droit (défaut) : glisse depuis la droite ; côté gauche : depuis la gauche. */
.bnav-panel.bnav-panel-right { right: 0; left: auto; transform: translateX(100%); }
.bnav-panel.open { visibility: visible; transition: transform .25s ease, visibility 0s; }
.bnav-panel.bnav-panel-right.open { transform: translateX(0); }
.bnav-panel.bnav-panel-left  { left: 0; right: auto; transform: translateX(-100%); }
.bnav-panel.bnav-panel-left.open { transform: translateX(0); }

	.bnav-panel-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 18px 14px 22px;
		margin-bottom: 6px;
		border-bottom: 1px solid rgba(255,255,255,0.08);
	}

	.bnav-panel-title {
		font-size: var(--ds-fs-caption);
		font-weight: 700;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		opacity: .55;
	}

	.bnav-panel-close {
		background: transparent;
		border: 0;
		color: inherit;
		cursor: pointer;
		width: 36px;
		height: 36px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 1.8rem;
		border-radius: 50%;
		transition: background .15s;
		opacity: .75;
	}

		.bnav-panel-close:hover {
			background: rgba(255,255,255,0.08);
			opacity: 1;
		}

	/* Emplacement du bouton d'appel déplacé depuis l'en-tête (quand il poussait les icônes à la ligne). */
	.bnav-panel-cta-slot {
		padding: 8px 22px 16px;
		border-bottom: 1px solid rgba(255,255,255,0.08);
		margin-bottom: 6px;
	}
		.bnav-panel-cta-slot .type-widget { margin: 0 !important; }
		.bnav-panel-cta-slot .btn { width: 100%; box-sizing: border-box; }

	.bnav-panel a {
		display: block;
		padding: 12px 22px;
		color: inherit;
		text-decoration: none;
		font-size: 1.5rem;
		font-family: var(--text-font-family, Arial), sans-serif;
		opacity: .85;
		text-align: left;
	}

		.bnav-panel a:hover {
			background: rgba(255,255,255,0.08);
			opacity: 1;
		}

		.bnav-panel a.bnav-child {
			padding-left: 40px;
			font-size: 1.35rem;
			opacity: .65;
		}
		.bnav-panel a.bnav-child.bnav-child-3 { padding-left: 58px; font-size: 1.3rem; }   /* LOT M5 : 3e niveau */

/* ── Écran étroit (1/2) : SITE, par la largeur de la fenêtre ──
   La ligne d'en-tête reste HORIZONTALE (sans ça, la grille se replie à une colonne et logo / menu / icônes prennent chacun leur ligne). */
@media (max-width: 767.98px) {
	.shop-theme-header .row-section,
	.shop-theme-header .v2-section > .v2-in {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		grid-template-columns: none !important;
		align-items: center !important;
		gap: 8px !important;
	}
	.shop-theme-header .type-grid-col,
	.shop-theme-header .type-col {
		flex: 0 0 auto !important;
		width: auto !important;
		max-width: none !important;
	}
	/* Colonne vide (espaceur 1fr) → prend l'espace restant. `:has()` ne s'imbrique pas dans `:has()`. */
	.shop-theme-header .type-grid-col:not(:has(.type-widget)),
	.shop-theme-header .v2-in > .v2-box:not(:has(.type-widget)) {
		flex: 1 1 0 !important;
		min-width: 0 !important;
	}
	.shop-theme-header .bnav-burger { margin-left: -10px; }

	/* LOT L9 (29/09, D-23) : repli posé en CSS dès le premier affichage (le script ne fait que le confirmer), et l'en-tête ne
	   peut plus élargir la page (clip horizontal ; vertical visible pour le menu du compte). */
	.shop-theme-header { overflow-x: clip !important; max-width: 100vw; }
	.shop-theme-header .row-section:not(.bnav-host) .builder-nav-menu,
	.shop-theme-header .v2-in:not(.bnav-host) .builder-nav-menu { display: none !important; }
	.shop-theme-header .row-section:not(.bnav-host) .type-col:has(> .builder-nav-menu, > .type-widget > .builder-nav-menu),
	.shop-theme-header .v2-in:not(.bnav-host) .type-col:has(> .builder-nav-menu, > .type-widget > .builder-nav-menu) { display: none !important; }
	/* LOT L9 (D-20) : cibles tactiles d'au moins 44 px. */
	.shop-theme-header .menu-action { min-width: 44px; min-height: 44px; }
	.shop-theme-header .bnav-burger { min-width: 44px; min-height: 44px; }

	/* 05/10/2026 (recette 375 px) : priorités — la colonne du panier ne rétrécit jamais ; les autres cèdent la place ; langue et
	   fidélité passent dans le menu du compte quand il existe ; marges entre icônes ramenées à 2 px (cibles de 44 px gardées). */
	.shop-theme-header .row-section > .type-grid-col:has(.menu-action-cart),
	.shop-theme-header .v2-in > .v2-box:has(.menu-action-cart) {
		flex-shrink: 0 !important;
		margin-left: auto;
	}
	.shop-theme-header .row-section > .type-grid-col:has(.type-widget):not(:has(.menu-action-cart)),
	.shop-theme-header .v2-in > .v2-box:has(.type-widget):not(:has(.menu-action-cart)) {
		flex: 0 1 auto !important;
		min-width: 0 !important;
		overflow: hidden;
	}
	.shop-theme-header .row-section > .type-grid-col:not(:has(.menu-action-cart)) img,
	.shop-theme-header .v2-in > .v2-box:not(:has(.menu-action-cart)) img { max-width: 100%; height: auto; }
	.shop-theme-header .type-col:has(.menu-action) { flex-wrap: nowrap !important; column-gap: 2px; }
	.shop-theme-header .type-col:has(.menu-action) > .type-widget[class*="mgl-"] { margin-left: 0 !important; }
	.shop-theme-header .type-col:has(.menu-action) > .type-widget[class*="mgr-"] { margin-right: 0 !important; }
	/* LOT M3 : en v2, la marge d'une icône est son « espace avant » (margin-left posée par la boîte) : ramenée à 0 de même. */
	.shop-theme-header .v2-box.type-col:has(> .type-widget > .menu-action) > .type-widget { margin-left: 0 !important; margin-right: 0 !important; }
	.shop-theme-header .menu-account-loyalty { display: none !important; }
	.shop-theme-header .type-widget:has(.menu-account) > .shop-lang { display: none !important; }
}

/* ── Écran étroit (2/2) : ÉDITEUR (canevas tablette / téléphone), par la largeur de l'EN-TÊTE (classe posée par le script) ──
   Mêmes règles que ci-dessus ; `.bnav-narrow` est l'en-tête lui-même (`.shop-theme-header` ou la `.v2-section` de l'en-tête). */
:is(.bnav-narrow .row-section, .bnav-narrow .v2-section > .v2-in, .v2-section.bnav-narrow > .v2-in) {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	grid-template-columns: none !important;
	align-items: center !important;
	gap: 8px !important;
}
.bnav-narrow .type-grid-col,
.bnav-narrow .type-col {
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: none !important;
}
.bnav-narrow .type-grid-col:not(:has(.type-widget)),
.bnav-narrow .v2-in > .v2-box:not(:has(.type-widget)) {
	flex: 1 1 0 !important;
	min-width: 0 !important;
}
.bnav-narrow .bnav-burger { margin-left: -10px; min-width: 44px; min-height: 44px; }
.bnav-narrow { overflow-x: clip !important; }
.bnav-narrow .menu-action { min-width: 44px; min-height: 44px; }
.bnav-narrow .row-section > .type-grid-col:has(.menu-action-cart),
.bnav-narrow .v2-in > .v2-box:has(.menu-action-cart) {
	flex-shrink: 0 !important;
	margin-left: auto;
}
.bnav-narrow .row-section > .type-grid-col:has(.type-widget):not(:has(.menu-action-cart)),
.bnav-narrow .v2-in > .v2-box:has(.type-widget):not(:has(.menu-action-cart)) {
	flex: 0 1 auto !important;
	min-width: 0 !important;
	overflow: hidden;
}
.bnav-narrow .row-section > .type-grid-col:not(:has(.menu-action-cart)) img,
.bnav-narrow .v2-in > .v2-box:not(:has(.menu-action-cart)) img { max-width: 100%; height: auto; }
.bnav-narrow .type-col:has(.menu-action) { flex-wrap: nowrap !important; column-gap: 2px; }
.bnav-narrow .type-col:has(.menu-action) > .type-widget[class*="mgl-"] { margin-left: 0 !important; }
.bnav-narrow .type-col:has(.menu-action) > .type-widget[class*="mgr-"] { margin-right: 0 !important; }
.bnav-narrow .v2-box.type-col:has(> .type-widget > .menu-action) > .type-widget { margin-left: 0 !important; margin-right: 0 !important; }
.bnav-narrow .menu-account-loyalty { display: none !important; }
.bnav-narrow .type-widget:has(.menu-account) > .shop-lang { display: none !important; }
