/* Ciambella Privacy Suite - banner cookie (v1.1 design) */
:root { --cps-radius: 16px; }

.cps-banner {
	position: fixed;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: #1d2430;
}
.cps-banner[hidden] { display: none; }

/* Overlay solo in modalità modale */
.cps-banner__overlay { display: none; }
.cps-pos-center .cps-banner__overlay {
	display: block;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(2px);
	z-index: -1;
}

/* Card flottante in basso */
.cps-pos-bottom {
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%);
	width: calc(100% - 40px);
	max-width: 920px;
	animation: cps-slide-up .45s cubic-bezier(.16,1,.3,1) both;
}
.cps-pos-center {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 40px);
	max-width: 540px;
	animation: cps-pop .4s cubic-bezier(.16,1,.3,1) both;
}

.cps-banner__inner {
	background: #ffffff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: var(--cps-radius);
	box-shadow: 0 18px 48px -12px rgba(15, 23, 42, 0.28), 0 4px 12px rgba(15, 23, 42, 0.06);
	padding: 22px 24px;
	display: flex;
	flex-wrap: wrap;
	gap: 14px 28px;
	align-items: center;
	justify-content: space-between;
}
.cps-layout-box .cps-banner__inner { flex-direction: column; align-items: stretch; }

.cps-banner__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}
.cps-banner__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: color-mix(in srgb, var(--cps-accent) 12%, white);
	color: var(--cps-accent);
	flex: none;
}
.cps-banner__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: #0f172a;
}
.cps-banner__text { margin: 0; max-width: 640px; color: #475569; font-size: 14.5px; }
.cps-banner__text a { color: var(--cps-accent); text-decoration: underline; text-underline-offset: 2px; }

.cps-prefs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	width: 100%;
	margin: 4px 0 2px;
}
.cps-pref {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	padding: 9px 14px;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 10px;
	background: #f8fafc;
	transition: border-color .15s ease, background .15s ease;
}
.cps-pref:hover { border-color: var(--cps-accent); }
.cps-pref input { accent-color: var(--cps-accent); width: 16px; height: 16px; }
.cps-pref--locked { opacity: .65; cursor: default; background: #eef2f7; }
.cps-pref--locked:hover { border-color: rgba(15, 23, 42, 0.12); }
.cps-pref em { color: #94a3b8; font-style: normal; font-size: 12px; }

.cps-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}
.cps-layout-box .cps-banner__actions { width: 100%; }

.cps-btn {
	border: 1.5px solid transparent;
	border-radius: 11px;
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	line-height: 1;
	transition: transform .08s ease, box-shadow .15s ease, opacity .15s ease, background .15s ease;
}
.cps-btn:active { transform: translateY(1px); }
.cps-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--cps-accent) 35%, white); outline-offset: 2px; }

/* Accetta e Rifiuta: stesso peso visivo (requisito Garante) */
.cps-btn--accept {
	background: var(--cps-accent);
	color: #fff;
	box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--cps-accent) 75%, transparent);
}
.cps-btn--reject {
	background: #1e293b;
	color: #fff;
}
.cps-btn--accept:hover { filter: brightness(1.05); }
.cps-btn--reject:hover { filter: brightness(1.15); }

.cps-btn--prefs,
.cps-btn--save {
	background: #fff;
	color: #334155;
	border-color: rgba(15, 23, 42, 0.16);
}
.cps-btn--prefs:hover,
.cps-btn--save:hover { border-color: var(--cps-accent); color: var(--cps-accent); }
.cps-btn--save { background: var(--cps-accent); color: #fff; border-color: var(--cps-accent); }

.cps-open-preferences { cursor: pointer; }

@keyframes cps-slide-up {
	from { opacity: 0; transform: translateX(-50%) translateY(24px); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes cps-pop {
	from { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
	to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Tabelle nelle policy generate */
.cps-policy-table {
	width: 100%;
	border-collapse: collapse;
	margin: 14px 0 22px;
	font-size: 14px;
}
.cps-policy-table th,
.cps-policy-table td {
	border: 1px solid #e6e9ef;
	padding: 9px 12px;
	text-align: left;
	vertical-align: top;
}
.cps-policy-table th { background: #f6f8fb; font-weight: 600; }
.cps-policy-table tr:nth-child(even) td { background: #fafbfc; }

@media (max-width: 680px) {
	.cps-pos-bottom { bottom: 12px; width: calc(100% - 20px); }
	.cps-banner__inner { padding: 18px; }
	.cps-banner__actions { width: 100%; }
	.cps-btn { flex: 1 1 calc(50% - 5px); text-align: center; }
}

/* ---- Link fluttuante "Preferenze cookie" (site-wide) ---- */
.cps-floating-prefs {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999998;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 13px;
	background: #1e293b;
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	border-radius: 999px;
	box-shadow: 0 6px 18px -6px rgba(15, 23, 42, .5);
	opacity: .82;
	transition: opacity .15s ease, transform .12s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.cps-floating-prefs:hover { opacity: 1; transform: translateY(-1px); }
.cps-floating-prefs__icon { display: inline-flex; }
@media (max-width: 600px) {
	.cps-floating-prefs__label { display: none; }
	.cps-floating-prefs { padding: 10px; }
}

/* Rispetta sempre l'attributo hidden (alcuni temi/regole display lo sovrascrivono). */
.cps-banner [hidden], .cps-banner[hidden] { display: none !important; }

/* Link nel footer del tema: eredita colori e font del footer. */
.cps-footer-links { clear: both; width: 100%; padding: 8px 0; font-size: 13px; line-height: 1.6; text-align: inherit; color: inherit; }
.cps-footer-links a { color: inherit; text-decoration: underline; }
.cps-floating-prefs[hidden] { display: none !important; }
