/* ===================== COOKIE BANNER ===================== */

/* ---------- BANNER PRINCIPALE ---------- */
.ck-banner {
	position: fixed;
	bottom: 20px;
	left: 20px;
	right: 20px;
	z-index: 9998;
	max-width: 1100px;
	margin: 0 auto;
	background: #ffffff;
	border: 1px solid #e5e9ee;
	border-radius: 16px;
	box-shadow:
		0 20px 50px rgba(30, 60, 90, 0.14),
		0 4px 12px rgba(30, 60, 90, 0.06);
	transform: translateY(calc(100% + 40px));
	opacity: 0;
	visibility: hidden;
	transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .4s ease, visibility 0s linear .5s;
	overflow: hidden;
}
.ck-banner.is-visible {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
	transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .4s ease, visibility 0s;
}
@media (max-width: 767.98px) {
	.ck-banner {
		bottom: 12px;
		left: 12px;
		right: 12px;
		border-radius: 14px;
	}
}

/* Bordo gradient decorativo in alto */
.ck-banner::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, #00D4FF 0%, #1E9BD7 50%, #84CC16 100%);
}

.ck-banner-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 20px 24px;
}
@media (max-width: 991.98px) {
	.ck-banner-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		padding: 18px 20px;
	}
}
@media (max-width: 575.98px) {
	.ck-banner-inner { padding: 16px; gap: 14px; }
}

/* Contenuto sinistro */
.ck-banner-content {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	flex: 1;
	min-width: 0;
}

.ck-banner-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: linear-gradient(135deg, #eef6fd, #e8f5ee);
	color: #1E9BD7;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.ck-banner-icon svg { width: 24px; height: 24px; }
@media (max-width: 575.98px) {
	.ck-banner-icon { width: 38px; height: 38px; border-radius: 10px; }
	.ck-banner-icon svg { width: 20px; height: 20px; }
}

.ck-banner-text { min-width: 0; }

.ck-banner-title {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--text-dark, #2b2b2b);
	letter-spacing: -0.02em;
	margin: 0 0 6px;
	line-height: 1.2;
}
@media (max-width: 575.98px) {
	.ck-banner-title { font-size: 0.98rem; }
}

.ck-banner-desc {
	font-size: 0.85rem;
	color: #6b7280;
	line-height: 1.55;
	margin: 0;
}
.ck-banner-desc a,
.ck-banner-link {
	color: #1E9BD7;
	font-weight: 600;
	text-decoration: none;
	transition: color .2s ease;
}
.ck-banner-desc a:hover,
.ck-banner-link:hover { color: #0A6FA8; text-decoration: underline; }
@media (max-width: 575.98px) {
	.ck-banner-desc { font-size: 0.8rem; }
}

/* Azioni destra */
.ck-banner-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}
@media (max-width: 991.98px) {
	.ck-banner-actions {
		width: 100%;
		justify-content: stretch;
	}
	.ck-banner-actions .ck-btn { flex: 1; }
}
@media (max-width: 575.98px) {
	.ck-banner-actions { flex-direction: column-reverse; }
}

/* ---------- BOTTONI ---------- */
.ck-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 10px;
	font-family: var(--font-body, sans-serif);
	font-size: 0.88rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1;
	cursor: pointer;
	border: 1.5px solid transparent;
	transition: background .25s ease, border-color .25s ease, color .25s ease, transform .2s ease, box-shadow .25s ease;
	white-space: nowrap;
}
@media (max-width: 991.98px) {
	.ck-btn { padding: 11px 18px; font-size: 0.85rem; }
}
@media (max-width: 575.98px) {
	.ck-btn { width: 100%; padding: 13px 18px; font-size: 0.88rem; }
}

.ck-btn-primary {
	background: linear-gradient(135deg, #00D4FF 0%, #1E9BD7 60%, #0A4F8F 100%);
	color: #fff;
	box-shadow: 0 6px 16px rgba(30, 155, 215, 0.3);
}
.ck-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(30, 155, 215, 0.45);
	filter: brightness(1.05);
}

.ck-btn-secondary {
	background: #ffffff;
	color: var(--text-dark, #2b2b2b);
	border-color: #d0d8e2;
}
.ck-btn-secondary:hover {
	background: #f5f7f9;
	border-color: #1E9BD7;
	color: #1E9BD7;
}

/* Ghost: stesso peso visivo del primary, no dark pattern */
.ck-btn-ghost {
	background: #ffffff;
	color: var(--text-dark, #2b2b2b);
	border-color: #d0d8e2;
}
.ck-btn-ghost:hover {
	background: #f5f7f9;
	border-color: #1a1a1a;
	color: #1a1a1a;
}

/* ---------- MODAL PREFERENZE ---------- */
.ck-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.ck-modal[hidden] { display: none; }

.ck-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 25, 40, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	animation: ckFadeIn .3s ease;
}
@keyframes ckFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.ck-modal-content {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 620px;
	max-height: calc(100vh - 40px);
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 30px 80px rgba(15, 25, 40, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: ckSlideUp .4s cubic-bezier(.2,.7,.2,1);
}
@keyframes ckSlideUp {
	from { transform: translateY(30px) scale(.98); opacity: 0; }
	to   { transform: translateY(0) scale(1); opacity: 1; }
}
@media (max-width: 575.98px) {
	.ck-modal { padding: 12px; }
	.ck-modal-content { max-height: calc(100vh - 24px); border-radius: 14px; }
}

/* Header modal */
.ck-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 18px;
	border-bottom: 1px solid #eef3f8;
	position: relative;
}
.ck-modal-header::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, #00D4FF 0%, #1E9BD7 50%, #84CC16 100%);
}
@media (max-width: 575.98px) {
	.ck-modal-header { padding: 18px 18px 14px; }
}

.ck-modal-title {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--text-dark, #2b2b2b);
	letter-spacing: -0.025em;
	margin: 0 0 4px;
	line-height: 1.2;
}
.ck-modal-subtitle {
	font-size: 0.82rem;
	color: #7a8a9a;
	margin: 0;
	line-height: 1.45;
}

.ck-modal-close {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid #e5e9ee;
	background: #ffffff;
	color: #6b7280;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: background .2s ease, color .2s ease, transform .25s ease;
}
.ck-modal-close svg { width: 15px; height: 15px; }
.ck-modal-close:hover {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #ffffff;
	transform: rotate(90deg);
}
@media (max-width: 575.98px) {
	.ck-modal-close { width: 34px; height: 34px; }
}

/* Body modal */
.ck-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 18px 24px;
	-webkit-overflow-scrolling: touch;
}
@media (max-width: 575.98px) {
	.ck-modal-body { padding: 14px 18px; }
}

/* Item preferenza */
.ck-pref-item {
	padding: 16px 0;
	border-bottom: 1px solid #f2f4f6;
}
.ck-pref-item:last-child { border-bottom: none; padding-bottom: 6px; }
.ck-pref-item:first-child { padding-top: 6px; }

.ck-pref-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.ck-pref-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	flex: 1;
}

.ck-pref-name {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--text-dark, #2b2b2b);
	letter-spacing: -0.015em;
	line-height: 1.25;
}

.ck-pref-desc {
	font-size: 0.8rem;
	color: #7a8a9a;
	line-height: 1.5;
}

.ck-pref-badge {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	background: #eef6fd;
	color: #0A6FA8;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Toggle switch */
.ck-toggle {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 28px;
	flex-shrink: 0;
	cursor: pointer;
}
.ck-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}
.ck-toggle-slider {
	position: absolute;
	inset: 0;
	background: #d5dde5;
	border-radius: 999px;
	transition: background .25s ease;
}
.ck-toggle-slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.ck-toggle input:checked + .ck-toggle-slider {
	background: linear-gradient(135deg, #00D4FF, #1E9BD7);
}
.ck-toggle input:checked + .ck-toggle-slider::before {
	transform: translateX(20px);
}
.ck-toggle input:focus-visible + .ck-toggle-slider {
	box-shadow: 0 0 0 3px rgba(30, 155, 215, 0.25);
}
.ck-toggle input:disabled + .ck-toggle-slider {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Footer modal */
.ck-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding: 18px 24px;
	border-top: 1px solid #eef3f8;
	background: #fafbfc;
}
@media (max-width: 575.98px) {
	.ck-modal-footer {
		padding: 14px 18px;
		flex-direction: column-reverse;
	}
	.ck-modal-footer .ck-btn { width: 100%; }
}

/* Scrollbar custom per il body del modal */
.ck-modal-body::-webkit-scrollbar { width: 8px; }
.ck-modal-body::-webkit-scrollbar-track { background: #f2f4f6; border-radius: 4px; }
.ck-modal-body::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}
.ck-modal-body::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---------- PULSANTE FLOTTANTE DI RIAVVIO (opzionale) ---------- */
.ck-reopen {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 9997;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid #e5e9ee;
	color: #6b7280;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(30, 60, 90, 0.12);
	transition: background .25s ease, color .25s ease, transform .25s ease;
}
.ck-reopen svg { width: 20px; height: 20px; }
.ck-reopen:hover {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #ffffff;
	transform: translateY(-2px);
}
.ck-reopen.is-visible { display: flex; }
@media (max-width: 575.98px) {
	.ck-reopen { bottom: 12px; left: 12px; width: 40px; height: 40px; }
}

/* ---------- ACCESSIBILITÀ ---------- */
@media (prefers-reduced-motion: reduce) {
	.ck-banner,
	.ck-banner.is-visible,
	.ck-modal-content,
	.ck-modal-overlay,
	.ck-btn,
	.ck-toggle-slider,
	.ck-toggle-slider::before {
		transition: none !important;
		animation: none !important;
	}
}
/* Mobile consent: clear choices in one compact, equal-weight row. */
@media (max-width: 575.98px) {
 .ck-banner { bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; right: 8px; border-radius: 12px; }
 .ck-banner-inner { padding: 12px; gap: 10px; }
 .ck-banner-content { gap: 0; }
 .ck-banner-icon { display: none; }
 .ck-banner-title { font-size: .92rem; margin-bottom: 4px; }
 .ck-banner-desc { font-size: .74rem; line-height: 1.42; color: #465462; }
 .ck-banner-desc a { color: #086eaa; }
 .ck-banner-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; width: 100%; }
 .ck-banner-actions .ck-btn { min-height: 44px; padding: 6px 4px; font-size: .7rem; line-height: 1.2; white-space: normal; box-shadow: none; border-radius: 8px; }
}
