/* =========================================================================
   Bandeau d'en-tête à deux étages — balisage : inc/kg-bandeau.php
   Préfixe .kgb-* ; couleurs et polices alignées sur l'accueil (kg-accueil.css).
   Étage 1 = rangée WoodMart (hauteur : style.css, « Header height override »).
   ========================================================================= */

.whb-header {
	--kgb-ink: #0f172a;
	--kgb-text: #475569;
	--kgb-muted: #64748b;
	--kgb-line: #e2e8f0;
	--kgb-soft: #f6f7fc;
	--kgb-orange: #ff6b35;
	--kgb-title: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	--kgb-body: "Cabin", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.kgb-c-indigo { --c: #6366f1; }
.kgb-c-sky    { --c: #0284c7; }
.kgb-c-green  { --c: #15803d; }
.kgb-c-amber  { --c: #b45309; }
.kgb-c-pink   { --c: #db2777; }

/* ---------- Étage 1 : recherche ---------- */
.whb-header-bottom .whb-col-center { justify-content: flex-start; }
/* Les feuilles de l'élément WoodMart sont chargées dans le corps de page, après celle-ci :
   le préfixe .whb-header-bottom donne la priorité sans !important. */
.whb-header-bottom .whb-kg_bandeau_search {
	--wd-search-form-width: 460px;
	flex: 0 1 460px;
	padding-inline: 0;
}
.whb-header-bottom .whb-kg_bandeau_search form.searchform {
	--wd-form-height: 42px;
	--wd-form-brd-radius: 999px;
	--wd-form-bg: var(--kgb-soft);
	--wd-form-brd-color: var(--kgb-line);
	--wd-form-brd-color-focus: var(--kgb-orange);
	--wd-form-color: var(--kgb-ink);
	--wd-form-placeholder-color: var(--kgb-muted);
}
.whb-header-bottom .whb-kg_bandeau_search form.searchform input.s {
	min-width: 0;
	background-color: var(--kgb-soft);
	font-family: var(--kgb-body);
	font-size: 15px;
}
.whb-header-bottom .whb-kg_bandeau_search form.searchform input.s:focus { background-color: #fff; }

/* ---------- Étage 1 : bouton Espace enseignant ---------- */
.whb-header-bottom a.btn.kgb-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 0;
	padding: 9px 16px;
	border: 1.5px solid var(--kgb-line);
	border-radius: 999px;
	background: #fff;
	color: var(--kgb-ink);
	font-family: var(--kgb-title);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
	white-space: nowrap;
	box-shadow: none;
	transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
/* Toque (icône Lucide « graduation-cap ») : en masque pour suivre la couleur du texte. */
.whb-header-bottom a.btn.kgb-cta::before {
	content: "";
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--kgb-cap) center / contain no-repeat;
	mask: var(--kgb-cap) center / contain no-repeat;
	--kgb-cap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z'/%3E%3Cpath d='M22 10v6'/%3E%3Cpath d='M6 12.5V16a6 3 0 0 0 12 0v-3.5'/%3E%3C/svg%3E");
}
.whb-header-bottom a.btn.kgb-cta:hover,
.whb-header-bottom a.btn.kgb-cta:focus-visible {
	border-color: var(--kgb-orange);
	background: #fff;
	color: var(--kgb-orange);
}

/* ---------- Étage 2 : niveaux + rubriques ---------- */
.kgb-etage {
	background: var(--kgb-soft);
	border-top: 1px solid var(--kgb-line);
	border-bottom: 1px solid var(--kgb-line);
}
.whb-full-width .kgb-etage > .container { max-width: 100%; }
.kgb-etage .kgb-etage__in {
	display: flex;
	align-items: center;
	height: 46px;
	padding-inline: 25px; /* aligné sur le logo : gouttière de la rangée (15 px) + marge des éléments (10 px) */
}
.kgb-niveaux,
.kgb-rubriques {
	display: flex;
	align-items: center;
}
.kgb-niveaux { gap: 8px; }
.kgb-rubriques { gap: 26px; }

.kgb-label {
	margin-right: 6px;
	font-family: var(--kgb-title);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--kgb-muted);
}
.kgb-chip {
	padding: 4px 12px;
	border-radius: 999px;
	font-family: var(--kgb-title);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--c);
	background: color-mix(in srgb, var(--c) 12%, #fff);
	transition: background-color .18s ease, color .18s ease;
}
.kgb-chip:hover,
.kgb-chip:focus-visible,
.kgb-chip[aria-current="page"] {
	color: #fff;
	background: var(--c);
}
.kgb-sep {
	width: 1px;
	height: 20px;
	margin: 0 22px;
	background: #cbd5e1;
}
.kgb-rubriques a {
	padding: 4px 0;
	border-bottom: 2px solid transparent;
	font-family: var(--kgb-title);
	font-size: 14px;
	font-weight: 500;
	color: var(--kgb-text);
	white-space: nowrap;
	transition: color .18s ease, border-color .18s ease;
}
.kgb-rubriques a:hover,
.kgb-rubriques a:focus-visible { color: var(--kgb-ink); }
.kgb-rubriques a[aria-current="page"] {
	color: var(--kgb-ink);
	border-bottom-color: var(--kgb-orange);
}

/* Tablette et téléphone : le tiroir mobile WoodMart porte les menus. */
@media (max-width: 1024px) {
	.kgb-etage { display: none; }

	/* ---------- En-tête mobile : une seule rangée fine ----------
	   Logo à gauche ; compte, panier et burger à droite, en icônes nues comme
	   sur ordinateur. La bande violette « WoodMart » (general-header) et la barre
	   d'outils du bas (option sticky_toolbar) sont retirées dans les réglages du
	   thème (01/10/2026) : le compte, seul accès à la connexion élève de cette
	   barre, est désormais ici et dans le tiroir du burger. */
	.whb-header {
		--wd-header-bottom-h: 60px !important;
		--wd-header-bottom-sticky-h: 60px !important;
	}
	/* .whb-header en tête : passe devant le min-height de style.css, chargé après. */
	.whb-header .whb-header-bottom {
		min-height: 60px !important;
		border-bottom: 1px solid var(--kgb-line);
	}
	.whb-header .whb-header-bottom .whb-flex-row { height: 60px; }
	.whb-header-bottom .whb-column_mobile5 {
		justify-content: flex-end;
		gap: 2px;
	}
	.whb-header-bottom .whb-column_mobile5 > .site-logo {
		margin-right: auto;
		padding: 0;
	}
	.whb-header-bottom .whb-column_mobile5 > .site-logo img { max-height: 36px; width: auto; }
	.whb-header-bottom .whb-column_mobile5 > .wd-tools-element > a {
		width: 42px;
		height: 42px;
		padding: 0;
		justify-content: center;
		border: 0;
		border-radius: 12px;
		background: transparent;
		box-shadow: none;
		color: var(--kgb-ink) !important;
		transition: background-color .18s ease;
	}
	.whb-header-bottom .whb-column_mobile5 > .wd-tools-element > a:hover,
	.whb-header-bottom .whb-column_mobile5 > .wd-tools-element > a:focus-visible {
		background: var(--kgb-soft);
	}
	/* Burger mis en avant : seul accès aux rubriques sur téléphone. */
	.whb-header-bottom .whb-column_mobile5 > .wd-header-mobile-nav > a {
		margin-left: 4px;
		background: var(--kgb-soft);
		border: 1px solid var(--kgb-line);
	}
	/* Les ronds du « design 6 » WoodMart sont portés par .wd-tools-icon. */
	.whb-header-bottom .whb-column_mobile5 .wd-tools-icon {
		border: 0 !important;
		background: transparent !important;
	}
	.whb-header-bottom .whb-column_mobile5 .wd-tools-icon .wd-tools-count {
		top: -6px;
		right: -8px;
		min-width: 17px;
		height: 17px;
		line-height: 17px;
		font-size: 10px;
		background: var(--kgb-orange) !important;
		color: #fff !important;
		box-shadow: none !important;
	}

	/* Bouton flottant « sidebar » de WoodMart : utile seulement là où il y a
	   des filtres (boutique, catégories) ; ailleurs il faisait un second burger. */
	body:not(.woocommerce-shop):not(.tax-product_cat):not(.tax-product_tag):not(.post-type-archive-product) .wd-sidebar-opener {
		display: none !important;
	}

	/* La barre du bas n'existe plus : le bandeau « hors connexion » redescend. */
	body #kog-app-banner { bottom: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
	.kgb-chip, .kgb-rubriques a, .whb-header-bottom a.btn.kgb-cta { transition: none; }
}

/* ---------- Étage 1 : bouton Mon panier ----------
   Élément « cart » du constructeur WoodMart (id kg_header_cart), design « texte seul »,
   sans panneau : lien direct vers /panier/. Libellé et compteur : inc/kg-panier.php. */
.whb-header-bottom .whb-kg_header_cart > a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: auto;
	padding: 9px 16px;
	border: 1.5px solid var(--kgb-line);
	border-radius: 999px;
	background: #fff;
	color: var(--kgb-ink);
	font-family: var(--kgb-title);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	white-space: nowrap;
	transition: border-color .18s ease, color .18s ease;
}
/* Chariot (icône Lucide « shopping-cart ») en masque, comme la toque du bouton enseignant. */
.whb-header-bottom .whb-kg_header_cart > a::before {
	content: "";
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--kgb-chariot) center / contain no-repeat;
	mask: var(--kgb-chariot) center / contain no-repeat;
	--kgb-chariot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E");
}
.whb-header-bottom .whb-kg_header_cart > a:hover,
.whb-header-bottom .whb-kg_header_cart > a:focus-visible {
	border-color: var(--kgb-orange);
	color: var(--kgb-orange);
}
.whb-header-bottom .whb-kg_header_cart .wd-tools-text-cart {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font: inherit;
	text-transform: none;
}
.whb-header-bottom .whb-kg_header_cart .wd-cart-number {
	position: static;
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--kgb-orange);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	opacity: 1;
}
.whb-header-bottom .whb-kg_header_cart .wd-cart-number > span { display: none; }
.whb-header-bottom .whb-kg_header_cart .wd-cart-number[data-count="0"] { display: none; }
