/* Banner dei cookie, pannello delle preferenze, mappe con consenso, link legali nel footer. */

/* ---------- Banner ---------- */
.cg-cc {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 100000;
	width: calc(100% - 40px);
	max-width: 470px;
}
.cg-cc[hidden], .cg-cc-prefs[hidden] { display: none !important; }
.cg-cc__box, .cg-cc-prefs__box {
	position: relative;
	padding: 26px 30px 26px;
	border-top: 4px solid var(--cg-secondary, #b1d462);
	border-radius: 5px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
	color: var(--cg-primary, #091d3e);
	font-family: Rubik, sans-serif;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.6;
	text-align: left;
}
.cg-cc__title {
	margin: 0 0 10px;
	padding-right: 34px;
	color: var(--cg-primary, #091d3e);
	font-family: Jost, sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}
.cg-cc__text { margin: 0 0 18px; color: #1f2a3a; }
.cg-cc__text a { color: var(--cg-primary, #091d3e); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.cg-cc__text a:hover, .cg-cc__text a:focus { color: var(--cg-accent, #33b9cb); }
.cg-cc__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cg-primary, #091d3e);
	font-family: Rubik, sans-serif;
	font-size: 28px;
	font-weight: 300;
	line-height: 40px;
	text-align: center;
	cursor: pointer;
	transition: background .3s;
}
.cg-cc__close:hover, .cg-cc__close:focus-visible { background: #f2f2f2; }
.cg-cc__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cg-cc__btn {
	flex: 1 1 auto;
	min-height: 46px;
	margin: 0;
	padding: 12px 18px;
	border: 2px solid transparent;
	border-radius: 5px;
	font-family: Rubik, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .3s, color .3s, border-color .3s;
}
.cg-cc__btn--accept { border-color: var(--cg-secondary, #b1d462); background: var(--cg-secondary, #b1d462); color: var(--cg-primary, #091d3e); }
.cg-cc__btn--accept:hover, .cg-cc__btn--accept:focus-visible { border-color: var(--cg-primary, #091d3e); background: var(--cg-primary, #091d3e); color: #fff; }
.cg-cc__btn--reject { border-color: var(--cg-primary, #091d3e); background: var(--cg-primary, #091d3e); color: #fff; }
.cg-cc__btn--reject:hover, .cg-cc__btn--reject:focus-visible { border-color: var(--cg-secondary, #b1d462); background: var(--cg-secondary, #b1d462); color: var(--cg-primary, #091d3e); }
.cg-cc__btn--prefs { border-color: var(--cg-primary, #091d3e); background: #fff; color: var(--cg-primary, #091d3e); }
.cg-cc__btn--prefs:hover, .cg-cc__btn--prefs:focus-visible { background: #f2f6f7; }
.cg-cc__close:focus-visible, .cg-cc__btn:focus-visible, .cg-cc-switch:focus-visible, .cg-map__btn:focus-visible, .cg-map__link:focus-visible {
	outline: 3px solid var(--cg-accent, #33b9cb);
	outline-offset: 2px;
}

/* ---------- Pannello delle preferenze ---------- */
.cg-cc-prefs {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.cg-cc-prefs__backdrop { position: absolute; inset: 0; background: rgba(9, 29, 62, .6); }
.cg-cc-prefs__box {
	width: 100%;
	max-width: 620px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	overflow-y: auto;
	padding: 30px 32px 28px;
	outline: 0;
}
.cg-cc-cat { margin: 0 0 12px; padding: 14px 18px; border: 1px solid #e3e3e3; border-radius: 5px; }
.cg-cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cg-cc-cat__name { color: var(--cg-primary, #091d3e); font-family: Jost, sans-serif; font-size: 18px; font-weight: 600; line-height: 1.3; cursor: pointer; }
span.cg-cc-cat__name { cursor: default; }
.cg-cc-cat__always { color: #4a6b2a; font-size: 14px; font-weight: 500; white-space: nowrap; }
.cg-cc-cat__desc { margin: 6px 0 0; color: #333; font-size: 14px; line-height: 1.55; }
.cg-cc-prefs .cg-cc__actions { margin-top: 18px; }
.cg-cc-switch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: 0 0 auto;
	width: 48px;
	height: 26px;
	margin: 0;
	border-radius: 13px;
	background: #7a8591;
	cursor: pointer;
	transition: background-color .25s;
}
.cg-cc-switch::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: transform .25s;
}
.cg-cc-switch:checked { background: #5f8a1e; }
.cg-cc-switch:checked::before { transform: translateX(22px); }
html.cg-cc-modal { overflow: hidden; }

/* Smartphone: banner a tutta larghezza, il pulsante WhatsApp sale sopra il banner finché è aperto. */
@media (max-width: 767px) {
	.cg-cc { right: 10px; bottom: 10px; left: 10px; width: auto; max-width: none; }
	.cg-cc__box { padding: 20px 18px 18px; font-size: 14px; }
	.cg-cc__title { font-size: 20px; }
	.cg-cc__text { margin-bottom: 14px; }
	.cg-cc__btn { padding: 10px 12px; font-size: 15px; }
	.cg-cc__actions .cg-cc__btn--prefs { flex-basis: 100%; }
	.cg-cc__actions .cg-cc__btn--reject, .cg-cc__actions .cg-cc__btn--accept { flex: 1 1 calc(50% - 5px); }
	.cg-cc-prefs { padding: 10px; }
	.cg-cc-prefs__box { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); padding: 22px 18px 18px; }
	html.cg-cc-open .joinchat { --bottom: calc(var(--cg-cc-h, 0px) + 20px) !important; }
}

/* ---------- Mappa di Google con consenso ---------- */
.cg-map { position: relative; }
.cg-map iframe {
	width: 100%;
	max-width: 100%;
	height: var(--cg-map-h);
	border: 0;
	filter: brightness(100%) contrast(100%) saturate(0%) blur(0) hue-rotate(0deg);
	transition-duration: .3s;
}
.cg-map:not(.cg-map--gray) iframe { filter: none; }
.cg-map--gray:hover iframe { filter: brightness(100%) contrast(100%) saturate(100%) blur(0) hue-rotate(0deg); }
/* Il segnaposto occupa lo stesso spazio dell'iframe (stessa riga di testo, stessa altezza). */
.cg-map__ph {
	display: inline-block;
	overflow: hidden;
	width: 100%;
	height: var(--cg-map-h);
	vertical-align: baseline;
	background: #e6eff0;
	color: var(--cg-primary, #091d3e);
}
@media (max-width: 1024px) {
	.cg-map iframe, .cg-map__ph { height: var(--cg-map-h-t); }
}
@media (max-width: 767px) {
	.cg-map iframe, .cg-map__ph { height: var(--cg-map-h-m); }
}
.cg-map__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	height: 100%;
	padding: 24px;
	text-align: center;
}
.cg-map__icon { color: var(--cg-accent, #33b9cb); font-size: 40px; }
.cg-map__text { max-width: 380px; margin: 0; font-family: Rubik, sans-serif; font-size: 15px; font-weight: 400; line-height: 1.6; }
.cg-map__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px; }
.cg-map__btn {
	padding: 13px 26px;
	border: 0;
	border-radius: 5px;
	background: var(--cg-secondary, #b1d462);
	color: var(--cg-primary, #091d3e);
	font-family: Rubik, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .3s, color .3s;
}
.cg-map__btn:hover { background: var(--cg-primary, #091d3e); color: #fff; }
.cg-map__link { color: var(--cg-primary, #091d3e); font-family: Rubik, sans-serif; font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.cg-map__link:hover { color: var(--cg-accent, #33b9cb); }

/* ---------- Link legali sotto il copyright ---------- */
.copyright .cg-legal {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px 0;
	margin-top: 6px;
	font-size: 14px;
	line-height: 1.5;
}
.copyright .cg-legal a { color: rgba(255, 255, 255, .8); }
.copyright .cg-legal a:hover, .copyright .cg-legal a:focus { color: var(--cg-accent, #33b9cb); }
.copyright .cg-legal a + a::before {
	content: "|";
	display: inline-block;
	margin: 0 10px;
	color: rgba(255, 255, 255, .35);
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.cg-cc-switch, .cg-cc-switch::before, .cg-cc__btn, .cg-map iframe { transition: none; }
}

/* ---------- Pagina Cookie Policy (contenuto dentro <div class="cg-policy">) ---------- */
.cg-policy h2 { margin: 45px 0 15px; font-size: 32px; }
.cg-policy > h2:first-of-type { margin-top: 35px; }
.cg-policy p { margin-bottom: 18px; }
.cg-policy a { text-decoration: underline; text-underline-offset: 2px; }
.cg-policy .cg-policy-update { margin-bottom: 25px; color: #5a6472; font-size: 15px; }
.cg-policy-box { margin: 0 0 10px; padding: 25px 30px; border-left: 4px solid var(--cg-secondary, #b1d462); border-radius: 5px; background: var(--cg-light, #f8f8f8); }
.cg-policy-box p { margin-bottom: 8px; color: var(--cg-primary, #091d3e); }
.cg-policy-box ul { margin: 0 0 0 20px; }
.cg-policy-box li { margin: 4px 0; }
.cg-policy ul { margin: 0 0 18px 22px; }
.cg-policy li { margin: 6px 0; }
.cg-policy strong { font-weight: 500; }
@media (max-width: 767px) {
	.cg-policy-box { padding: 20px; }
}
.cg-cookie-table {
	width: 100%;
	margin: 10px 0 25px;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.6;
}
.cg-cookie-table th, .cg-cookie-table td { padding: 10px 14px; border: 1px solid #e3e3e3; text-align: left; vertical-align: top; }
.cg-cookie-table th { background: var(--cg-light, #f8f8f8); color: var(--cg-primary, #091d3e); font-weight: 500; }
.cg-cookie-table td:first-child { color: var(--cg-primary, #091d3e); font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 767px) {
	.cg-policy h2 { margin-top: 35px; font-size: 26px; }
	.cg-cookie-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.cg-cookie-table, .cg-cookie-table tbody, .cg-cookie-table tr, .cg-cookie-table td { display: block; width: 100%; }
	.cg-cookie-table tr { margin: 0 0 14px; border: 1px solid #e3e3e3; border-radius: 5px; }
	.cg-cookie-table td { padding: 8px 14px; border: 0; border-top: 1px solid #eee; }
	.cg-cookie-table td:first-child { border-top: 0; }
	.cg-cookie-table td::before { content: attr(data-label); display: block; color: #5a6472; font-size: 13px; font-weight: 500; }
}
