/* Bannière cookies (flottante en bas d'écran), fenêtre de personnalisation et message de confirmation. */

.cookies,
.cookies * {
	box-sizing: border-box;
}

.cookies__banniere {
	position: fixed;
	right: 8px;
	bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	left: 8px;
	z-index: 55;
}

.cookies__banniere[hidden],
.cookies__voile[hidden],
.cookies__message[hidden] {
	display: none;
}

.cookies__boite {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 14px 14px;
	border-radius: var(--wp--preset--border-radius--16);
	background: var(--wp--preset--color--blanc);
	box-shadow: var(--wp--preset--shadow--cookies-mobile);
}

.cookies__textes {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding: 0 2px;
}

.cookies__titre {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 19px;
	font-variation-settings: "SOFT" 100;
	line-height: 1.2;
}

.cookies__texte {
	margin: 0;
	color: var(--wp--preset--color--texte-secondaire);
	font-size: 14px;
	line-height: 1.5;
}

.cookies__texte a {
	color: var(--wp--preset--color--texte);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cookies__texte--long {
	display: none;
}

.cookies__boutons {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.cookies__bouton {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 4px;
	border: 1.5px solid var(--wp--preset--color--bleu);
	border-radius: var(--wp--preset--border-radius--pilule);
	background: var(--wp--preset--color--bleu);
	color: var(--wp--preset--color--blanc);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

/* Aperçu dans l'éditeur : dans le flux de la page. */
.cookies--apercu .cookies__boite {
	position: static;
}

/* Fenêtre « Personnaliser mes cookies ». */
.cookies__voile {
	position: fixed;
	inset: 0;
	z-index: 70;
	display: grid;
	place-items: end center;
	background: var(--wp--custom--couleur--voile-fenetre);
}

.cookies__fenetre {
	display: flex;
	flex-direction: column;
	gap: 20px;
	box-sizing: border-box;
	width: 100%;
	max-width: 640px;
	max-height: 92vh;
	padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0px));
	overflow-y: auto;
	border-radius: 20px 20px 0 0;
	background: var(--wp--preset--color--blanc);
	box-shadow: var(--wp--preset--shadow--fenetre);
}

.cookies__entete {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
}

.cookies__entete > div {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cookies__fenetre-titre {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 24px;
	font-variation-settings: "SOFT" 100;
	line-height: 1.1;
}

.cookies__fenetre-texte {
	margin: 0;
	color: var(--wp--preset--color--texte-secondaire);
	font-size: 14px;
	line-height: 1.6;
}

.cookies__fermer {
	display: grid;
	flex: none;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--beton);
	border-radius: 50%;
	background: var(--wp--preset--color--blanc);
	cursor: pointer;
}

.cookies__fermer::before {
	content: "";
	width: 18px;
	height: 18px;
	background: var(--wp--preset--color--texte);
	-webkit-mask: url(../../assets/images/icones/fermer.svg) center / contain no-repeat;
	mask: url(../../assets/images/icones/fermer.svg) center / contain no-repeat;
}

.cookies__finalites {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--wp--custom--couleur--separateur);
}

.cookies__finalite {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 20px;
	padding: 16px 0;
	border-bottom: 1px solid var(--wp--custom--couleur--separateur);
}

.cookies__finalite > div {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.cookies__finalite-titre {
	font-size: 15px;
	font-weight: 600;
}

.cookies__finalite-texte {
	color: var(--wp--preset--color--texte-secondaire);
	font-size: 13px;
	line-height: 1.5;
}

.cookies__toujours {
	color: var(--wp--preset--color--bleu);
	font-size: 12px;
	font-weight: 600;
}

.cookies__interrupteur {
	display: grid;
	place-items: center;
	width: 54px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.cookies__interrupteur span {
	position: relative;
	display: block;
	width: 50px;
	height: 30px;
	border-radius: var(--wp--preset--border-radius--pilule);
	background: var(--wp--custom--couleur--bordure);
	transition: background var(--wp--custom--transition--rapide);
}

.cookies__interrupteur span::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--wp--preset--color--blanc);
	box-shadow: var(--wp--preset--shadow--interrupteur);
	transition: transform var(--wp--custom--transition--rapide);
}

.cookies__interrupteur[aria-checked="true"] span {
	background: var(--wp--preset--color--bleu);
}

.cookies__interrupteur[aria-checked="true"] span::after {
	transform: translateX(20px);
}

.cookies__boutons--fenetre {
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}

.cookies__boutons--fenetre .cookies__bouton {
	height: 50px;
	font-size: 14px;
}

/* Message de confirmation. */
.cookies__message {
	position: fixed;
	right: 16px;
	bottom: 16px;
	left: 16px;
	z-index: 56;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	border-radius: var(--wp--preset--border-radius--12);
	background: var(--wp--preset--color--texte);
	box-shadow: var(--wp--preset--shadow--message);
	color: var(--wp--preset--color--blanc);
	font-size: 14px;
}

.cookies__message::before {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	background: var(--wp--preset--color--blanc);
	-webkit-mask: url(../../assets/images/icones/coche.svg) center / contain no-repeat;
	mask: url(../../assets/images/icones/coche.svg) center / contain no-repeat;
}

@media (min-width: 768px) {
	.cookies__banniere {
		right: 24px;
		bottom: 24px;
		left: 24px;
		display: flex;
		justify-content: center;
		pointer-events: none;
	}

	.cookies__banniere .cookies__boite {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 18px 32px;
		width: 100%;
		max-width: 1200px;
		padding: 24px 30px;
		border-radius: var(--wp--preset--border-radius--18);
		box-shadow: var(--wp--preset--shadow--cookies);
		pointer-events: auto;
	}

	.cookies__banniere .cookies__textes {
		flex: 1 1 520px;
		gap: 6px;
		padding: 0;
	}

	.cookies__titre {
		font-size: 22px;
		line-height: normal;
	}

	.cookies__texte {
		max-width: 700px;
		line-height: 1.6;
	}

	.cookies__texte--long {
		display: block;
	}

	.cookies__texte--court {
		display: none;
	}

	.cookies__banniere .cookies__boutons {
		flex: none;
		grid-template-columns: repeat(3, 160px);
		gap: 10px;
	}

	.cookies__banniere .cookies__bouton {
		height: 50px;
		font-size: 14.5px;
	}

	.cookies__voile {
		place-items: center;
		padding: 24px;
	}

	.cookies__fenetre {
		max-height: none;
		padding: 36px 36px 30px;
		border-radius: 20px;
	}

	.cookies__fenetre-titre {
		font-size: 28px;
	}

	.cookies__fermer {
		width: 40px;
		height: 40px;
	}

	.cookies__boutons--fenetre {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cookies__message {
		right: auto;
		bottom: 24px;
		left: 24px;
	}
}
