/* ===== Menu mobile modal CCIGR ===== */
:root {
	--mm-color: #171b22;
	--mm-muted: #5d6470;
	--mm-bg: #ffffff;
	--mm-red: #d8213a;
	--mm-orange: #f26b21;
	--mm-accent: var(--mm-red);
	--mm-tint: #fff4f1;
	--mm-border: #eeeeee;
	--mm-grad: linear-gradient(90deg, var(--mm-red), var(--mm-orange));
	--mm-duration: .5s;
	--mm-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Bouton hamburger ---------- */
.mobile-menu-toggle {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 10px;
	background: transparent;
	border: 0;
	cursor: pointer;
}
.mobile-menu-toggle__bar {
	display: block;
	width: 100%;
	height: 3px;
	background: var(--mm-color);
	border-radius: 2px;
}

/* ---------- Modale plein écran ---------- */
#mobile-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0s linear var(--mm-duration);
}
#mobile-modal.is-open {
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}

#mobile-modal .mobile-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(23, 27, 34, .55);
	opacity: 0;
	transition: opacity var(--mm-duration) ease;
}
#mobile-modal.is-open .mobile-modal__backdrop {
	opacity: 1;
}

#mobile-modal .mobile-modal__panel {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	background:
		radial-gradient(120% 60% at 50% -10%, var(--mm-tint) 0%, rgba(255, 244, 241, 0) 70%),
		var(--mm-bg);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	opacity: 0;
	transform: translateY(-24px) scale(.98);
	transition: opacity var(--mm-duration) ease,
		transform var(--mm-duration) var(--mm-ease);
}
#mobile-modal.is-open .mobile-modal__panel {
	opacity: 1;
	transform: none;
}

/* Barre de marque en haut */
#mobile-modal .mobile-modal__panel::before {
	content: "";
	position: sticky;
	top: 0;
	z-index: 3;
	flex: 0 0 5px;
	height: 5px;
	background: var(--mm-grad);
}

/* ---------- En-tête : logo centré + X ---------- */
#mobile-modal .mobile-modal__top {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	padding: 26px 64px 18px;
}
#mobile-modal .mobile-modal__top a {
	display: block;
	line-height: 0;
}
#mobile-modal .mobile-modal__logo {
	display: block;
	width: 190px;
	max-width: 100%;
	height: auto;
	max-height: none;
	margin: 0 auto;
}

#mobile-modal .mobile-modal__close {
	position: absolute;
	top: 50%;
	right: 14px;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid var(--mm-border);
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(23, 27, 34, .08);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background .2s ease, border-color .2s ease;
}
#mobile-modal .mobile-modal__close:hover,
#mobile-modal .mobile-modal__close:focus-visible {
	border-color: var(--mm-red);
	outline: none;
}
#mobile-modal .mobile-modal__close span {
	position: absolute;
	top: 50%;
	left: 13px;
	right: 13px;
	height: 2.5px;
	margin-top: -1.25px;
	background: var(--mm-color);
	border-radius: 2px;
	transform: rotate(45deg);
	transition: transform .4s var(--mm-ease), background .2s ease;
}
#mobile-modal .mobile-modal__close span:last-child {
	transform: rotate(-45deg);
}
#mobile-modal.is-open .mobile-modal__close:hover span { background: var(--mm-red); }
#mobile-modal.is-open .mobile-modal__close:hover span:first-child { transform: rotate(135deg); }
#mobile-modal.is-open .mobile-modal__close:hover span:last-child  { transform: rotate(45deg); }

/* ---------- Navigation ---------- */
#mobile-modal .mobile-nav {
	flex: 0 0 auto;
	width: 100%;
	max-width: 460px;
	margin: 0 auto;
	padding: 4px 24px 8px;
	background: transparent;
	border: 0;
	text-align: center;
}

/* Neutralise les styles du thème (menu horizontal, float, flex, etc.) */
#mobile-modal .mobile-nav ul {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	list-style: none;
	background: transparent;
	border: 0;
	float: none;
	position: static;
}

#mobile-modal .mobile-nav li {
	position: relative;
	display: block;
	float: none;
	width: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	text-align: center;
}
#mobile-modal .mobile-nav > ul > li {
	border-bottom: 1px solid var(--mm-border);
}
#mobile-modal .mobile-nav li::before,
#mobile-modal .mobile-nav li::after {
	display: none;
}

#mobile-modal .mobile-nav a {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 17px 52px;
	background: transparent;
	color: var(--mm-color);
	font-size: 1.28rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: .005em;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	border: 0;
	-webkit-tap-highlight-color: transparent;
	transition: color .2s ease, background .2s ease;
}
#mobile-modal .mobile-nav a:hover,
#mobile-modal .mobile-nav a:focus-visible,
#mobile-modal .mobile-nav a:active {
	color: var(--mm-red);
	outline: none;
}
#mobile-modal .mobile-nav .current-menu-item > a,
#mobile-modal .mobile-nav .current-menu-ancestor > a {
	color: var(--mm-red);
}

/* Petit point de marque sur la page courante */
#mobile-modal .mobile-nav > ul > .current-menu-item > a::before,
#mobile-modal .mobile-nav > ul > .current-menu-ancestor > a::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 10px 2px -17px;
	border-radius: 50%;
	background: var(--mm-grad);
	vertical-align: middle;
}

/* « Devenir membre » est déjà un bouton dans le pied de modale */
#mobile-modal .mobile-nav li:has(> a[href*="devenir-membre-ccigr"]) {
	display: none;
}

/* Apparition en cascade des items de premier niveau */
#mobile-modal .mobile-nav > ul > li {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .35s ease, transform .55s var(--mm-ease);
}
#mobile-modal.is-open .mobile-nav > ul > li {
	opacity: 1;
	transform: none;
	transition-delay: calc(.14s + var(--i, 0) * 45ms);
}

/* ---------- Sous-menus ---------- */
#mobile-modal .mobile-nav .sub-menu {
	position: static;
	display: block;
	width: auto;
	min-width: 0;
	max-height: 0;
	margin: 0 6px;
	padding: 0;
	overflow: hidden;
	opacity: 1;
	visibility: visible;
	transform: none;
	background: var(--mm-tint);
	border: 0;
	border-radius: 14px;
	box-shadow: none;
	transition: max-height .45s var(--mm-ease), margin .3s ease, padding .3s ease;
}
#mobile-modal .mobile-nav .menu-item-has-children.is-open > .sub-menu {
	max-height: 80vh;
	margin: 0 6px 14px;
	padding: 6px 0;
}
#mobile-modal .mobile-nav .sub-menu li {
	border: 0;
}
#mobile-modal .mobile-nav .sub-menu a {
	padding: 12px 22px;
	color: var(--mm-muted);
	font-size: 1.02rem;
	font-weight: 500;
}
#mobile-modal .mobile-nav .sub-menu a:hover,
#mobile-modal .mobile-nav .sub-menu a:focus-visible {
	color: var(--mm-red);
}

/* Flèche (à droite de la ligne) */
#mobile-modal .mobile-nav__sub-toggle {
	position: absolute;
	top: 8px;
	right: 0;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	background: var(--mm-tint);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background .25s ease;
}
#mobile-modal .mobile-nav__sub-toggle::after {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin: -3px auto 0;
	border-right: 2.5px solid var(--mm-red);
	border-bottom: 2.5px solid var(--mm-red);
	transform: rotate(45deg);
	transition: transform .35s var(--mm-ease), border-color .25s ease;
}
#mobile-modal .is-open > .mobile-nav__sub-toggle {
	background: var(--mm-red);
}
#mobile-modal .is-open > .mobile-nav__sub-toggle::after {
	border-color: #fff;
	transform: translateY(4px) rotate(-135deg);
}

/* ---------- Pied de modale ---------- */
#mobile-modal .mobile-modal__footer {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	max-width: 460px;
	margin: auto auto 0;
	padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
	text-align: center;
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .4s ease, transform .6s var(--mm-ease);
}
#mobile-modal.is-open .mobile-modal__footer {
	opacity: 1;
	transform: none;
	transition-delay: .55s;
}

#mobile-modal .mm-btn {
	display: block;
	width: 100%;
	padding: 15px 20px;
	border-radius: 999px;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: transform .2s ease, box-shadow .25s ease, background .2s ease, color .2s ease;
	-webkit-tap-highlight-color: transparent;
}
#mobile-modal .mm-btn--primary {
	background: var(--mm-grad);
	color: #fff;
	box-shadow: 0 8px 20px rgba(216, 33, 58, .28);
}
#mobile-modal .mm-btn--primary:active {
	transform: scale(.98);
	box-shadow: 0 4px 12px rgba(216, 33, 58, .28);
}
#mobile-modal .mm-btn--ghost {
	background: #fff;
	color: var(--mm-color);
	border: 2px solid var(--mm-color);
	padding: 13px 20px;
}
#mobile-modal .mm-btn--ghost:hover,
#mobile-modal .mm-btn--ghost:focus-visible {
	background: var(--mm-color);
	color: #fff;
}

#mobile-modal .mm-address {
	margin: 10px 0 0;
	color: var(--mm-muted);
	font-size: .92rem;
	line-height: 1.5;
}

#mobile-modal .mm-contact {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
}
#mobile-modal .mm-contact li {
	margin: 0;
	padding: 0;
	list-style: none;
}
#mobile-modal .mm-contact a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: var(--mm-tint);
	border-radius: 50%;
	transition: background .2s ease, transform .2s ease;
}
#mobile-modal .mm-contact a:hover,
#mobile-modal .mm-contact a:focus-visible {
	background: var(--mm-red);
}
#mobile-modal .mm-contact svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--mm-red);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke .2s ease;
}
#mobile-modal .mm-contact a:hover svg,
#mobile-modal .mm-contact a:focus-visible svg {
	stroke: #fff;
}

/* ---------- Divers ---------- */
body.mobile-menu-open {
	overflow: hidden;
}
/* Cache la pastille CookieYes pendant que le menu est ouvert */
body.mobile-menu-open .cky-btn-revisit-wrapper {
	display: none !important;
}

/* Petits écrans en hauteur */
@media (max-height: 640px) {
	#mobile-modal .mobile-nav a { padding-top: 13px; padding-bottom: 13px; font-size: 1.15rem; }
	#mobile-modal .mobile-modal__top { padding-top: 18px; padding-bottom: 10px; }
}

/* Respect de "réduire les animations" */
@media (prefers-reduced-motion: reduce) {
	#mobile-modal,
	#mobile-modal .mobile-modal__backdrop,
	#mobile-modal .mobile-modal__panel,
	#mobile-modal .mobile-nav > ul > li,
	#mobile-modal .mobile-nav .sub-menu,
	#mobile-modal .mobile-modal__footer {
		transition-duration: .01s !important;
		transition-delay: 0s !important;
	}
}

/* Jamais visible sur desktop */
@media (min-width: 768px) {
	.mobile-menu-toggle,
	#mobile-modal {
		display: none !important;
	}
}