/*
 * Bandeau et fenêtre de gestion des cookies — couleurs de la charte CHP 2024
 * (reprend les variables du thème chp-perpignan, avec valeurs de repli).
 */
.chp-cookies,
.chp-cookies-fenetre {
	--chp-ck-marine: var(--chp-marine, #023059);
	--chp-ck-turquoise: var(--chp-turquoise-web, #167A74);
	--chp-ck-jaune: var(--chp-jaune, #94C11F);
	--chp-ck-fond: var(--chp-fond, #F2F6F9);
	--chp-ck-gris: var(--chp-gris-texte, #5E5E5D);
	--chp-ck-lisere: linear-gradient(90deg, #19857E 0 34%, #94C11F 34% 60%, #66CC99 60% 84%, #F07166 84% 100%);
	font-family: inherit;
}

/* ---------- Bandeau ---------- */
.chp-cookies {
	background: var(--chp-ck-lisere) top / 100% 4px no-repeat, var(--chp-ck-marine);
	bottom: 0;
	box-shadow: 0 -10px 30px rgba(2, 48, 89, 0.25);
	color: #fff;
	left: 0;
	padding: 1.1rem 1.25rem 1rem;
	position: fixed;
	right: 0;
	transform: translateY(110%);
	transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
	z-index: 100000;
}

.chp-cookies.is-visible {
	transform: none;
}

.chp-cookies[hidden] {
	display: none;
}

.chp-cookies__contenu {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem 2rem;
	margin: 0 auto;
	max-width: 1200px;
}

.chp-cookies__texte {
	color: #fff;
	flex: 1 1 32rem;
	font-size: 0.95rem;
	line-height: 1.55;
	margin: 0;
}

.chp-cookies__texte a {
	color: #fff;
	font-weight: 700;
	text-decoration: underline;
}

.chp-cookies__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

/* ---------- Boutons ---------- */
.chp-cookies__bouton {
	align-items: center;
	border: 2px solid transparent;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	gap: 0.45rem;
	justify-content: center;
	line-height: 1.2;
	min-height: 2.75rem;
	padding: 0.6rem 1.35rem;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chp-cookies__bouton:hover {
	transform: translateY(-1px);
}

.chp-cookies__bouton--principal {
	background: var(--chp-ck-jaune);
	color: var(--chp-ck-marine);
}

.chp-cookies__bouton--principal:hover {
	background: #fff;
	border-color: var(--chp-ck-jaune);
}

.chp-cookies__bouton--secondaire {
	background: transparent;
	border-color: #fff;
	color: #fff;
}

.chp-cookies__bouton--secondaire:hover {
	background: #fff;
	color: var(--chp-ck-marine);
}

.chp-cookies__bouton--lien {
	background: transparent;
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.chp-cookies__bouton--lien:hover {
	background: rgba(255, 255, 255, 0.1);
}

.chp-cookies__bouton--annuler {
	background: #E6EAEE;
	color: var(--chp-ck-marine);
}

.chp-cookies__bouton--annuler:hover {
	background: #D5DCE3;
}

.chp-cookies__bouton:focus-visible,
.chp-cookies-fenetre__fermer:focus-visible {
	outline: 3px solid var(--chp-ck-jaune);
	outline-offset: 2px;
}

.chp-cookies-fenetre .chp-cookies__bouton:focus-visible,
.chp-cookies-fenetre__fermer:focus-visible,
.chp-cookies-interrupteur:focus-visible {
	outline-color: var(--chp-ck-turquoise);
}

/* ---------- Fenêtre « En savoir plus » ---------- */
.chp-cookies-fenetre {
	background: #fff;
	border: 0;
	border-radius: 18px;
	box-shadow: 0 30px 70px rgba(2, 48, 89, 0.35);
	color: var(--chp-ck-marine);
	max-height: calc(100vh - 2rem);
	max-width: min(46rem, calc(100vw - 2rem));
	overflow: auto;
	padding: 0;
	width: 100%;
}

.chp-cookies-fenetre::backdrop {
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	background: rgba(2, 48, 89, 0.6);
}

.chp-cookies-fenetre[open] {
	animation: chp-ck-apparition 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes chp-ck-apparition {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.98);
	}
}

.chp-cookies-fenetre__corps {
	background: var(--chp-ck-lisere) top / 100% 6px no-repeat;
	padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
	position: relative;
}

.chp-cookies-fenetre__fermer {
	align-items: center;
	background: var(--chp-ck-fond);
	border: 0;
	border-radius: 50%;
	color: var(--chp-ck-marine);
	cursor: pointer;
	display: flex;
	font-size: 1.6rem;
	height: 2.75rem;
	justify-content: center;
	line-height: 1;
	position: absolute;
	right: 1rem;
	top: 1.1rem;
	width: 2.75rem;
}

.chp-cookies-fenetre__fermer:hover {
	background: #E1E8EE;
}

.chp-cookies-fenetre__titre {
	color: var(--chp-ck-marine);
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	letter-spacing: 0.02em;
	line-height: 1.2;
	margin: 0 3rem 0.9rem 0;
	text-transform: uppercase;
}

.chp-cookies-fenetre__titre::after {
	background: linear-gradient(90deg, #19857E 0 55%, #94C11F 55% 100%);
	border-radius: 3px;
	content: "";
	display: block;
	height: 4px;
	margin-top: 0.7rem;
	width: 3.5rem;
}

.chp-cookies-fenetre__titre:focus {
	outline: none;
}

.chp-cookies-fenetre__intro {
	color: var(--chp-ck-gris);
	font-size: 0.98rem;
	line-height: 1.6;
	margin: 0 0 1.25rem;
}

.chp-cookies-fenetre__categories {
	border: 0;
	display: grid;
	gap: 0.75rem;
	margin: 0 0 1.5rem;
	padding: 0;
}

.chp-cookies-categorie {
	align-items: center;
	background: var(--chp-ck-fond);
	border-left: 4px solid var(--chp-ck-turquoise);
	border-radius: 10px;
	column-gap: 0.85rem;
	display: grid;
	grid-template-columns: auto 1fr;
	padding: 1rem 1.1rem;
}

.chp-cookies-categorie label {
	align-items: center;
	cursor: pointer;
	display: flex;
	flex-wrap: wrap;
	font-weight: 700;
	gap: 0.25rem 0.6rem;
}

.chp-cookies-categorie__nom {
	text-transform: uppercase;
	letter-spacing: 0.02em;
	font-size: 0.95rem;
}

.chp-cookies-categorie__etat {
	background: #fff;
	border-radius: 999px;
	color: var(--chp-ck-turquoise);
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.15rem 0.6rem;
}

.chp-cookies-categorie__desc {
	color: var(--chp-ck-gris);
	font-size: 0.92rem;
	grid-column: 2;
	line-height: 1.5;
	margin: 0.3rem 0 0;
}

/* Interrupteurs */
.chp-cookies-interrupteur {
	-webkit-appearance: none;
	appearance: none;
	background: #B9C2CB;
	border-radius: 999px;
	cursor: pointer;
	flex: 0 0 auto;
	height: 1.6rem;
	margin: 0;
	position: relative;
	transition: background-color 0.2s ease;
	width: 2.9rem;
}

.chp-cookies-interrupteur::after {
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	content: "";
	height: 1.2rem;
	left: 0.2rem;
	position: absolute;
	top: 0.2rem;
	transition: transform 0.2s ease;
	width: 1.2rem;
}

.chp-cookies-interrupteur:checked {
	background: var(--chp-ck-turquoise);
}

.chp-cookies-interrupteur:checked::after {
	transform: translateX(1.3rem);
}

.chp-cookies-interrupteur:disabled {
	cursor: not-allowed;
	opacity: 0.65;
}

.chp-cookies-interrupteur:focus-visible {
	outline: 3px solid var(--chp-ck-turquoise);
	outline-offset: 2px;
}

.chp-cookies-fenetre__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

.chp-cookies-fenetre__actions .chp-cookies__bouton {
	min-width: 11rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.chp-cookies-fenetre__note {
	color: var(--chp-ck-gris);
	font-size: 0.82rem;
	margin: 1.25rem 0 0;
	text-align: center;
}

.chp-cookies-fenetre__note a {
	color: var(--chp-ck-turquoise);
}

/* Mobile : boutons pleine largeur, au-dessus de la barre d'actions du thème */
@media (max-width: 600px) {
	.chp-cookies__actions {
		width: 100%;
	}

	.chp-cookies__actions .chp-cookies__bouton {
		flex: 1 1 auto;
	}

	.chp-cookies__bouton--lien {
		flex-basis: 100% !important;
		order: 3;
	}

	.chp-cookies-fenetre__actions .chp-cookies__bouton {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.chp-cookies,
	.chp-cookies__bouton,
	.chp-cookies-interrupteur,
	.chp-cookies-interrupteur::after {
		transition: none;
	}

	.chp-cookies-fenetre[open] {
		animation: none;
	}
}

@media print {
	.chp-cookies,
	.chp-cookies-fenetre {
		display: none !important;
	}
}
