/**
 * Math-Universe — Cookies
 * Systeme visuel : jaune #FFCE43, encre #52555A/#212121 sur #F9FBFF,
 * Source Sans 3, media a bord courbe, boutons segmentes, animations "wow"
 * d'ouverture/fermeture, pastille flottante animee (facon notification).
 * Contenu (photo, mascotte, textes) = Math-Universe. Prefixe .mu-cc.
 * Proprietes de texte + boutons en !important (kit Elementor / bleed theme).
 */

.mu-cc,
.mu-cc *,
.mu-cc *::before,
.mu-cc *::after,
.mu-cc__fab,
.mu-cc__fab * {
	box-sizing: border-box;
}

.mu-cc {
	--y: #FFCE43;
	--y-d: #F2BE2E;
	--ink: #52555A;
	--ink-strong: #212121;
	--bg: #F9FBFF;
	--muted: #67696f;
	--track-off: rgba(138,142,148,0.28);
	--line: rgba(138,142,148,0.22);

	position: fixed;
	left: 20px;
	bottom: 24px;
	z-index: 999990;
	width: 408px;
	max-width: calc(100vw - 40px);
	font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--ink);
}

.mu-cc[hidden] { display: none; }

.mu-cc__card {
	display: flex;
	flex-direction: column;
	background: var(--bg);
	border-radius: 14px;
	overflow: hidden;
	max-height: calc(100vh - 48px);
	box-shadow: 0 18px 50px rgba(30, 30, 40, 0.22), 0 4px 14px rgba(30, 30, 40, 0.12);
	transform-origin: bottom left;
	animation: mu-cc-in 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

/* Ouverture "wow" : monte + grossit legerement + fondu. */
@keyframes mu-cc-in {
	0%   { opacity: 0; transform: translateY(34px) scale(0.94); }
	100% { opacity: 1; transform: none; }
}

/* Fermeture "wow" : descend + retrecit + fondu. */
.mu-cc--out .mu-cc__card {
	animation: mu-cc-out 0.42s cubic-bezier(0.4, 0, 1, 0.7) both;
}

@keyframes mu-cc-out {
	0%   { opacity: 1; transform: none; }
	100% { opacity: 0; transform: translateY(28px) scale(0.92); }
}

.mu-cc__main { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* --- Fermer (= refuser) --- */
.mu-cc__close {
	position: absolute;
	top: 9px;
	right: 10px;
	z-index: 4;
	width: 30px !important;
	height: 30px !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.9) !important;
	border: 0 !important;
	border-radius: 50% !important;
	box-shadow: 0 2px 6px rgba(0,0,0,.18) !important;
	color: var(--ink-strong) !important;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.mu-cc__close:hover { background: #fff !important; transform: rotate(90deg); }
.mu-cc__close svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.3; fill: none; stroke-linecap: round; }

/* --- Barre d'en-tete jaune : logo agrandi, sans texte (plus de collision avec X) --- */
.mu-cc__brand {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	height: 52px;
	padding: 0 52px 0 18px; /* reserve la place du bouton fermer a droite */
	background: var(--y);
}

.mu-cc__logo { height: 34px; width: auto; max-width: 210px; object-fit: contain; }

/* --- Media (photo) + vague + mascotte --- */
.mu-cc__media {
	position: relative;
	flex: 0 0 auto;
	height: 168px;
	background: var(--y);
}

.mu-cc__photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.mu-cc__wave {
	position: absolute;
	left: 0; right: 0; bottom: -1px;
	width: 100%; height: 38px;
	display: block;
}

.mu-cc__mascot {
	position: absolute;
	right: 20px; bottom: -20px;
	width: 72px; height: 72px;
	z-index: 2;
	filter: drop-shadow(0 6px 10px rgba(120, 80, 20, 0.3));
	animation: mu-cc-bounce 0.9s ease 0.35s both;
	transform-origin: 50% 100%;
}

.mu-cc__mascot svg { width: 100%; height: 100%; display: block; }

@keyframes mu-cc-bounce {
	0%   { transform: translateY(40px); opacity: 0; }
	45%  { transform: translateY(-14px); opacity: 1; }
	62%  { transform: translateY(-3px) scaleY(0.9); }
	80%  { transform: translateY(-7px); }
	100% { transform: translateY(0); }
}

/* --- Contenu (scrollable) --- */
.mu-cc__content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 12px 22px 18px;
}

.mu-cc__hi {
	margin: 0 0 2px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--muted) !important;
}

.mu-cc__title {
	margin: 0 0 8px !important;
	font-size: clamp(19px, 4.4vw, 21px) !important;
	font-weight: 800 !important;
	line-height: 1.18 !important;
	color: var(--ink) !important;
}

.mu-cc__text { margin: 0 !important; font-size: 14px !important; line-height: 1.5 !important; color: var(--ink) !important; }
.mu-cc__text p { margin: 0 0 7px !important; }
.mu-cc__text p:last-child { margin-bottom: 0 !important; }
.mu-cc__text strong { font-weight: 700; }

/* --- Detail / categories --- */
.mu-cc__detail[hidden] { display: none; }

.mu-cc__cats {
	list-style: none;
	margin: 14px 0 2px;
	padding: 0;
	border-top: 1px solid var(--line);
	animation: mu-cc-reveal 0.35s ease-out both;
}

@keyframes mu-cc-reveal {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: none; }
}

.mu-cc__cat {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
}

.mu-cc__cat-ic { flex: 0 0 40px; width: 40px; height: 40px; }
.mu-cc__cat-ic svg { width: 100%; height: 100%; display: block; }

.mu-cc__cat-txt { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.mu-cc__cat-title { display: block; font-size: 13.5px !important; font-weight: 700 !important; color: var(--ink) !important; }
.mu-cc__cat-desc { display: block; margin-top: 2px; font-size: 12px !important; line-height: 1.4 !important; color: var(--muted) !important; }

/* --- Interrupteur (44x25) --- */
.mu-cc__switch { position: relative; flex: 0 0 44px; width: 44px; height: 25px; }
.mu-cc__switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.mu-cc__switch > span { position: absolute; inset: 0; background: var(--track-off); border-radius: 12.5px; transition: background 0.25s ease; }
.mu-cc__switch > span::after {
	content: ""; position: absolute; top: 4px; left: 4px; width: 17px; height: 17px;
	background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.28);
	transition: transform 0.25s ease;
}
.mu-cc__switch input:checked + span,
.mu-cc__switch--on > span { background: var(--y); }
.mu-cc__switch input:checked + span::after,
.mu-cc__switch--on > span::after { transform: translateX(19px); }
.mu-cc__switch--on { opacity: 0.65; }

/* --- Boutons segmentes --- */
.mu-cc__actions {
	display: flex;
	margin-top: 16px;
	border-radius: 9px;
	overflow: hidden;
	box-shadow: 0 0 0 1px var(--line);
}

.mu-cc__btn {
	flex: 1 1 0;
	min-width: 0;
	height: 44px;
	padding: 0 8px !important;
	border: 0 !important;
	border-right: 1px solid var(--line) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 14.5px !important;
	font-weight: 700 !important;
	line-height: 1.1 !important;
	color: var(--ink-strong) !important;
	background: #fff !important;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.18s ease;
}

.mu-cc__btn:last-child { border-right: 0 !important; }
.mu-cc__btn--refuse:hover,
.mu-cc__btn--link:hover { background: #f2f3f5 !important; }
.mu-cc__btn--primary { background: var(--y) !important; }
.mu-cc__btn--primary:hover { background: var(--y-d) !important; }

/* --- Lien politique --- */
.mu-cc__policy { margin: 12px 0 0; text-align: center; font-size: 12px; }
.mu-cc__policy a { color: var(--muted); text-decoration: underline; }
.mu-cc__policy a:hover { color: var(--ink); }

/* --- Message de remerciement --- */
.mu-cc__thanks { text-align: center; padding: 28px 18px 24px; }
.mu-cc__thanks[hidden] { display: none; }
.mu-cc__thanks-ic { display: inline-block; width: 74px; height: 74px; animation: mu-cc-bounce 0.8s ease both; }
.mu-cc__thanks-ic svg { width: 100%; height: 100%; display: block; }
.mu-cc__thanks-txt { margin: 12px 0 0 !important; font-size: 15px !important; line-height: 1.5 !important; color: var(--ink) !important; }

.mu-cc__card.is-thanks .mu-cc__main { display: none; }
.mu-cc__card.is-thanks .mu-cc__close { display: none !important; } /* bat le display:flex!important de la croix */
.mu-cc__card.is-thanks .mu-cc__thanks { display: block; }

/* Pendant l'animation de sortie : plus aucune interaction (evite les races). */
.mu-cc--out .mu-cc__card { pointer-events: none; }

/* ================================================================
   PASTILLE FLOTTANTE (bas-gauche) — visible tant que le choix n'est
   pas "tout accepter". Animee facon notification en attente.
   ================================================================ */
.mu-cc__fab {
	position: fixed;
	left: 20px;
	bottom: 22px;
	z-index: 999989;
	width: 58px !important;
	height: 58px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--y) !important;
	box-shadow: 0 8px 22px rgba(210, 150, 20, 0.4) !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	animation: mu-cc-fab-in 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.mu-cc__fab[hidden] { display: none !important; }

.mu-cc__fab:hover { background: var(--y-d) !important; }

/* Halo pulsant facon notification. */
.mu-cc__fab::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(255, 206, 67, 0.55);
	animation: mu-cc-pulse 2.2s ease-out infinite;
}

@keyframes mu-cc-fab-in {
	0%   { opacity: 0; transform: scale(0); }
	60%  { transform: scale(1.15); }
	100% { opacity: 1; transform: scale(1); }
}

@keyframes mu-cc-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 206, 67, 0.55); }
	70%  { box-shadow: 0 0 0 16px rgba(255, 206, 67, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 206, 67, 0); }
}

/* Mascotte : petit tremblement periodique (attire l'attention). */
.mu-cc__fab-mascot {
	display: block;
	width: 40px;
	height: 40px;
	position: relative;
	z-index: 1;
	transform-origin: 50% 80%;
	animation: mu-cc-wiggle 5s ease-in-out 1.5s infinite;
}
.mu-cc__fab-mascot svg { width: 100%; height: 100%; display: block; }

@keyframes mu-cc-wiggle {
	0%, 84%, 100% { transform: rotate(0); }
	88% { transform: rotate(-9deg); }
	92% { transform: rotate(9deg); }
	96% { transform: rotate(-5deg); }
}

/* Badge "!" rouge-orange qui rebondit. */
.mu-cc__fab-badge {
	position: absolute;
	top: -2px; right: -2px;
	z-index: 2;
	min-width: 20px; height: 20px;
	padding: 0 4px;
	display: flex; align-items: center; justify-content: center;
	background: #EE5A3A;
	color: #fff;
	font-size: 12px; font-weight: 800; line-height: 1;
	border-radius: 10px;
	border: 2px solid var(--y);
	box-shadow: 0 1px 3px rgba(0,0,0,.25);
	animation: mu-cc-badge 2.2s ease-in-out infinite;
}

@keyframes mu-cc-badge {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-3px); }
}

/* --- Responsive : bottom-sheet en mobile (<450px) --- */
@media (max-width: 449.98px) {
	.mu-cc {
		left: 10px; right: 10px; bottom: 10px;
		width: auto; max-width: none;
	}
	.mu-cc__card { max-height: 82vh; max-height: 82dvh; }
	.mu-cc__media { height: 140px; }
	.mu-cc__brand { height: 48px; }
	.mu-cc__logo { height: 30px; }
	.mu-cc__title { font-size: 20px !important; }
	.mu-cc__fab { left: 14px; bottom: 14px; }
}

/* --- Mouvement reduit --- */
@media (prefers-reduced-motion: reduce) {
	.mu-cc__card,
	.mu-cc--out .mu-cc__card,
	.mu-cc__cats,
	.mu-cc__mascot,
	.mu-cc__thanks-ic,
	.mu-cc__fab,
	.mu-cc__fab::after,
	.mu-cc__fab-mascot,
	.mu-cc__fab-badge { animation: none; }
}

/* --- Mode sombre systeme --- */
@media (prefers-color-scheme: dark) {
	.mu-cc__card { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.4); }
}
