/* Cookie Consent Opt-Out - stili banner (tutto pilotato da CSS variables) */

.cco-root,
.cco-root * { box-sizing: border-box; }

.cco-root[hidden] { display: none !important; }

.cco-root {
	position: fixed;
	z-index: 999950;
	font-family: var(--cco-font, inherit);
	font-size: var(--cco-font-size, 14px);
	line-height: var(--cco-line-height, 1.55);
	color: var(--cco-text, #3f4652);
}

.cco-overlay {
	position: fixed;
	inset: 0;
	background: var(--cco-overlay, rgba(11,13,16,.45));
	display: none;
}

.cco--has-overlay .cco-overlay { display: block; }

.cco-card {
	position: relative;
	background: var(--cco-bg, #fff);
	color: var(--cco-text, #3f4652);
	border: var(--cco-border-w, 1px) solid var(--cco-border, #e6e8ec);
	border-radius: var(--cco-radius, 14px);
	box-shadow: var(--cco-shadow, 0 10px 40px rgba(0,0,0,.14));
	padding: var(--cco-pad, 22px);
	max-width: var(--cco-max-width, 1100px);
	width: 100%;
	backdrop-filter: var(--cco-blur, none);
	-webkit-backdrop-filter: var(--cco-blur, none);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
}

/* ---------- Layout ---------- */

.cco--banner-bottom { left: 0; right: 0; bottom: var(--cco-offset, 24px); display: flex; justify-content: center; padding: 0 var(--cco-offset, 24px); }
.cco--banner-top    { left: 0; right: 0; top: var(--cco-offset, 24px); display: flex; justify-content: center; padding: 0 var(--cco-offset, 24px); }

.cco--bar-slim { left: 0; right: 0; bottom: 0; display: flex; justify-content: center; }
.cco--bar-slim .cco-card {
	max-width: none;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
	padding: 12px var(--cco-pad, 22px);
	flex-wrap: nowrap;
}

.cco--box-bl { left: var(--cco-offset, 24px); bottom: var(--cco-offset, 24px); width: min(400px, calc(100vw - 2 * var(--cco-offset, 24px))); }
.cco--box-br { right: var(--cco-offset, 24px); bottom: var(--cco-offset, 24px); width: min(400px, calc(100vw - 2 * var(--cco-offset, 24px))); }
.cco--box-bl .cco-card,
.cco--box-br .cco-card { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.cco--box-bl .cco-content,
.cco--box-br .cco-content { flex: 0 1 auto; }

.cco--modal-center { inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cco--modal-center .cco-card { max-width: min(560px, 100%); flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.cco--modal-center .cco-content { flex: 0 1 auto; }

/* ---------- Contenuto ---------- */

.cco-content { display: flex; gap: 14px; align-items: flex-start; flex: 1 1 380px; min-width: 0; }
.cco-icon { font-size: var(--cco-icon-size, 28px); line-height: 1; flex: 0 0 auto; }
.cco-icon--img { display: flex; align-items: center; }
.cco-icon--img img {
	display: block;
	width: auto;
	height: var(--cco-icon-size, 28px);
	max-width: 260px;
	object-fit: contain;
}
.cco-texts { min-width: 0; }

.cco-title {
	margin: 0 0 6px;
	font-size: var(--cco-title-size, 18px);
	font-weight: var(--cco-title-weight, 700);
	color: var(--cco-title, #151a20);
	line-height: 1.25;
}

.cco-message { margin: 0; }
.cco-message p { margin: 0 0 6px; }
.cco-message p:last-child { margin-bottom: 0; }

.cco-links { margin: 8px 0 0; font-size: .92em; }
.cco-link, .cco-message a { color: var(--cco-link, #b3141d); text-decoration: underline; }
.cco-link:hover, .cco-message a:hover { opacity: .8; }
.cco-sep { opacity: .45; margin: 0 4px; }

/* ---------- Pulsanti ---------- */

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

.cco--btn-stacked .cco-actions { flex-direction: column; align-items: stretch; }
.cco--btn-full .cco-actions { flex: 1 1 100%; }
.cco--btn-stacked .cco-content { flex: 1 1 auto; }
.cco--btn-full .cco-btn { flex: 1 1 auto; }
.cco--align-left .cco-actions { justify-content: flex-start; }
.cco--align-center .cco-actions { justify-content: center; }
.cco--align-right .cco-actions { justify-content: flex-end; }

.cco-btn {
	font-family: inherit;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.2;
	padding: 11px 20px;
	border-radius: var(--cco-btn-radius, 999px);
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
	white-space: nowrap;
	text-align: center;
}
.cco-btn:hover { transform: translateY(-1px); opacity: .92; }
.cco-btn:active { transform: translateY(0); }
.cco-btn:focus-visible { outline: 2px solid var(--cco-link, #b3141d); outline-offset: 2px; }

.cco-btn--primary { background: var(--cco-btn-bg, #b3141d); color: var(--cco-btn-text, #fff); }
.cco-btn--secondary { background: var(--cco-btn2-bg, #f2f3f5); color: var(--cco-btn2-text, #2b3038); }
.cco-btn--ghost {
	background: transparent;
	color: var(--cco-btn2-text, #2b3038);
	border-color: var(--cco-border, #e6e8ec);
	text-decoration: none;
}

.cco-close {
	position: absolute;
	top: 8px;
	right: 10px;
	background: none;
	border: 0;
	font-size: 22px;
	line-height: 1;
	color: var(--cco-text, #3f4652);
	opacity: .5;
	cursor: pointer;
	padding: 4px 6px;
}
.cco-close:hover { opacity: 1; }

/* ---------- Pannello preferenze ---------- */

.cco-prefs { inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 999960; }
.cco-card--prefs {
	flex-direction: column;
	align-items: stretch;
	max-width: 620px;
	max-height: 86vh;
	overflow-y: auto;
	overflow-x: hidden;
	flex-wrap: nowrap;
	gap: 0;
}
.cco-card--prefs .cco-title { margin-bottom: 8px; }
.cco-card--prefs .cco-actions { margin-top: 18px; }

.cco-cats { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.cco-cat {
	border: 1px solid var(--cco-border, #e6e8ec);
	border-radius: calc(var(--cco-radius, 14px) * .7);
	padding: 12px 14px;
}
.cco-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cco-cat-title { font-weight: 600; color: var(--cco-title, #151a20); }
.cco-cat-desc { margin-top: 6px; font-size: .92em; opacity: .85; }
.cco-always { font-size: .82em; opacity: .6; text-transform: uppercase; letter-spacing: .04em; }

.cco-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.cco-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.cco-slider {
	position: absolute;
	inset: 0;
	background: #c9ced6;
	border-radius: 999px;
	transition: background .2s ease;
}
.cco-slider::before {
	content: "";
	position: absolute;
	width: 20px;
	height: 20px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.cco-switch input:checked + .cco-slider { background: var(--cco-toggle-on, #1f9d55); }
.cco-switch input:checked + .cco-slider::before { transform: translateX(20px); }
.cco-switch input:focus-visible + .cco-slider { outline: 2px solid var(--cco-link, #b3141d); outline-offset: 2px; }
.cco-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Badge riapri ---------- */

.cco-badge {
	position: fixed;
	z-index: 999940;
	width: var(--cco-badge-size, 46px);
	height: var(--cco-badge-size, 46px);
	border-radius: 50%;
	border: 0;
	background: var(--cco-badge-bg, #151a20);
	color: var(--cco-badge-color, #fff);
	font-size: calc(var(--cco-badge-size, 46px) * .48);
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}
.cco-badge[hidden] { display: none !important; }
.cco-badge--img img {
	display: block;
	width: 66%;
	height: 66%;
	max-width: none;
	object-fit: contain;
}
.cco-badge:hover { transform: scale(1.08); }
.cco-badge--bl { left: var(--cco-badge-offset, 20px); bottom: var(--cco-badge-offset, 20px); }
.cco-badge--br { right: var(--cco-badge-offset, 20px); bottom: var(--cco-badge-offset, 20px); }
.cco-badge--tl { left: var(--cco-badge-offset, 20px); top: var(--cco-badge-offset, 20px); }
.cco-badge--tr { right: var(--cco-badge-offset, 20px); top: var(--cco-badge-offset, 20px); }

/* ---------- Animazioni ---------- */

.cco--anim-fade .cco-card { animation: cco-fade .35s ease both; }
.cco--anim-slide .cco-card { animation: cco-slide .4s cubic-bezier(.16,.84,.44,1) both; }
.cco--anim-pop .cco-card { animation: cco-pop .35s cubic-bezier(.2,1.2,.4,1) both; }
.cco--banner-top.cco--anim-slide .cco-card { animation-name: cco-slide-down; }

@keyframes cco-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cco-slide { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes cco-slide-down { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }
@keyframes cco-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.cco-card { animation: none !important; }
}

/* ---------- Elementi inseriti nei contenuti (shortcode / widget) ---------- */

.cco-open-prefs {
	font: inherit;
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	text-decoration: underline;
}
.cco-status { list-style: none; margin: 0; padding: 0; }
.cco-status-item::before { content: "● "; }
.cco-status--on::before { color: #1f9d55; }
.cco-status--off::before { color: #c0392b; }

/* ---------- Mobile ---------- */

@media (max-width: 782px) {
	.cco-card { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
	.cco-content { flex: 0 1 auto; }
	.cco--banner-bottom, .cco--banner-top { padding: 0 12px; }
	.cco--banner-bottom { bottom: 12px; }
	.cco--banner-top { top: 12px; }
	.cco--box-bl, .cco--box-br { left: 12px; right: 12px; bottom: 12px; width: auto; }
	.cco-actions { width: 100%; }
	.cco-btn { flex: 1 1 auto; }
	.cco--bar-slim .cco-card { flex-wrap: wrap; }
}

/* ---------- Anteprima nel pannello admin ---------- */

.cco-root.cco--preview,
.cco-badge.cco--preview { position: absolute; }
.cco-root.cco--preview .cco-overlay { position: absolute; }
.cco-root.cco--preview.cco--modal-center,
.cco-root.cco--preview.cco--prefs { position: absolute; }

/* ---------- Isolamento dagli stili del tema ----------
   I temi (Elementor, in particolare) applicano i propri stili a button/a con
   selettori che caricano dopo il plugin. Qui le stesse regole vengono ripetute
   con specificità più alta, così l'aspetto resta quello scelto nel pannello. */

.cco-root .cco-btn.cco-btn,
.cco-root .cco-close.cco-close,
.cco-badge.cco-badge {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	background-image: none;
	min-width: 0;
	min-height: 0;
	width: auto;
	margin: 0;
	outline: 0;
}

.cco-root .cco-btn.cco-btn {
	font-size: 1em;
	font-weight: 600;
	line-height: 1.2;
	height: auto;
	padding: 11px 20px;
	border-style: solid;
	border-width: 1px;
	border-color: transparent;
	border-radius: var(--cco-btn-radius, 999px);
	box-shadow: none;
	cursor: pointer;
	text-align: center;
}

.cco-root .cco-btn.cco-btn--primary,
.cco-root .cco-btn.cco-btn--primary:hover,
.cco-root .cco-btn.cco-btn--primary:focus,
.cco-root .cco-btn.cco-btn--primary:active {
	background-color: var(--cco-btn-bg, #b3141d);
	color: var(--cco-btn-text, #fff);
	border-color: transparent;
}

.cco-root .cco-btn.cco-btn--secondary,
.cco-root .cco-btn.cco-btn--secondary:hover,
.cco-root .cco-btn.cco-btn--secondary:focus,
.cco-root .cco-btn.cco-btn--secondary:active {
	background-color: var(--cco-btn2-bg, #f2f3f5);
	color: var(--cco-btn2-text, #2b3038);
	border-color: transparent;
}

.cco-root .cco-btn.cco-btn--ghost,
.cco-root .cco-btn.cco-btn--ghost:hover,
.cco-root .cco-btn.cco-btn--ghost:focus,
.cco-root .cco-btn.cco-btn--ghost:active {
	background-color: transparent;
	color: var(--cco-btn2-text, #2b3038);
	border-color: var(--cco-border, #e6e8ec);
}

.cco-root .cco-close.cco-close,
.cco-root .cco-close.cco-close:hover,
.cco-root .cco-close.cco-close:focus {
	background: none;
	border: 0;
	box-shadow: none;
	color: var(--cco-text, #3f4652);
	font-size: 22px;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 0;
}

.cco-badge.cco-badge {
	border: 0;
	padding: 0;
	width: var(--cco-badge-size, 46px);
	height: var(--cco-badge-size, 46px);
	background-color: var(--cco-badge-bg, #151a20);
	color: var(--cco-badge-color, #fff);
	border-radius: 50%;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

.cco-root a.cco-link,
.cco-root .cco-message a {
	color: var(--cco-link, #b3141d);
	text-decoration: underline;
	background: none;
	box-shadow: none;
}

.cco-root .cco-card.cco-card { color: var(--cco-text, #3f4652); }
.cco-root .cco-title.cco-title { color: var(--cco-title, #151a20); font-family: inherit; }
.cco-root .cco-cat.cco-cat { background: none; }
