/**
 * Kreita Cookie & Privacy Compliance - stile del banner front-end.
 * I colori e le dimensioni sono pilotati dalle variabili CSS iniettate dal plugin.
 */

.kcc-banner {
	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	max-width: var(--kcc-width, 460px);
	width: calc(100% - 40px);
	background: var(--kcc-bg, #fff);
	color: var(--kcc-text, #1d2327);
	font-size: var(--kcc-font-size, 14px);
	line-height: 1.5;
	border-radius: var(--kcc-radius, 10px);
	padding: var(--kcc-padding, 24px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
	font-family: inherit;
}

.kcc-banner *,
.kcc-banner *::before,
.kcc-banner *::after {
	box-sizing: border-box;
}

.kcc-banner[hidden] {
	display: none;
}

/* --- Posizioni (layout box) --- */
.kcc-pos-bottom-left  { left: 20px;  bottom: 20px; }
.kcc-pos-bottom-right { right: 20px; bottom: 20px; }
.kcc-pos-bottom       { left: 50%; bottom: 20px; transform: translateX(-50%); }
.kcc-pos-top          { left: 50%; top: 20px;    transform: translateX(-50%); }
.kcc-pos-center       { left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* --- Layout: barra a tutta larghezza --- */
.kcc-layout-bar {
	max-width: none;
	width: 100%;
	left: 0;
	right: 0;
	border-radius: 0;
	transform: none;
}
.kcc-layout-bar.kcc-pos-top    { top: 0; bottom: auto; }
.kcc-layout-bar:not(.kcc-pos-top) { bottom: 0; top: auto; }
.kcc-layout-bar .kcc-banner__inner {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	max-width: 1200px;
	margin: 0 auto;
}
.kcc-layout-bar .kcc-banner__body { flex: 1 1 320px; }
.kcc-layout-bar .kcc-banner__actions { margin-top: 0; }

/* --- Layout: popup centrale --- */
.kcc-layout-popup {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	bottom: auto;
	right: auto;
}

/* --- Logo --- */
.kcc-banner__logo { margin-bottom: 12px; }
.kcc-banner__logo img {
	max-width: var(--kcc-logo-max-width, 140px);
	height: auto;
	display: block;
}

/* --- Testi --- */
.kcc-banner__title {
	margin: 0 0 8px;
	font-size: 1.25em;
	font-weight: 700;
	color: var(--kcc-text, #1d2327);
}
.kcc-banner__text { margin-bottom: 14px; }
.kcc-banner__text p { margin: 0 0 8px; }
.kcc-banner__text a,
.kcc-banner__links a {
	color: var(--kcc-link, #2563eb);
	text-decoration: underline;
}
.kcc-banner__links { font-size: 0.92em; }

/* --- Pannello impostazioni --- */
.kcc-banner__settings {
	margin: 4px 0 14px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	padding-top: 12px;
	max-height: 260px;
	overflow-y: auto;
}
.kcc-banner__settings[hidden] { display: none; }
.kcc-cat {
	display: block;
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.kcc-cat:last-child { border-bottom: 0; }
.kcc-cat__head {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}
.kcc-cat__toggle { margin: 0; }
.kcc-cat__name { flex: 1; }
.kcc-cat__badge {
	font-size: 0.75em;
	font-weight: 500;
	background: rgba(0, 0, 0, 0.07);
	border-radius: 10px;
	padding: 2px 8px;
}
.kcc-cat__desc {
	display: block;
	font-weight: 400;
	font-size: 0.9em;
	opacity: 0.8;
	margin-top: 4px;
	padding-left: 24px;
}

/* --- Pulsanti --- */
.kcc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}
.kcc-btn {
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	cursor: pointer;
	font-size: 1em;
	font-weight: 600;
	font-family: inherit;
	border-radius: 7px;
	padding: 10px 18px;
	transition: opacity 0.15s ease, transform 0.05s ease;
}
.kcc-btn:hover { opacity: 0.88; }
.kcc-btn:active { transform: translateY(1px); }
.kcc-btn--accept {
	background: var(--kcc-accept-bg, #2563eb);
	color: var(--kcc-accept-txt, #fff);
	flex: 1 1 auto;
}
.kcc-btn--reject,
.kcc-btn--settings {
	background: var(--kcc-reject-bg, #eef0f3);
	color: var(--kcc-reject-txt, #1d2327);
}
.kcc-btn--save {
	background: var(--kcc-accept-bg, #2563eb);
	color: var(--kcc-accept-txt, #fff);
	flex: 1 1 auto;
}

/* --- Overlay --- */
.kcc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 999998;
}
.kcc-overlay[hidden] { display: none; }

/* --- Pulsante "gestisci consenso" (shortcode) --- */
.kcc-manage-consent {
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	border: 1px solid currentColor;
	background: transparent;
	border-radius: 6px;
	padding: 8px 16px;
	font: inherit;
}

/* --- Pulsante flottante di gestione consenso --- */
.kcc-float-btn {
	position: fixed;
	bottom: 18px;
	z-index: 999990;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 46px;
	height: 46px;
	padding: 0 13px;
	border: 0;
	border-radius: 30px;
	cursor: pointer;
	background: var(--kcc-accept-bg, #2563eb);
	color: var(--kcc-accept-txt, #fff);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
}
.kcc-float-btn:hover { opacity: 0.9; }
.kcc-float-btn svg { display: block; }
.kcc-float-right { right: 18px; }
.kcc-float-left { left: 18px; }

/* --- Segnaposto per iframe bloccati --- */
.kcc-iframe-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 12px;
	background: #f3f4f6;
	color: #374151;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	padding: 24px;
	min-height: 180px;
	box-sizing: border-box;
}
.kcc-iframe-placeholder p { margin: 0; max-width: 420px; }
.kcc-iframe-placeholder button {
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	cursor: pointer;
	background: var(--kcc-accept-bg, #2563eb);
	color: var(--kcc-accept-txt, #fff);
	border-radius: 6px;
	padding: 9px 18px;
	font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 600px) {
	.kcc-banner:not(.kcc-layout-bar) {
		left: 10px;
		right: 10px;
		bottom: 10px;
		top: auto;
		width: auto;
		max-width: none;
		transform: none;
	}
	.kcc-banner__actions { flex-direction: column; }
	.kcc-btn { width: 100%; }
}
