/* =========================================================================
   Batiself — Cookie consent (bandeau + modale de préférences)
   ========================================================================= */

.bs-cc[hidden] { display: none; }
.bs-cc { font-family: var(--bs-font-family); }

/* ---------- Bandeau (1ère visite) ---------------------------------------- */
.bs-cc__banner {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 2000;
	display: flex;
	align-items: center;
	gap: var(--bs-space-lg);
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 24px;
	background: #fff;
	border: 1px solid var(--bs-color-border);
	box-shadow: 0 18px 50px rgba(16, 54, 86, .22);
	color: var(--bs-color-text);
	animation: bs-cc-rise .3s cubic-bezier(.2, .8, .2, 1);
}
.bs-cc__banner[hidden] { display: none; }
@keyframes bs-cc-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.bs-cc__banner-body { flex: 1 1 auto; min-width: 0; }
.bs-cc__title {
	margin: 0 0 6px;
	color: var(--bs-color-primary);
	font-size:   var(--bs-type-h4-size);
	font-weight: var(--bs-weight-bold);
}
.bs-cc__text {
	margin: 0;
	color: var(--bs-color-text);
	font-size:   var(--bs-type-body-sm-size);
	line-height: var(--bs-leading-snug);
}
.bs-cc__text a { color: var(--bs-color-primary); text-decoration: underline; }

.bs-cc__actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }

/* Boutons — « Tout refuser » aussi visible que « Tout accepter » (CNPD). */
.bs-cc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	border: 1px solid var(--bs-color-primary);
	border-radius: 0;
	cursor: pointer;
	white-space: nowrap;
	font-family:    var(--bs-font-family);
	font-size:      var(--bs-type-button-size);
	font-weight:    var(--bs-type-button-weight);
	letter-spacing: var(--bs-type-button-tracking);
	text-transform: var(--bs-type-button-case);
	transition: background .18s ease, color .18s ease;
}
.bs-cc__btn--primary { background: var(--bs-color-primary); color: #fff; }
.bs-cc__btn--primary:hover { background: var(--bs-color-primary-dark); border-color: var(--bs-color-primary-dark); }
.bs-cc__btn--ghost { background: #fff; color: var(--bs-color-primary); }
.bs-cc__btn--ghost:hover { background: var(--bs-color-bg-alt); }

/* ---------- Modale « Personnaliser » ------------------------------------- */
.bs-cc__modal-wrap {
	position: fixed;
	inset: 0;
	z-index: 2001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.bs-cc__modal-wrap[hidden] { display: none; }
.bs-cc__backdrop { position: absolute; inset: 0; background: rgba(16, 54, 86, .5); }
.bs-cc__modal {
	position: relative;
	z-index: 1;
	width: min(560px, 100%);
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--bs-color-border);
	box-shadow: 0 24px 70px rgba(16, 54, 86, .3);
	animation: bs-cc-rise .25s cubic-bezier(.2, .8, .2, 1);
}
.bs-cc__modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--bs-color-border);
}
.bs-cc__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	background: var(--bs-color-bg-alt);
	border: 0;
	border-radius: 50%;
	color: var(--bs-color-text);
	cursor: pointer;
	flex: 0 0 auto;
}
.bs-cc__close:hover { background: var(--bs-color-primary); color: #fff; }

.bs-cc__modal-body { padding: 20px 24px; overflow-y: auto; }
.bs-cc__cat { padding: 14px 0; border-bottom: 1px solid var(--bs-color-border); }
.bs-cc__cat:last-child { border-bottom: 0; }
.bs-cc__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bs-cc__cat-title { color: var(--bs-color-primary-dark); font-weight: var(--bs-weight-bold); }
.bs-cc__always { color: var(--bs-color-muted); font-size: var(--bs-type-body-sm-size); }
.bs-cc__cat-desc {
	margin: 6px 0 0;
	color: var(--bs-color-muted);
	font-size:   var(--bs-type-body-sm-size);
	line-height: var(--bs-leading-snug);
}

/* Interrupteur (switch) accessible. */
.bs-cc__switch { position: relative; display: inline-flex; flex: 0 0 auto; cursor: pointer; }
.bs-cc__switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.bs-cc__switch-track {
	width: 46px;
	height: 26px;
	border-radius: 999px;
	background: var(--bs-color-border);
	transition: background .2s ease;
	position: relative;
}
.bs-cc__switch-track::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: transform .2s ease;
}
.bs-cc__switch input:checked + .bs-cc__switch-track { background: var(--bs-color-primary); }
.bs-cc__switch input:checked + .bs-cc__switch-track::after { transform: translateX(20px); }
.bs-cc__switch input:focus-visible + .bs-cc__switch-track { outline: 2px solid var(--bs-color-primary); outline-offset: 2px; }

.bs-cc__modal-foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	flex-wrap: wrap;
	padding: 18px 24px;
	border-top: 1px solid var(--bs-color-border);
}

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 760px) {
	.bs-cc__banner { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; }
	.bs-cc__actions { justify-content: stretch; }
	.bs-cc__actions .bs-cc__btn { flex: 1 1 auto; }
	.bs-cc__modal-foot { justify-content: stretch; }
	.bs-cc__modal-foot .bs-cc__btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
	.bs-cc__banner, .bs-cc__modal { animation: none; }
}

/* ---------- Repli affiché quand un contenu bridé n'est pas consenti ------- */
.bs-cc-fallback {
	display: block;
	color: var(--bs-color-muted);
	font-size: var(--bs-type-body-sm-size);
	text-align: center;
}
.bs-cc-fallback__btn {
	background: none;
	border: 0;
	padding: 0;
	margin-left: 6px;
	color: var(--bs-color-primary);
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}
/* La catégorie marketing acceptée → on masque le repli (le contenu s'affiche). */
.bs-cc-marketing .bs-cc-fallback--marketing { display: none; }
