/* === BW HEADER — Floating UI === */

/* Outer wrapper : ne crée plus de couche GPU pleine-largeur */
.bw-header-outer {
	pointer-events: none;
}

/* Container : fixed centré, couche GPU limitée à 77% */
.bw-header-container {
	position: fixed;
	top: 54px; /* closer to top so content sits nearer the header */
	left: 50%;
	transform: translateX(-50%);
	width: 77%;
	max-width: 1200px;
	pointer-events: auto;
	z-index: var(--z-header);
	transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.32s ease;
}

.bw-header-container--hidden {
	transform: translateX(-50%) translateY(-140%);
	opacity: 0;
	pointer-events: none;
}

/* Barre header — grille 3 col pour centrage parfait */
.bw-header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 16px 28px;
	background: rgba(255, 255, 255, 0.97);
	border: 1px solid #E5E5EA;
	border-radius: var(--radius-sm);
	box-shadow: 0px 4px 24px 0px rgba(10, 11, 36, 0.06);
}

/* Logo */
.bw-header__logo {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	text-decoration: none;
}
.bw-header__logo:hover {
	opacity: 0.75;
}

.bw-header__logo-img {
	display: block;
	height: 44px; /* further reduced header logo size */
	width: auto;
	mix-blend-mode: multiply;
}

/* Responsive: adjust logo on smaller screens */
@media (max-width: 900px) {
	.bw-header__logo-img { height: 40px; }
	.bw-header-container { top: 44px; }
}
@media (max-width: 420px) {
	.bw-header__logo-img { height: 36px; }
	.bw-header-container { top: 36px; }
}

/* Slightly larger nav text for more presence */
.bw-header__nav-link,
.bw-header__nav a.bw-header__nav-link,
.bw-header__nav button.bw-header__nav-link {
	font-size: 18px;
	font-weight: 500;
}

/* Navigation — colonne centrale, centrée */
.bw-header__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
}

.bw-header__nav-link,
.bw-header__nav a.bw-header__nav-link,
.bw-header__nav button.bw-header__nav-link {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.bw-header__nav-link,
.bw-header__nav a.bw-header__nav-link,
.bw-header__nav button.bw-header__nav-link {
	font-family: var(--font-primary);
	font-size: 16px;
	font-weight: 400;
	color: var(--color-blue) !important;
	text-decoration: none !important;
	transition: opacity 0.2s ease;
}
.bw-header__nav-link:hover,
.bw-header__nav a.bw-header__nav-link:hover {
	opacity: 0.65;
	color: var(--color-blue) !important;
}

/* CTA zone */
.bw-header__cta {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

.bw-header__cta-login {
	font-family: var(--font-primary);
	font-size: 16px;
	font-weight: 400;
	color: var(--color-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: opacity 0.2s ease;
}
.bw-header__cta-login:hover {
	opacity: 0.65;
}

/* Bouton CTA gradient Rose → Violet */
.bw-header__cta-signup {
	display: inline-block;
	font-family: var(--font-primary);
	font-size: 15px;
	font-weight: 500;
	color: #ffffff;
	text-decoration: none;
	padding: 10px 20px;
	border-radius: var(--radius-sm);
	background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-violet) 100%);
	transition: opacity 0.2s ease, transform 0.15s ease;
	white-space: nowrap;
}
.bw-header__cta-signup:hover {
	opacity: 0.88;
	transform: translateY(-1px);
	color: #ffffff;
}

/* Colonne droite */
.bw-header__right {
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

/* Nav item wrapper pour dropdown */
.bw-header__nav-item {
	position: relative;
	display: flex;
	align-items: center;
}

.bw-header__nav-link--arrow {
	display: flex;
	align-items: center;
	gap: 4px;
}

.bw-header__nav-chevron {
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

/* === MEGA-MENU === */
.bw-mega-menu {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	background: #ffffff;
	border-radius: var(--radius-lg);
	border: 1px solid #E5E5EA;
	box-shadow: 0px 8px 32px 0px rgba(10, 11, 36, 0.10);
	padding: 24px;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	/* État caché */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	pointer-events: none;
	z-index: 9997;
}

.bw-mega-menu--open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

/* Cards */
.bw-mega-card {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.bw-mega-card:hover {
	background: #F9F9F9;
	border-color: #E5E5EA;
}

.bw-mega-card__icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #F9F9F9;
	border: 1px solid #E5E5EA;
	border-radius: var(--radius-sm);
	color: var(--color-violet);
}

.bw-mega-card:hover .bw-mega-card__icon {
	background: #ffffff;
}

.bw-mega-card__body {
	flex: 1;
	min-width: 0;
}

.bw-mega-card__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-primary);
	font-size: 14px;
	font-weight: 600;
	color: var(--color-blue);
	margin-bottom: 4px;
}

.bw-mega-card__badge {
	font-size: 11px;
	font-weight: 500;
	color: var(--color-violet);
	background: rgba(var(--color-violet-rgb), 0.08);
	padding: 2px 7px;
	border-radius: 999px;
	white-space: nowrap;
}

.bw-mega-card__badge--new {
	color: var(--color-violet);
	background: rgba(var(--color-violet-rgb), 0.08);
}

.bw-mega-card__badge--phare {
	color: #fff;
	background: var(--gradient-cta);
}

.bw-mega-card__desc {
	font-family: var(--font-primary);
	font-size: 14px;
	font-weight: 400;
	color: rgba(0, 19, 54, 0.65);
	line-height: 1.5;
	margin: 0;
}

.bw-mega-card__arrow {
	flex-shrink: 0;
	color: rgba(0, 19, 54, 0.25);
	margin-top: 2px;
	transition: color 0.15s ease, transform 0.15s ease;
}

.bw-mega-card:hover .bw-mega-card__arrow {
	color: var(--color-violet);
	transform: translateX(3px);
}

/* Hamburger (caché sur desktop) — aligné à droite */
.bw-header__burger {
	justify-self: end;
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
}
.bw-header__burger span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--color-blue);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.2s ease;
}
.bw-header__burger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bw-header__burger--open span:nth-child(2) { opacity: 0; }
.bw-header__burger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile */
.bw-mobile-menu {
	display: none;
	position: fixed;
	top: 98px;
	left: 50%;
	transform: translateX(-50%);
	width: 92%;
	max-width: 480px;
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid #E5E5EA;
	border-radius: var(--radius-sm);
	box-shadow: 0px 8px 32px 0px rgba(10, 11, 36, 0.10);
	z-index: var(--z-mobile-menu);
	padding: 20px 24px;
	flex-direction: column;
	gap: 4px;
}
.bw-mobile-menu--open {
	display: flex;
}

.bw-mobile-menu__link {
	display: block;
	font-family: var(--font-primary);
	font-size: 17px;
	font-weight: 400;
	color: var(--color-blue);
	text-decoration: none;
	padding: 12px 0;
	border-bottom: 1px solid #F0F0F5;
	transition: opacity 0.2s ease;
}
.bw-mobile-menu__link:last-child { border-bottom: none; }
.bw-mobile-menu__link:hover { opacity: 0.65; }

.bw-mobile-menu__link--cta {
	margin-top: 8px;
	text-align: center;
	padding: 12px 20px;
	border-radius: var(--radius-sm);
	background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-violet) 100%);
	color: #ffffff;
	font-weight: 500;
	border-bottom: none;
}
.bw-mobile-menu__link--cta:hover {
	opacity: 0.88;
	color: #ffffff;
}

/* Compensation body */
body { padding-top: 72px; }

/* Front page — reduce gap between header and hero content (brought closer) */
body.home .bw-hero { margin-top: -72px; }
@media (max-width: 900px) { body.home .bw-hero { margin-top: -40px; } }
@media (max-width: 420px) { body.home .bw-hero { margin-top: -12px; } }
/* ponytail: sous 768px l'en-tete flottant est masque, il n'y a donc rien a
   rattraper — la remontee collait la carte du hero a la barre d'etat iOS.
   Declaree APRES les regles ci-dessus pour les neutraliser. */
@media (max-width: 768px) { body.home .bw-hero { margin-top: 0; } }

/* ---- Responsive desktop ---- */
@media (max-width: 1024px) {
	.bw-header-container { width: 94%; }
}

/* ========================
   MOBILE APP — bottom nav
   ======================== */

/* Bottom Navigation Bar — floating pill, même esthétique que le header */
.bw-bottom-nav {
	display: none;
	position: fixed;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translateX(-50%);
	width: calc(100% - 32px);
	max-width: 420px;
	height: 58px;
	background: #ffffff;
	border: 1px solid #E5E5EA;
	border-radius: var(--radius-lg);
	box-shadow: 0px 4px 24px 0px rgba(10, 11, 36, 0.06);
	z-index: var(--z-bottom-nav);
	flex-direction: row;
	align-items: stretch;
	overflow: hidden;
}

.bw-bottom-nav__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	font-family: var(--font-primary);
	font-size: 9.5px;
	font-weight: 700;
	color: rgba(var(--color-blue-rgb), 0.65);
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

.bw-bottom-nav__item svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	flex-shrink: 0;
}

.bw-bottom-nav__item--active,
.bw-bottom-nav__item:active {
	color: var(--color-violet);
}

/* CTA Appel — fond dégradé sur toute la cellule */
.bw-bottom-nav__item--cta {
	background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-violet) 100%);
	color: #ffffff;
	border-radius: var(--radius-sm);
	margin: 6px 6px 6px 0;
	font-weight: 600;
}

.bw-bottom-nav__item--cta svg {
	stroke: #ffffff;
}

.bw-bottom-nav__item--cta:active {
	color: rgba(255, 255, 255, 0.8);
	opacity: 0.88;
}

.bw-bottom-nav__cta-pill {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}

/* Bottom Sheet */
.bw-bottom-sheet {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #ffffff;
	border-radius: 24px 24px 0 0;
	border-top: 1px solid #E5E5EA;
	box-shadow: 0px -8px 32px 0px rgba(10, 11, 36, 0.12);
	z-index: var(--z-sheet);
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	transform: translateY(100%);
	/* visibility:hidden empêche le rendu Safari même pendant le rubber-band overscroll.
	   Le délai 0.38s masque l'élément uniquement après que l'animation de fermeture est terminée. */
	visibility: hidden;
	transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1),
	            visibility 0s linear 0.38s;
	max-height: 82vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.bw-bottom-sheet--open {
	transform: translateY(0);
	visibility: visible;
	/* À l'ouverture, visibility devient visible immédiatement (0s délai) */
	transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1),
	            visibility 0s linear 0s;
}

.bw-bottom-sheet__handle {
	width: 36px;
	height: 4px;
	background: #E5E5EA;
	border-radius: 2px;
	margin: 12px auto 0;
}

.bw-bottom-sheet__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px 12px;
	border-bottom: 1px solid #F0F0F5;
}

.bw-bottom-sheet__title {
	font-family: var(--font-primary);
	font-size: 16px;
	font-weight: 700;
	color: var(--color-blue);
}

.bw-bottom-sheet__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #F9F9F9;
	border: 1px solid #E5E5EA;
	border-radius: var(--radius-sm);
	color: var(--color-blue);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.bw-bottom-sheet__content {
	padding: 12px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Formation cards dans le bottom sheet */
.bw-sheet-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	background: #F9F9F9;
	border: 1px solid #E5E5EA;
	border-radius: var(--radius-sm);
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.bw-sheet-card:active {
	background: rgba(115, 38, 155, 0.05);
	border-color: rgba(var(--color-violet-rgb), 0.25);
}

.bw-sheet-card__icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	border: 1px solid #E5E5EA;
	border-radius: var(--radius-sm);
	color: var(--color-violet);
}

.bw-sheet-card__body {
	flex: 1;
	min-width: 0;
}

.bw-sheet-card__name {
	font-family: var(--font-primary);
	font-size: 14px;
	font-weight: 600;
	color: var(--color-blue);
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 2px;
}

.bw-sheet-card__badge {
	font-size: 10px;
	font-weight: 500;
	color: var(--color-violet);
	background: rgba(var(--color-violet-rgb), 0.08);
	padding: 2px 6px;
	border-radius: 999px;
	white-space: nowrap;
}

.bw-sheet-card__badge--new {
	color: var(--color-violet);
	background: rgba(var(--color-violet-rgb), 0.08);
}

.bw-sheet-card__badge--phare {
	color: #fff;
	background: var(--gradient-cta);
}

.bw-sheet-card__desc {
	font-family: var(--font-primary);
	font-size: 12px;
	color: rgba(0, 19, 54, 0.65);
	line-height: 1.4;
}

.bw-sheet-card__arrow {
	flex-shrink: 0;
	color: rgba(0, 19, 54, 0.2);
}

/* Overlay backdrop */
.bw-sheet-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 19, 54, 0.35);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: var(--z-overlay);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.bw-sheet-overlay--visible {
	opacity: 1;
	pointer-events: auto;
}

/* ---- Breakpoints mobile ---- */
@media (max-width: 768px) {
	/* Header masqué sur mobile — remplacé par la bottom nav */
	.bw-header-outer      { display: none; }

	/* Supprimer le padding-top réservé au header.
	   ponytail: avec viewport-fit=cover la page peint derriere la barre d'etat
	   iOS — on redescend le contenu de la hauteur exacte de l'encoche, le fond
	   #F9F9F9 de html remplissant desormais toute la zone. */
	body { padding-top: env(safe-area-inset-top, 0px); }

	/* Activer bottom nav & bottom sheet */
	.bw-bottom-nav        { display: flex; }
	.bw-bottom-sheet      { display: block; }
	.bw-sheet-overlay     { display: block; }

}
