/* Gracocem Consent – banner e centro preferenze */
:root {
	--gcc-primary: #1677b3;
	--gcc-text: #1f2933;
	--gcc-bg: #ffffff;
	--gcc-radius: 6px;
	--gcc-muted: #52606d;
	--gcc-border: #d9e2ec;
}

.gcc-banner,
.gcc-overlay,
.gcc-placeholder {
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--gcc-text);
	box-sizing: border-box;
}

.gcc-banner *,
.gcc-overlay *,
.gcc-placeholder * {
	box-sizing: border-box;
}

/* ---------- Banner ---------- */
.gcc-banner {
	position: fixed;
	z-index: 2147483000;
	background: var(--gcc-bg);
	box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.15);
	padding: 20px 56px 20px 24px;
	display: flex;
	gap: 16px 32px;
	align-items: center;
}

.gcc-layout-bar {
	left: 0;
	right: 0;
	bottom: 0;
}

.gcc-layout-box {
	left: 16px;
	bottom: 16px;
	max-width: 440px;
	flex-direction: column;
	align-items: stretch;
	border-radius: var(--gcc-radius);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.gcc-content {
	flex: 1 1 auto;
	max-width: 900px;
}

.gcc-title {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--gcc-text);
	line-height: 1.3;
}

.gcc-desc {
	margin: 0;
}

.gcc-policy {
	color: var(--gcc-primary);
	text-decoration: underline;
}

/* ---------- Pulsanti: tutti identici (Garante 2021) ---------- */
.gcc-actions {
	display: flex;
	gap: 10px;
	flex: 0 0 auto;
	flex-wrap: wrap;
}

.gcc-btn {
	appearance: none;
	font: inherit;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.2;
	min-width: 140px;
	min-height: 44px;
	padding: 10px 18px;
	border: 2px solid var(--gcc-primary);
	border-radius: var(--gcc-radius);
	background: var(--gcc-primary);
	color: #fff;
	cursor: pointer;
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
}

.gcc-btn:hover {
	filter: brightness(0.92);
}

.gcc-btn:focus-visible,
.gcc-close:focus-visible,
.gcc-switch:focus-visible,
.gcc-policy:focus-visible {
	outline: 3px solid var(--gcc-text);
	outline-offset: 2px;
}

.gcc-layout-box .gcc-actions .gcc-btn {
	flex: 1 1 0;
	min-width: 0;
}

.gcc-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--gcc-text);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	border-radius: var(--gcc-radius);
	padding: 0;
}

.gcc-close:hover {
	background: rgba(0, 0, 0, 0.06);
}

/* ---------- Centro preferenze ---------- */
.gcc-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(15, 23, 42, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

html.gcc-panel-open {
	overflow: hidden;
}

.gcc-panel {
	position: relative;
	background: var(--gcc-bg);
	border-radius: var(--gcc-radius);
	width: 100%;
	max-width: 600px;
	max-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.gcc-panel-head {
	padding: 20px 56px 12px 24px;
	border-bottom: 1px solid var(--gcc-border);
}

.gcc-panel-head .gcc-title {
	margin: 0;
}

.gcc-panel-body {
	padding: 8px 24px;
	overflow-y: auto;
}

.gcc-panel .gcc-actions {
	padding: 16px 24px 20px;
	border-top: 1px solid var(--gcc-border);
}

.gcc-panel .gcc-actions .gcc-btn {
	flex: 1 1 0;
	min-width: 0;
}

.gcc-category {
	padding: 14px 0;
	border-bottom: 1px solid var(--gcc-border);
}

.gcc-category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.gcc-category-name {
	font-weight: 700;
	cursor: pointer;
}

.gcc-category-desc,
.gcc-services,
.gcc-note {
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--gcc-muted);
}

.gcc-note {
	font-style: italic;
}

.gcc-always {
	font-size: 13px;
	font-weight: 600;
	color: var(--gcc-muted);
}

.gcc-meta {
	font-size: 13px;
	color: var(--gcc-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 14px 0 6px;
}

.gcc-id {
	word-break: break-all;
}

/* Interruttore */
.gcc-switch {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
	margin: 0;
	border-radius: 13px;
	background: #9aa5b1;
	position: relative;
	cursor: pointer;
	transition: background 0.15s;
}

.gcc-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s;
}

.gcc-switch:checked {
	background: var(--gcc-primary);
}

.gcc-switch:checked::after {
	transform: translateX(20px);
}

.gcc-switch:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

/* ---------- Segnaposto per iframe bloccati ---------- */
.gcc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 200px;
	padding: 24px;
	background: #f0f4f8;
	border: 1px dashed #9aa5b1;
	border-radius: var(--gcc-radius);
	text-align: center;
}

.gcc-placeholder p {
	margin: 0;
	max-width: 420px;
}

/* ---------- Tabella cookie (shortcode) ---------- */
.gcc-cookie-table-wrap {
	overflow-x: auto;
}

.gcc-cookie-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.gcc-cookie-table th,
.gcc-cookie-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid var(--gcc-border);
	vertical-align: top;
}

/* ---------- Mobile ---------- */
@media (max-width: 782px) {
	.gcc-banner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px 16px 16px;
		max-height: 60vh;
		overflow-y: auto;
	}

	.gcc-layout-box {
		left: 8px;
		right: 8px;
		bottom: 8px;
		max-width: none;
	}

	.gcc-content {
		padding-right: 32px;
	}

	.gcc-actions {
		flex-direction: column;
	}

	.gcc-actions .gcc-btn,
	.gcc-panel .gcc-actions .gcc-btn,
	.gcc-layout-box .gcc-actions .gcc-btn {
		width: 100%;
		flex: 0 0 auto;
	}

	.gcc-desc {
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gcc-switch,
	.gcc-switch::after {
		transition: none;
	}
}

@media print {
	.gcc-banner,
	.gcc-overlay {
		display: none !important;
	}
}
