/*
 * CRYOFAST PLUNGE — mobile-nav.css
 * Menu burger « ultra luxe » avec sous-panneaux glissants (drill-down iOS).
 * §6.3 du cahier des charges.
 */

/* --- Burger button : masqué en desktop, visible sous 900px ----------- */

.cf-burger {
	display: none;
	width: 36px;
	height: 36px;
	margin-left: 6px;
	padding: 0;
	background: none;
	border: 1px solid var(--bsand);
	border-radius: var(--btn-radius);
	position: relative;
	cursor: pointer;
	font-family: var(--font-body);
	transition: border-color .15s;
}
.cf-burger:hover { border-color: var(--charcoal); }
.cf-burger span {
	position: absolute;
	left: 9px;
	width: 18px;
	height: 1.6px;
	background: var(--charcoal);
	border-radius: 1px;
	transition: transform .3s cubic-bezier(.4,0,.2,1), top .3s cubic-bezier(.4,0,.2,1), opacity .2s;
}
.cf-burger span:nth-child(1) { top: 11px; }
.cf-burger span:nth-child(2) { top: 17px; }
.cf-burger span:nth-child(3) { top: 23px; }

.cf-burger.is-open span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.cf-burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.cf-burger.is-open span:nth-child(3) { top: 17px; transform: rotate(-45deg); }

/* --- Overlay derrière le panneau ------------------------------------- */

.cf-nav-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 18, 16, .45);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 998;
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s cubic-bezier(.4,0,.2,1);
}
.cf-nav-overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}

/* --- Panneau plein écran glissant depuis la droite ------------------- */

.cf-nav-mobile {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(88vw, 420px);
	background: var(--cream);
	z-index: 999;
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.4,0,.2,1);
	display: flex;
	flex-direction: column;
	box-shadow: -20px 0 60px rgba(20, 18, 16, .18);
	overflow: hidden;
}
.cf-nav-mobile.is-open { transform: translateX(0); }

/* En-tête du panneau (retour, titre, fermer). Opaque, z-index garanti supérieur
   aux panneaux pour éviter tout rognage du 1er item sous la barre. */
.cf-nav-mobile-header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--bsand);
	background: var(--cream);
	min-height: 64px;
	position: relative;
	z-index: 2;
}
.cf-nav-back,
.cf-nav-close {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--charcoal);
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 500;
	padding: 8px 10px;
	border-radius: var(--btn-radius);
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: background .15s, opacity .25s;
	min-height: 44px;
}
.cf-nav-back:hover,
.cf-nav-close:hover { background: var(--sand); }
.cf-nav-back {
	opacity: 0;
	pointer-events: none;
	transform: translateX(-6px);
	transition: opacity .25s ease, transform .25s ease, background .15s;
}
.cf-nav-mobile.is-drilled .cf-nav-back {
	opacity: 1;
	pointer-events: auto;
	transform: translateX(0);
}
.cf-nav-mobile-title {
	font-family: var(--font-titles);
	font-size: 18px;
	font-weight: 400;
	letter-spacing: -.2px;
	color: var(--charcoal);
}

/* Stack de panneaux : racine + sous-panneaux */
.cf-nav-stack {
	flex: 1;
	position: relative;
	overflow: hidden;
}
.cf-nav-panel {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: var(--cream);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.4,0,.2,1);
	visibility: hidden;
}
.cf-nav-panel.is-active {
	transform: translateX(0);
	visibility: visible;
}
.cf-nav-panel-root.is-active { transform: translateX(0); }
.cf-nav-panel-root.is-stacked {
	transform: translateX(-20%);
	visibility: visible;
}

/* Liste de liens. Le padding-top généreux garantit qu'aucun 1er item ne soit
   rogné sous la barre titre du panneau, à tous les niveaux (racine + sub). */
.cf-nav-list {
	list-style: none;
	margin: 0;
	padding: 18px 0 10px;
	flex: 1 0 auto;
}
.cf-nav-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 16px 22px;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--bsand);
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 500;
	color: var(--charcoal);
	cursor: pointer;
	text-align: left;
	transition: background .15s, color .15s;
	min-height: 56px;
}
.cf-nav-item:hover,
.cf-nav-item:focus-visible { background: var(--sand); outline: none; }
.cf-nav-item-drill .cf-nav-chevron { color: var(--taupe); flex-shrink: 0; }

/* Sous-liens enrichis (dropdown_liens / dropdown_produits) */
.cf-nav-sublink {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 22px;
	color: var(--charcoal);
	border-bottom: 1px solid var(--bsand);
	transition: background .15s;
	min-height: 64px;
}
.cf-nav-sublink:hover,
.cf-nav-sublink:focus-visible { background: var(--sand); outline: none; }
.cf-nav-thumb {
	flex-shrink: 0;
	width: 56px;
	height: 44px;
	border-radius: 5px;
	background: var(--sand2);
	border: 1px solid var(--bsand);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.cf-nav-thumb img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
}
.cf-nav-sublink-text { flex: 1; min-width: 0; }
.cf-nav-sublink-title {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: var(--charcoal);
}
.cf-nav-sublink-subtitle {
	display: block;
	font-size: 11px;
	color: var(--warm-gray);
	margin-top: 2px;
}

/* Bas du panneau racine */
.cf-nav-bottom {
	flex-shrink: 0;
	padding: 18px 22px 22px;
	border-top: 1px solid var(--bsand);
	background: var(--sand);
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.cf-nav-cta {
	display: block;
	text-align: center;
	width: 100%;
	padding: 14px;
	font-size: 13px;
	letter-spacing: .4px;
	min-height: 48px;
}
.cf-nav-cart,
.cf-nav-phone {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--charcoal);
	font-size: 13px;
	font-weight: 500;
	padding: 10px 4px;
	border-bottom: 1px solid var(--bsand);
	min-height: 44px;
}
.cf-nav-cart svg,
.cf-nav-phone svg { color: var(--taupe); flex-shrink: 0; }
.cf-nav-cart:hover svg,
.cf-nav-phone:hover svg { color: var(--charcoal); }
.cf-nav-cart-count { color: var(--taupe); font-weight: 400; }

.cf-nav-socials {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 4px;
}
.cf-nav-social {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	border: 1px solid var(--bsand);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--taupe);
	background: var(--white);
	transition: border-color .15s, color .15s;
}
.cf-nav-social:hover { border-color: var(--charcoal); color: var(--charcoal); }

.cf-nav-signature {
	font-size: 9px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--taupe);
	text-align: center;
	margin-top: 8px;
	font-weight: 500;
}

/* --- Body scroll lock pendant l'ouverture du panneau ----------------- */

body.cf-nav-locked { overflow: hidden; }

/* --- Visibilité par breakpoint --------------------------------------- */

@media (max-width: 900px) {
	.cf-burger { display: inline-flex; align-items: center; justify-content: center; }

	/* On masque nav desktop : dropdowns, liens, CTA shop, mais on garde la cart. */
	header > nav > .ni,
	header > nav > .nl,
	header > nav > .shop-cta { display: none !important; }

	header > nav { gap: 4px; }
}

@media (min-width: 901px) {
	/* Sécurité : le panneau mobile et son overlay ne doivent jamais s'afficher en desktop. */
	.cf-nav-mobile,
	.cf-nav-overlay { display: none !important; }
}

/* --- Respect de prefers-reduced-motion ------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.cf-nav-mobile,
	.cf-nav-overlay,
	.cf-nav-panel,
	.cf-nav-panel-root,
	.cf-burger span,
	.cf-nav-back { transition: none !important; }
}
