/* AB Cookie Consent – frontend. Le variabili --abcc-* arrivano dalle impostazioni. */

.abcc-root *,
.abcc-preview *,
.abcc-blocked,
.abcc-blocked * { box-sizing: border-box; }

.abcc-banner[hidden],
.abcc-modal[hidden],
.abcc-float[hidden],
.abcc-root[hidden] { display: none !important; }

html.abcc-lock { overflow: hidden; }

/* ------------------------------------------------------------- testo base */
.abcc-banner,
.abcc-panel {
	font-family: inherit;
	font-size: var(--abcc-fs, 15px);
	line-height: 1.5;
	color: var(--abcc-text, #1f2937);
	background: var(--abcc-bg, #fff);
	text-align: left;
}
.abcc-title { font-size: 1.15em; font-weight: 700; margin: 0 0 6px; color: inherit; }
.abcc-desc { margin: 0; color: inherit; }
.abcc-banner a,
.abcc-panel a { color: var(--abcc-link, #1457a6); text-decoration: underline; }

/* ----------------------------------------------------------------- banner */
.abcc-banner {
	position: fixed;
	z-index: var(--abcc-z, 999999);
	padding: 20px 24px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
	max-height: 90vh;
	overflow: auto;
}

.abcc-l-bar {
	left: 0; right: 0; bottom: 0;
	padding-left: max(24px, calc((100vw - 1200px) / 2));
	padding-right: max(24px, calc((100vw - 1200px) / 2));
	border-radius: var(--abcc-radius, 10px) var(--abcc-radius, 10px) 0 0;
	display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
}
.abcc-l-bar .abcc-body { flex: 1 1 420px; padding-right: 22px; }
.abcc-l-bar .abcc-actions { flex: 0 0 auto; }

.abcc-l-box-left,
.abcc-l-box-right {
	bottom: 20px;
	width: min(430px, calc(100vw - 32px));
	border-radius: var(--abcc-radius, 10px);
}
.abcc-l-box-left { left: 20px; }
.abcc-l-box-right { right: 20px; }
.abcc-l-box-left .abcc-actions,
.abcc-l-box-right .abcc-actions { flex-direction: column; margin-top: 16px; }
.abcc-l-box-left .abcc-body,
.abcc-l-box-right .abcc-body { padding-right: 20px; }

.abcc-l-modal {
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: min(540px, calc(100vw - 32px));
	border-radius: var(--abcc-radius, 10px);
	/* l'ombra molto ampia oscura la pagina sotto la finestra */
	box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55), 0 8px 32px rgba(0, 0, 0, .3);
}
.abcc-l-modal .abcc-actions { flex-direction: column; margin-top: 16px; }

.abcc-x {
	position: absolute; top: 8px; right: 10px;
	width: 36px; height: 36px;
	border: 0; background: transparent; cursor: pointer;
	font-size: 26px; line-height: 1; color: inherit; opacity: .7;
	border-radius: 50%;
}
.abcc-x:hover { opacity: 1; }

/* ---------------------------------------------------------------- pulsanti */
.abcc-actions { display: flex; gap: 10px; }

.abcc-btn {
	appearance: none; -webkit-appearance: none;
	display: inline-flex; align-items: center; justify-content: center;
	border: 2px solid transparent;
	cursor: pointer;
	font: inherit; font-weight: 600; line-height: 1.2; text-align: center;
	padding: 10px 18px; min-height: 44px;
	border-radius: var(--abcc-radius, 10px);
	text-decoration: none;
	transition: filter .15s;
}
.abcc-btn:hover { filter: brightness(.94); }
.abcc-btn-accept { background: var(--abcc-accept-bg, #fe9a00); color: var(--abcc-accept-text, #1a1a1a); border-color: var(--abcc-accept-bg, #fe9a00); }
.abcc-btn-reject { background: var(--abcc-reject-bg, #1457a6); color: var(--abcc-reject-text, #fff); border-color: var(--abcc-reject-bg, #1457a6); }
.abcc-btn-custom { background: var(--abcc-custom-bg, #fff); color: var(--abcc-custom-text, #1457a6); border-color: var(--abcc-custom-text, #1457a6); }

.abcc-btn:focus-visible,
.abcc-x:focus-visible,
.abcc-float:focus-visible,
.abcc-banner a:focus-visible,
.abcc-panel a:focus-visible,
.abcc-panel summary:focus-visible {
	outline: 3px solid var(--abcc-link, #1457a6);
	outline-offset: 2px;
}

/* --------------------------------------------------- finestra preferenze */
.abcc-modal {
	position: fixed; inset: 0;
	z-index: calc(var(--abcc-z, 999999) + 1);
	display: flex; align-items: center; justify-content: center;
	padding: 16px;
}
.abcc-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.abcc-panel {
	position: relative;
	width: min(660px, 100%);
	max-height: 92vh; overflow: auto;
	padding: 26px 24px 22px;
	border-radius: var(--abcc-radius, 10px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.abcc-panel:focus { outline: none; }
.abcc-panel > .abcc-desc { margin-bottom: 8px; }
.abcc-panel > .abcc-title { padding-right: 36px; }
.abcc-panel > .abcc-actions { margin-top: 18px; flex-wrap: wrap; }
.abcc-panel > .abcc-actions .abcc-btn { flex: 1 1 150px; }

.abcc-cat { border-top: 1px solid rgba(127, 127, 127, .35); padding: 14px 0; }
.abcc-cat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.abcc-cat p { margin: 6px 0 8px; font-size: .93em; opacity: .92; }
.abcc-always { font-size: .85em; font-weight: 600; color: var(--abcc-toggle, #1457a6); }
.abcc-cat details summary { cursor: pointer; font-size: .9em; color: var(--abcc-link, #1457a6); }

/* interruttore */
.abcc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.abcc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.abcc-slider { position: absolute; inset: 0; background: #9ca3af; border-radius: 26px; transition: background .2s; }
.abcc-slider::before {
	content: ""; position: absolute; left: 3px; top: 3px;
	width: 20px; height: 20px; border-radius: 50%; background: #fff;
	transition: transform .2s;
}
.abcc-switch input:checked + .abcc-slider { background: var(--abcc-toggle, #1457a6); }
.abcc-switch input:checked + .abcc-slider::before { transform: translateX(20px); }
.abcc-switch input:focus-visible + .abcc-slider { outline: 3px solid var(--abcc-link, #1457a6); outline-offset: 2px; }

/* ---------------------------------------------------- tabella dei cookie */
.abcc-table { width: 100%; border-collapse: collapse; font-size: .85em; margin: 8px 0 4px; }
.abcc-table th,
.abcc-table td { border: 1px solid rgba(127, 127, 127, .35); padding: 6px 8px; text-align: left; vertical-align: top; }
.abcc-table th { background: rgba(127, 127, 127, .12); }
.abcc-table code { font-size: .95em; word-break: break-all; }
.abcc-none { font-size: .85em; opacity: .8; margin: 6px 0; }

@media (max-width: 600px) {
	.abcc-table thead { display: none; }
	.abcc-table tr { display: block; margin-bottom: 8px; border: 1px solid rgba(127, 127, 127, .35); }
	.abcc-table td { display: block; border: 0; border-bottom: 1px solid rgba(127, 127, 127, .2); }
	.abcc-table td::before { content: attr(data-label) ": "; font-weight: 600; }
}

/* ------------------------------------------------ pulsante / link di ritorno */
.abcc-float {
	position: fixed; bottom: 18px;
	z-index: var(--abcc-z, 999999);
	display: inline-flex; align-items: center; gap: 8px;
	min-width: 44px; min-height: 44px; padding: 10px 14px;
	border: 0; border-radius: 999px; cursor: pointer;
	background: var(--abcc-float-bg, #1457a6); color: var(--abcc-float-text, #fff);
	font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}
.abcc-float-left { left: 18px; }
.abcc-float-right { right: 18px; }
.abcc-float.abcc-fs-icon { padding: 11px; }
.abcc-float:hover { filter: brightness(1.08); }

.abcc-footer-link { text-align: center; padding: 10px 16px; font-size: 14px; }
.abcc-footer-link a,
.abcc-link { color: var(--abcc-footer-link, #1457a6); cursor: pointer; }

/* ------------------------------------------------- contenuti bloccati */
.abcc-blocked {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
	width: 100%; min-height: 180px; padding: 24px; text-align: center;
	background: #f3f4f6; color: #1f2937;
	border: 1px dashed #9ca3af; border-radius: var(--abcc-radius, 10px);
	font-size: 15px; line-height: 1.5;
}
.abcc-blocked p { margin: 0; }

/* ----------------------------------------------- tabella nella pagina policy */
.abcc-cookie-list .abcc-table { font-size: .9em; }

/* -------------------------------------------- anteprima nel pannello admin */
.abcc-preview .abcc-banner {
	position: relative; left: auto; right: auto; top: auto; bottom: auto;
	transform: none; width: auto; max-width: 720px; margin: 0;
	box-shadow: 0 2px 14px rgba(0, 0, 0, .25);
	display: block;
}
.abcc-preview .abcc-l-bar .abcc-body { padding-right: 22px; }
.abcc-preview .abcc-actions { margin-top: 16px; flex-wrap: wrap; }
.abcc-preview .abcc-actions .abcc-btn { flex: 1 1 130px; }
.abcc-preview .abcc-float { position: relative; left: auto; right: auto; bottom: auto; margin-top: 14px; }

/* -------------------------------------------------------------- mobile */
@media (max-width: 640px) {
	.abcc-banner { padding: 18px 16px; }
	.abcc-l-bar { padding-left: 16px; padding-right: 16px; }
	.abcc-l-bar .abcc-actions,
	.abcc-actions { flex-direction: column; width: 100%; }
	.abcc-l-box-left, .abcc-l-box-right { left: 16px; right: 16px; bottom: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.abcc-slider, .abcc-slider::before, .abcc-btn { transition: none; }
}
