/* Cookie Shield – stile banner, pannello e placeholder.
   Specificità alta + z-index elevato per convivere con Avada/Divi. */

#cs-root {
	--cs-primary: #1a7f5a;
	--cs-bg: #ffffff;
	--cs-text: #1f2933;
	--cs-muted: #5b6770;
	--cs-radius: 14px;
	position: fixed;
	z-index: 2147483000;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

#cs-root.cs-pos-bottom .cs-banner { margin: 0 auto; }
#cs-root.cs-pos-bottom-left .cs-banner { margin-right: auto; }
#cs-root.cs-pos-bottom-right .cs-banner { margin-left: auto; }

#cs-root .cs-banner {
	pointer-events: auto;
	max-width: 640px;
	background: var(--cs-bg);
	color: var(--cs-text);
	border-radius: var(--cs-radius);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
	padding: 22px 24px;
	max-height: 85vh;
	overflow-y: auto;
	animation: cs-slide-up 0.35s ease;
}

@keyframes cs-slide-up {
	from { transform: translateY(24px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

#cs-root h3 {
	margin: 0 0 8px !important;
	padding: 0 !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	color: var(--cs-text) !important;
}

#cs-root .cs-body p {
	margin: 0 0 14px !important;
	color: var(--cs-muted) !important;
	font-size: 14px !important;
}

#cs-root .cs-body a {
	color: var(--cs-primary) !important;
	text-decoration: underline !important;
}

/* --- Pannello categorie ------------------------------------------------ */

#cs-root .cs-panel {
	border-top: 1px solid #e4e7eb;
	margin-bottom: 14px;
	padding-top: 6px;
}

#cs-root .cs-cat { padding: 10px 0 4px; }

#cs-root .cs-cat-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

#cs-root .cs-cat p {
	margin: 4px 0 0 54px !important;
	font-size: 13px !important;
	color: var(--cs-muted) !important;
}

/* Switch */
#cs-root .cs-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: 0 0 44px;
}
#cs-root .cs-switch input { opacity: 0; width: 0; height: 0; }
#cs-root .cs-slider {
	position: absolute;
	inset: 0;
	background: #cbd2d9;
	border-radius: 24px;
	transition: 0.2s;
	cursor: pointer;
}
#cs-root .cs-slider::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: 0.2s;
}
#cs-root .cs-switch input:checked + .cs-slider { background: var(--cs-primary); }
#cs-root .cs-switch input:checked + .cs-slider::before { transform: translateX(20px); }
#cs-root .cs-switch input:disabled + .cs-slider { opacity: 0.55; cursor: not-allowed; }

/* --- Bottoni ------------------------------------------------------------ */

#cs-root .cs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

.cs-btn {
	appearance: none;
	border: 0;
	border-radius: 10px;
	padding: 11px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease, background 0.15s ease;
	line-height: 1.2;
}
.cs-btn-primary {
	background: var(--cs-primary, #1a7f5a);
	color: #fff;
}
.cs-btn-primary:hover { filter: brightness(1.1); }
.cs-btn-ghost {
	background: #eef1f4;
	color: #1f2933;
}
.cs-btn-ghost:hover { background: #e0e5ea; }

@media (max-width: 560px) {
	#cs-root .cs-actions { justify-content: stretch; }
	#cs-root .cs-actions .cs-btn { flex: 1 1 auto; }
}

/* --- Pulsante riapri preferenze ----------------------------------------- */

#cs-reopen {
	position: fixed;
	z-index: 2147482999;
	left: 16px;
	bottom: 16px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 0;
	background: var(--cs-primary, #1a7f5a);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
#cs-reopen:hover { transform: scale(1.08); }

/* --- Placeholder embed bloccati ------------------------------------------ */

.cs-placeholder-wrap { position: relative; }

.cs-placeholder {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #212a33;
	color: #dfe5ea;
	border-radius: 6px;
	min-height: 180px;
	text-align: center;
}

.cs-placeholder .cs-ph-inner {
	max-width: 420px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.cs-placeholder p {
	margin: 0 !important;
	font-size: 14px !important;
	color: #dfe5ea !important;
}

.cs-placeholder svg { opacity: 0.8; }

.cs-placeholder .cs-ph-all {
	appearance: none;
	background: transparent;
	border: 0;
	color: #9fb3c8;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}
.cs-placeholder .cs-ph-all:hover { color: #dfe5ea; }

/* Se il wrapper del builder collassa (iframe senza src), garantisci altezza */
iframe.cs-blocked-iframe { min-height: 180px; background: #212a33; }
