/* ================================================================
   Cookie Banner — banner.css
   Versioni: barra basso (default), barra alto, modale centrale.
   ================================================================ */

/* ----------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------- */
#cb-banner,
#cb-banner * {
	box-sizing: border-box;
}

/* ----------------------------------------------------------------
   Banner — barra in basso / in alto
   -------------------------------------------------------------- */
#cb-banner.cb-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	background: #1a1a2e;
	color: #e8e8f0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.55;
	padding: 0;

	/* Transizione di entrata/uscita */
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Posizione bassa */
#cb-banner.cb-pos-bottom {
	bottom: 0;
	top: auto;
	border-top: 3px solid #6c63ff;
	transform: translateY(20px);
}

/* Posizione alta */
#cb-banner.cb-pos-top {
	top: 0;
	bottom: auto;
	border-bottom: 3px solid #6c63ff;
	transform: translateY(-20px);
}

/* Stato visibile — aggiunto via JS */
#cb-banner.cb-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ----------------------------------------------------------------
   Modale centrale
   -------------------------------------------------------------- */
#cb-banner.cb-pos-center {
	top: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	padding: 16px;
	transform: none;
}

#cb-banner.cb-pos-center.cb-visible {
	transform: none;
}

.cb-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.60);
	z-index: -1;
}

.cb-modal {
	background: #1a1a2e;
	border-radius: 12px;
	border: 1px solid rgba(108, 99, 255, 0.4);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
	max-width: 520px;
	width: 100%;
	padding: 0;
	overflow: hidden;
	animation: cb-scale-in 0.3s ease;
}

@keyframes cb-scale-in {
	from { opacity: 0; transform: scale(0.93); }
	to   { opacity: 1; transform: scale(1); }
}

/* ----------------------------------------------------------------
   Layout interno — uguale per barra e modale
   -------------------------------------------------------------- */
.cb-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	padding: 18px 24px;
}

.cb-pos-center .cb-inner {
	flex-direction: column;
	align-items: flex-start;
	padding: 28px 32px;
}

.cb-content {
	flex: 1 1 260px;
}

.cb-title {
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 6px;
}

.cb-text {
	margin: 0 0 6px;
	color: #b8b8cc;
}

.cb-privacy-link {
	margin: 4px 0 0;
}

/*
 * Pulsanti e link del banner e del pannello: ogni selettore porta l'id del
 * banner, così (1,1,0) vince sulle regole dei temi per i button e i link, per
 * esempio «.elementor-kit-N button» di Elementor (0,1,1) o «button» di
 * Bootstrap (0,0,1). Ogni regola che dà il colore del testo dà anche il fondo,
 * e viceversa; il contrasto fra i due è almeno 4,5 a 1. Un test controlla
 * tutte e due le cose (COOKIEBANNER-PROMPT-55).
 */
#cb-banner .cb-privacy-link a {
	color: #9d97ff;
	background: transparent;
	text-decoration: underline;
	font-size: 13px;
}

#cb-banner .cb-privacy-link a:hover,
#cb-banner .cb-privacy-link a:focus {
	color: #ffffff;
	background: transparent;
}

/* ----------------------------------------------------------------
   Bottoni
   -------------------------------------------------------------- */
.cb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex-shrink: 0;
}

.cb-pos-center .cb-actions {
	width: 100%;
}

/*
 * Le proprietà che i temi danno ai button (bordo, angoli, ombra, maiuscole,
 * altezza minima, margini) si rimettono qui, così il pulsante ha lo stesso
 * aspetto con qualunque tema.
 */
#cb-banner .cb-btn {
	display: inline-block;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 10px 22px;
	border: 2px solid transparent;
	border-radius: 6px;
	box-shadow: none;
	text-shadow: none;
	font-family: inherit;
	font-size: 14px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	white-space: nowrap;
	line-height: 1.3;
}

/* Contorno visibile quando si arriva al pulsante con la tastiera. */
#cb-banner .cb-btn:focus-visible,
#cb-banner .cb-btn-link:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

/*
 * Accetta e Salva. Il fondo era #6c63ff, con il bianco a 4,32 a 1: sotto il
 * 4,5. Con #574fd6 è 6,01 a 1.
 */
#cb-banner .cb-btn-accept,
#cb-banner .cb-btn-save {
	background: #574fd6;
	color: #ffffff;
	border-color: #574fd6;
}

#cb-banner .cb-btn-accept:hover,
#cb-banner .cb-btn-accept:focus,
#cb-banner .cb-btn-save:hover,
#cb-banner .cb-btn-save:focus {
	background: #463fb0;
	color: #ffffff;
	border-color: #463fb0;
}

/*
 * Rifiuta — stesso peso visivo dell'accetta (GDPR: no dark pattern).
 * Sfondo solido neutro, stesso padding, stesso font-weight.
 */
#cb-banner .cb-btn-reject {
	background: #3a3a50;
	color: #e8e8f0;
	border-color: #3a3a50;
}

#cb-banner .cb-btn-reject:hover,
#cb-banner .cb-btn-reject:focus {
	background: #2e2e42;
	color: #ffffff;
	border-color: #2e2e42;
}

/* Bottone full-width in modalità center */
#cb-banner.cb-pos-center .cb-btn {
	flex: 1 1 0;
	text-align: center;
}

/* ----------------------------------------------------------------
   Personalizza: pulsante meno evidente e pannello delle categorie.
   Fondo trasparente: il testo sta sul fondo del banner, #1a1a2e.
   -------------------------------------------------------------- */
#cb-banner .cb-btn-link {
	display: inline-block;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 10px 4px;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	background: transparent;
	color: #b8b8cc;
	font-family: inherit;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: underline;
	line-height: 1.3;
	cursor: pointer;
}

#cb-banner .cb-btn-link:hover,
#cb-banner .cb-btn-link:focus {
	background: transparent;
	color: #ffffff;
}

#cb-banner .cb-prefs[hidden] {
	display: none;
}

.cb-prefs {
	flex: 1 1 100%;
	width: 100%;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-top: 12px;
	max-height: 60vh;
	overflow-y: auto;
}

.cb-pref-list {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.cb-pref {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	column-gap: 12px;
	padding: 8px 0;
}

.cb-pref-name {
	font-weight: 600;
	color: #ffffff;
	cursor: pointer;
}

.cb-pref-desc {
	grid-column: 2;
	margin: 2px 0 0;
	font-size: 13px;
	color: #b8b8cc;
}

/* Codice del consenso, in piccolo */
#cb-banner .cb-consent-id[hidden] {
	display: none;
}

.cb-consent-id {
	margin: 0 0 12px;
	font-size: 12px;
	color: #b8b8cc;
	word-break: break-all;
}

/* Interruttore: una checkbox con role="switch", disegnata come levetta */
#cb-banner .cb-switch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	width: 40px;
	height: 22px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 11px;
	box-shadow: none;
	background: #3a3a50;
	cursor: pointer;
	transition: background 0.2s ease;
}

#cb-banner .cb-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #ffffff;
	transition: transform 0.2s ease;
}

#cb-banner .cb-switch:checked {
	background: #6c63ff;
}

#cb-banner .cb-switch:checked::after {
	transform: translateX(18px);
}

#cb-banner .cb-switch:focus-visible {
	outline: 2px solid #9d97ff;
	outline-offset: 2px;
}

#cb-banner .cb-switch:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ----------------------------------------------------------------
   Link "Gestisci cookie" (shortcode)
   -------------------------------------------------------------- */
.cb-reopen-link {
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font-size: inherit;
}

.cb-reopen-link:hover {
	opacity: 0.8;
}

/* ----------------------------------------------------------------
   Riquadro dei contenuti esterni bloccati (video e mappe).
   Fondo neutro: nessuna anteprima scaricata prima del consenso.
   -------------------------------------------------------------- */
.cb-video-placeholder {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0d0d1a;
	border-radius: 4px;
	overflow: hidden;
	max-width: 100%;
}

.cb-video-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 16px;
	background: rgba(10, 10, 30, 0.72);
	gap: 12px;
}

.cb-video-msg {
	color: #e8e8f0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	margin: 0;
	max-width: 340px;
}

.cb-video-btn {
	font-size: 13px;
	padding: 8px 18px;
}

/* ----------------------------------------------------------------
   Responsive
   -------------------------------------------------------------- */
@media ( max-width: 600px ) {
	.cb-inner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
		gap: 12px;
	}

	.cb-actions {
		flex-direction: column;
	}

	#cb-banner .cb-btn {
		text-align: center;
		width: 100%;
	}

	.cb-modal {
		border-radius: 8px;
	}

	.cb-video-placeholder {
		height: 220px !important;
	}
}
