/* Clear Cookie Banner — styles isolés (préfixe .ccb-, variables CSS). */

.ccb-banner,
.ccb-modal,
.ccb-floating,
.ccb-iframe-placeholder {
	font-family: var(--ccb-font, inherit);
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}

.ccb-banner *,
.ccb-modal *,
.ccb-iframe-placeholder * {
	box-sizing: border-box;
}

/* L'attribut hidden doit toujours gagner, y compris contre nos propres
   display:flex et contre le CSS du thème (Divi & co). */
.ccb-banner[hidden],
.ccb-modal[hidden],
.ccb-floating[hidden] {
	display: none !important;
}

/* ---- Bannière ---- */

.ccb-banner {
	position: fixed;
	z-index: 999999;
	background: var(--ccb-bg, #ffffff);
	color: var(--ccb-text, #1f1f1f);
	padding: 20px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
}

.ccb-pos-bottom { left: 0; right: 0; bottom: 0; }
.ccb-pos-top { left: 0; right: 0; top: 0; }

.ccb-pos-bottom-left,
.ccb-pos-bottom-right {
	bottom: 16px;
	max-width: 380px;
	border-radius: 10px;
}

.ccb-pos-bottom-left { left: 16px; }
.ccb-pos-bottom-right { right: 16px; }

.ccb-pos-modal {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 480px;
	width: calc(100% - 32px);
	border-radius: 10px;
}

.ccb-banner-inner { max-width: 1100px; margin: 0 auto; }

.ccb-title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
}

.ccb-desc { margin: 0 0 14px; }

.ccb-link {
	color: var(--ccb-link, #555555);
	text-decoration: underline;
}

/* ---- Boutons : accepter et refuser au même niveau visuel (exigence CNIL) ---- */

.ccb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ccb-btn {
	border: 1.5px solid transparent;
	border-radius: 8px;
	padding: 10px 18px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.15s;
}

.ccb-btn:hover { opacity: 0.85; }

.ccb-btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.ccb-btn-accept {
	background: var(--ccb-accept-bg, #1f1f1f);
	color: var(--ccb-accept-text, #ffffff);
}

/* Bordure basée sur la couleur du texte : le bouton refuser reste visible
   quelle que soit la couleur de fond choisie (clair comme sombre). */
.ccb-btn-reject {
	background: var(--ccb-reject-bg, #ffffff);
	color: var(--ccb-reject-text, #1f1f1f);
	border-color: var(--ccb-reject-text, #1f1f1f);
}

.ccb-btn-customize {
	background: transparent;
	color: var(--ccb-text, #1f1f1f);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---- Centre de préférences ---- */

.ccb-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.ccb-modal[hidden] { display: none; }

.ccb-modal-inner {
	background: var(--ccb-bg, #ffffff);
	color: var(--ccb-text, #1f1f1f);
	border-radius: 12px;
	padding: 24px;
	max-width: 520px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
}

.ccb-category { margin: 0 0 14px; }

.ccb-switch {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-weight: 600;
}

.ccb-switch input { position: absolute; opacity: 0; }

.ccb-switch-slider {
	flex: 0 0 42px;
	height: 24px;
	border-radius: 12px;
	background: var(--ccb-switch-off, #b5b5b5);
	position: relative;
	transition: background 0.2s;
}

.ccb-switch-slider::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s;
}

.ccb-switch input:checked + .ccb-switch-slider { background: var(--ccb-accept-bg, #1f1f1f); }
.ccb-switch input:checked + .ccb-switch-slider::after { transform: translateX(18px); }
.ccb-switch input:disabled + .ccb-switch-slider { opacity: 0.6; }

.ccb-switch input:focus-visible + .ccb-switch-slider {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.ccb-category-desc {
	margin: 4px 0 0 52px;
	font-size: 13px;
	opacity: 0.85;
}

/* ---- Liste des cookies détectés ---- */

.ccb-cookies {
	margin: 4px 0 0 52px;
	font-size: 12px;
}

.ccb-cookies summary {
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
	opacity: 0.75;
}

.ccb-cookie-table {
	width: 100%;
	margin-top: 6px;
	border-collapse: collapse;
	font-size: 12px;
}

.ccb-cookie-table td {
	padding: 3px 8px 3px 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
	vertical-align: top;
}

.ccb-cookie-table td:first-child { font-family: monospace; }

.ccb-cookie-none {
	margin: 6px 0 0;
	opacity: 0.75;
}

/* ---- Bouton flottant ---- */

.ccb-floating {
	position: fixed;
	bottom: 16px;
	z-index: 999998;
	width: 52px;
	height: 52px;
	background: var(--ccb-floating-bg, #ffffff);
	color: var(--ccb-floating-icon, #1f1f1f);
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 50%;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
	transition: transform 0.15s;
}

.ccb-float-left { left: 16px; }
.ccb-float-right { right: 16px; }

.ccb-floating:hover { transform: scale(1.08); }

.ccb-floating img,
.ccb-floating svg {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

/* ---- Placeholder iframe ---- */

.ccb-iframe-placeholder {
	background: var(--ccb-bg, #ffffff);
	color: var(--ccb-text, #1f1f1f);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	padding: 24px;
	text-align: center;
	min-height: 160px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
	.ccb-actions { flex-direction: column; }
	.ccb-btn { width: 100%; }
	.ccb-pos-bottom-left,
	.ccb-pos-bottom-right {
		left: 8px;
		right: 8px;
		max-width: none;
	}
}

/* ---- Accessibilité : réduction des animations ---- */

@media (prefers-reduced-motion: reduce) {
	.ccb-switch-slider,
	.ccb-switch-slider::after { transition: none; }
}

/* ---- Responsable de la protection des renseignements personnels (Loi 25) ---- */

.ccb-officer {
	margin: 0 0 12px;
	font-size: 12px;
	opacity: 0.85;
}
