/**
 * ADCOM+ Cookies - styles du bandeau.
 * Bandeau volontairement discret : barre fine, pas de voile sur la page.
 */

:root {
	--adcom-cookies-fond: #144B7B;
	--adcom-cookies-texte: #FFFFFF;
	--adcom-cookies-bouton: #FFFFFF;
	--adcom-cookies-bouton-texte: #144B7B;
}

.adcom-cookies-bandeau {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99990;
	background: var(--adcom-cookies-fond);
	color: var(--adcom-cookies-texte);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, .18);
	font-size: 14px;
	line-height: 1.45;
	transform: translateY(100%);
	transition: transform .35s ease;
}

.adcom-cookies-bandeau--bas {
	bottom: 0;
}

.adcom-cookies-bandeau--haut {
	top: 0;
	bottom: auto;
	transform: translateY(-100%);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.adcom-cookies-bandeau.est-visible {
	transform: translateY(0);
}

.adcom-cookies-bandeau__contenu {
	max-width: 1280px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.adcom-cookies-bandeau__texte {
	flex: 1 1 380px;
	margin: 0;
}

.adcom-cookies-bandeau__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.adcom-cookies-lien {
	color: inherit;
	text-decoration: underline;
}

/* Boutons */

.adcom-cookies-btn {
	font: inherit;
	cursor: pointer;
	border-radius: 4px;
	padding: 9px 18px;
	border: 1px solid transparent;
	transition: opacity .2s ease;
	white-space: nowrap;
}

.adcom-cookies-btn:hover {
	opacity: .85;
}

.adcom-cookies-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.adcom-cookies-btn--principal {
	background: var(--adcom-cookies-bouton);
	color: var(--adcom-cookies-bouton-texte);
	font-weight: 600;
}

/* Le refus doit rester aussi accessible que l acceptation (exigence CNIL). */
.adcom-cookies-btn--secondaire {
	background: transparent;
	color: var(--adcom-cookies-texte);
	border-color: currentColor;
	font-weight: 600;
}

.adcom-cookies-btn--lien {
	background: none;
	border: none;
	color: var(--adcom-cookies-texte);
	text-decoration: underline;
	padding: 9px 6px;
}

/* Modale de preferences */

.adcom-cookies-modale {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

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

.adcom-cookies-modale__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

.adcom-cookies-modale__boite {
	position: relative;
	background: #fff;
	color: #1d2327;
	border-radius: 10px;
	max-width: 780px;
	width: 100%;
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}

.adcom-cookies-modale__entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e2e4e7;
}

.adcom-cookies-modale__entete h2 {
	margin: 0;
	font-size: 20px;
}

.adcom-cookies-modale__fermer {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #50575e;
	padding: 0 4px;
}

.adcom-cookies-modale__corps {
	padding: 12px 24px;
	overflow-y: auto;
}

.adcom-cookies-modale__pied {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid #e2e4e7;
	flex-wrap: wrap;
}

.adcom-cookies-modale__pied .adcom-cookies-btn--secondaire {
	color: #144B7B;
	border-color: #144B7B;
}

.adcom-cookies-modale__pied .adcom-cookies-btn--principal {
	background: var(--adcom-cookies-fond);
	color: var(--adcom-cookies-texte);
}

/* Categories */

.adcom-cookies-categorie {
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f1;
}

.adcom-cookies-categorie:last-child {
	border-bottom: none;
}

.adcom-cookies-categorie__entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.adcom-cookies-categorie__titre {
	font-weight: 600;
	font-size: 16px;
	margin: 0;
}

.adcom-cookies-categorie__requis {
	font-size: 13px;
	color: #646970;
	font-style: italic;
}

.adcom-cookies-categorie__description {
	margin: 8px 0 0;
	font-size: 14px;
	color: #50575e;
}

/* Interrupteur */

.adcom-cookies-switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	flex: 0 0 auto;
}

.adcom-cookies-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
	z-index: 2;
}

.adcom-cookies-switch__piste {
	position: absolute;
	inset: 0;
	background: #c3c4c7;
	border-radius: 26px;
	transition: background .2s ease;
}

.adcom-cookies-switch__piste::before {
	content: "";
	position: absolute;
	width: 20px;
	height: 20px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s ease;
}

.adcom-cookies-switch input:checked + .adcom-cookies-switch__piste {
	background: var(--adcom-cookies-fond);
}

.adcom-cookies-switch input:checked + .adcom-cookies-switch__piste::before {
	transform: translateX(20px);
}

.adcom-cookies-switch input:focus-visible + .adcom-cookies-switch__piste {
	outline: 2px solid var(--adcom-cookies-fond);
	outline-offset: 2px;
}

/* Tableau des cookies */

.adcom-cookies-details {
	margin-top: 10px;
	font-size: 13px;
}

.adcom-cookies-details summary {
	cursor: pointer;
	color: #144B7B;
}

.adcom-cookies-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
	font-size: 13px;
	/* Repartition fixe : la finalite est la colonne utile, le nom tient sur peu. */
	table-layout: fixed;
}

.adcom-cookies-table th:nth-child(1),
.adcom-cookies-table td:nth-child(1) {
	width: 18%;
	word-break: break-word;
}

.adcom-cookies-table th:nth-child(2),
.adcom-cookies-table td:nth-child(2) {
	width: 16%;
}

.adcom-cookies-table th:nth-child(3),
.adcom-cookies-table td:nth-child(3) {
	width: 54%;
}

.adcom-cookies-table th:nth-child(4),
.adcom-cookies-table td:nth-child(4) {
	width: 12%;
}

.adcom-cookies-table td code {
	font-size: 12px;
	white-space: normal;
	word-break: break-all;
}

.adcom-cookies-table th,
.adcom-cookies-table td {
	border: 1px solid #e2e4e7;
	padding: 7px 9px;
	text-align: left;
	vertical-align: top;
}

.adcom-cookies-table th {
	background: #f6f7f7;
	font-weight: 600;
}

/* Pastille de rappel */

.adcom-cookies-rappel {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 99980;
	background: var(--adcom-cookies-fond);
	color: var(--adcom-cookies-texte);
	border: none;
	border-radius: 20px;
	padding: 8px 14px;
	font-size: 12px;
	cursor: pointer;
	opacity: .55;
	transition: opacity .2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.adcom-cookies-rappel:hover,
.adcom-cookies-rappel:focus-visible {
	opacity: 1;
}

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

.adcom-cookies-lien-reglages {
	background: none;
	border: none;
	padding: 0;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

/* Espace reserve des contenus bloques */

.adcom-cookies-placeholder {
	background: #f6f7f7;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
	padding: 24px;
	text-align: center;
	margin: 16px 0;
}

.adcom-cookies-placeholder__texte {
	margin: 0 0 12px;
	font-size: 14px;
	color: #50575e;
}

.adcom-cookies-placeholder__bouton {
	background: var(--adcom-cookies-fond);
	color: var(--adcom-cookies-texte);
	border: none;
	border-radius: 4px;
	padding: 9px 18px;
	cursor: pointer;
	font: inherit;
}

/* Mobile */

@media (max-width: 782px) {
	.adcom-cookies-bandeau__contenu {
		padding: 14px 16px;
		gap: 12px;
	}

	.adcom-cookies-bandeau__actions {
		width: 100%;
	}

	.adcom-cookies-bandeau__actions .adcom-cookies-btn--principal,
	.adcom-cookies-bandeau__actions .adcom-cookies-btn--secondaire {
		flex: 1 1 0;
		text-align: center;
	}

	.adcom-cookies-btn--lien {
		order: 3;
		width: 100%;
		text-align: center;
	}

	.adcom-cookies-table {
		display: block;
		overflow-x: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.adcom-cookies-bandeau,
	.adcom-cookies-switch__piste,
	.adcom-cookies-switch__piste::before {
		transition: none;
	}
}

/**
 * Coherence avec le cache de page.
 *
 * Le rendu HTML peut etre servi depuis un cache et ne pas refleter l etat reel
 * du visiteur. Le script place dans le head marque la balise html des le
 * chargement : ces deux regles corrigent le rendu avant le premier affichage.
 */
html.adcom-cookies-repondu #adcom-cookies-bandeau {
	display: none;
}

html.adcom-cookies-a-repondre #adcom-cookies-bandeau[hidden] {
	display: block;
	transform: translateY(0);
}

html.adcom-cookies-a-repondre #adcom-cookies-rappel {
	display: none;
}

/* Sans JavaScript, le bandeau reste lisible et la politique reste accessible. */
.adcom-cookies-bandeau {
	transform: translateY(100%);
}

html.adcom-cookies-a-repondre .adcom-cookies-bandeau,
.adcom-cookies-bandeau.est-visible {
	transform: translateY(0);
}

html.adcom-cookies-a-repondre .adcom-cookies-bandeau--haut,
.adcom-cookies-bandeau--haut.est-visible {
	transform: translateY(0);
}

/* Actions proposees sous un contenu externe bloque. */
.adcom-cookies-placeholder__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: center;
	margin: 12px 0 0;
}

.adcom-cookies-placeholder__lien {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	font-size: 13px;
	color: inherit;
	opacity: .75;
	text-decoration: underline;
	cursor: pointer;
}

.adcom-cookies-placeholder__lien:hover,
.adcom-cookies-placeholder__lien:focus-visible {
	opacity: 1;
}
