/* Banner cookie, pannello preferenze e segnaposto per contenuti esterni */

#cbConsent[hidden],
#cbPrefs[hidden] {
	display: none !important;
}

/* ---------- Banner ---------- */
#cbConsent {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	padding: 1.5rem 2rem;
	background: #bfa583;
	color: #fff;
	box-shadow: 0 -2px 12px rgba(0,0,0,.12);
}

#cbConsent p {
	margin: 0;
	color: #fff;
	text-align: left;
	max-width: 62rem;
}

#cbConsent p a {
	color: #fff;
	font-weight: bold;
	text-decoration: underline;
}

.cbActions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	justify-content: center;
}

#cbConsent .cbText { flex: 1 1 auto; }

#cbConsent .cbActions {
	flex: 0 0 auto;
	flex-wrap: nowrap;
}

/* Accetta e Rifiuta hanno lo stesso aspetto: nessun pulsante favorito */
.cbBtn {
	cursor: pointer;
	border: 2px solid #fff;
	border-radius: 100px;
	background: #fff;
	color: #bfa583;
	font: inherit;
	padding: 10px 24px 8px 24px;
	transition: .3s;
	white-space: nowrap;
}

.cbBtn:hover,
.cbBtn:focus-visible {
	box-shadow: 0 1px 4px 1px rgba(0,0,0,.15);
}

.cbBtnGhost {
	background: transparent;
	color: #fff;
}

/* Rifiuta: pieno e scuro, ben distinto da Accetta */
.cbBtn.cbBtnReject,
#cbPrefs .cbBtn.cbBtnReject {
	background: #8c6a52;
	border-color: #8c6a52;
	color: #fff;
}

/* ---------- Pannello preferenze ---------- */
#cbPrefs {
	position: fixed;
	inset: 0;
	z-index: 100000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

#cbPrefs .cbOverlay {
	position: absolute;
	inset: 0;
	background: rgba(40, 28, 22, .55);
}

#cbPrefs .cbDialog {
	position: relative;
	width: 100%;
	max-width: 36rem;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	color: #563b30;
	border-radius: 12px;
	padding: 2rem;
	outline: none;
}

#cbPrefs h3 {
	margin: 0 0 1rem 0;
	color: #bb6647;
}

#cbPrefs .cbRow {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1rem 0;
	border-top: 1px solid #eadfd6;
}

#cbPrefs .cbRow p,
#cbPrefs .cbNote {
	margin: .25rem 0 0 0;
	font-size: .9rem;
	color: #563b30;
	text-align: left;
}

#cbPrefs .cbNote {
	padding: 1rem 0;
	border-top: 1px solid #eadfd6;
}

#cbPrefs .cbNote a {
	color: #bb6647;
	text-decoration: underline;
}

#cbPrefs .cbBtn {
	border-color: #bfa583;
	background: #bfa583;
	color: #fff;
}

#cbPrefs .cbBtnGhost {
	background: transparent;
	color: #bfa583;
}

#cbPrefs .cbActions {
	justify-content: flex-end;
}

/* Interruttori */
.cbSwitch {
	position: relative;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
	margin-top: .1rem;
}

.cbSwitch input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}

.cbSwitch span {
	position: absolute;
	inset: 0;
	border-radius: 26px;
	background: #d9cdc3;
	transition: .3s;
}

.cbSwitch span::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: .3s;
}

.cbSwitch input:checked + span { background: #bb6647; }
.cbSwitch input:checked + span::after { transform: translateX(20px); }
.cbSwitch input:disabled { cursor: default; }
.cbSwitch input:disabled + span { opacity: .55; }
.cbSwitch input:focus-visible + span { outline: 2px solid #563b30; outline-offset: 2px; }

/* Link "Gestisci cookie" nel footer */
.cbManage {
	cursor: pointer;
}

/* ---------- Segnaposto contenuti esterni (YouTube, commenti) ---------- */
.consentEmbed {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem;
	border: 1.5px dashed #bb6647;
	color: #563b30;
	text-align: center;
}

.consentEmbed p {
	margin: 0;
	max-width: 34rem;
	color: #563b30;
	font-size: .95rem;
}

.consentEmbed p a {
	color: #bb6647;
	text-decoration: underline;
}

.consentEmbedLoad {
	cursor: pointer;
	border: 0;
	border-radius: 100px;
	background: #bb6647;
	color: #fff;
	font: inherit;
	padding: 12px 24px 10px 24px;
	transition: .3s;
}

.consentEmbedLoad:hover,
.consentEmbedLoad:focus-visible {
	box-shadow: 0 1px 4px 1px rgba(0,0,0,.2);
}

/* Dentro il contenitore 16:9 del video il segnaposto riempie tutto lo spazio */
.videoWrap .consentEmbed {
	position: absolute;
	inset: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
	#cbConsent {
		flex-direction: column;
		gap: 1rem;
		padding: 1.25rem 1rem;
		max-height: 80vh;
		overflow-y: auto;
	}

	#cbConsent p { font-size: .9rem; }

	.cbActions { width: 100%; }
	.cbActions .cbBtn { flex: 1 1 auto; padding-left: 14px; padding-right: 14px; }
	#cbConsent .cbActions { flex-wrap: wrap; }

	#cbPrefs .cbDialog { padding: 1.25rem; }
	#cbPrefs .cbActions { justify-content: stretch; }
}
