/* Cookie WIDO */
.cw-banner {
	position: fixed;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	z-index: 999999;
	box-sizing: border-box;
	width: min(640px, calc(100% - 32px));
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 20px 24px;
	background: var(--cw-bg, #fff);
	color: var(--cw-text, #1f2328);
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
	font-size: 15px;
	line-height: 1.5;
}
.cw-banner[hidden],
.cw-banner [hidden],
.cw-fab[hidden] { display: none !important; }

.cw-banner * { box-sizing: border-box; }
.cw-banner p { margin: 0 0 12px; }

.cw-title {
	font-weight: 700;
	font-size: 17px;
	padding-right: 28px;
}
.cw-text a { color: inherit; text-decoration: underline; }

.cw-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: .7;
}
.cw-close:hover { opacity: 1; }

/* Categorie */
.cw-panel { margin: 4px 0 12px; }
.cw-cat {
	display: block;
	padding: 10px 0;
	border-top: 1px solid rgba(128, 128, 128, .25);
	cursor: pointer;
}
.cw-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-weight: 600;
}
.cw-cat__desc { display: block; font-size: 13px; opacity: .8; margin-top: 2px; }

.cw-switch {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	position: relative;
	width: 40px;
	height: 22px;
	margin: 0;
	border-radius: 11px;
	background: rgba(128, 128, 128, .45);
	cursor: pointer;
	transition: background .15s;
}
.cw-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform .15s;
}
.cw-switch:checked { background: var(--cw-accent, #1f2328); }
.cw-switch:checked::after { transform: translateX(18px); }
.cw-switch:disabled { opacity: .55; cursor: default; }
.cw-switch:focus-visible { outline: 2px solid var(--cw-accent, #1f2328); outline-offset: 2px; }

/* Pulsanti: Rifiuta e Accetta con lo stesso peso */
.cw-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}
.cw-btn {
	flex: 1 1 140px;
	padding: 10px 16px;
	border: 2px solid var(--cw-accent, #1f2328);
	border-radius: 8px;
	background: var(--cw-accent, #1f2328);
	color: var(--cw-btn-text, #fff);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.cw-btn--outline {
	background: transparent;
	color: var(--cw-text, #1f2328);
}
.cw-btn:hover { filter: brightness(1.1); }
.cw-btn:focus-visible,
.cw-close:focus-visible,
.cw-fab:focus-visible { outline: 2px solid var(--cw-accent, #1f2328); outline-offset: 2px; }

/* Icona preferenze */
.cw-fab {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--cw-accent, #1f2328);
	color: var(--cw-btn-text, #fff);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
	cursor: pointer;
	opacity: .85;
}
.cw-fab:hover { opacity: 1; }

/* Riquadro al posto di mappe e video */
.cw-embed {
	position: relative;
	min-height: 200px;
}
.cw-embed > iframe { display: block; }
.cw-embed__msg {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 20px;
	background: #eef0f2;
	color: #1f2328;
	text-align: center;
	font-size: 15px;
	line-height: 1.5;
}
.cw-embed__msg p { margin: 0; max-width: 420px; }
.cw-embed__btn {
	padding: 10px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--cw-accent, #1f2328);
	color: var(--cw-btn-text, #fff);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.cw-embed--on .cw-embed__msg { display: none; }

/* Widget Video di Elementor bloccato */
.cw-video-wrap {
	position: relative;
	min-height: 200px;
}
.cw-video-wrap > .cw-embed__msg { z-index: 2; }

@media (max-width: 480px) {
	.cw-banner { padding: 16px; bottom: 8px; width: calc(100% - 16px); }
	.cw-btn { flex-basis: 100%; }
}

/* Cookie policy */
.cw-policy__table { overflow-x: auto; margin: 0 0 1.5em; }
.cw-policy table { width: 100%; border-collapse: collapse; font-size: .92em; }
.cw-policy th,
.cw-policy td { padding: 8px 10px; border: 1px solid rgba(128, 128, 128, .3); text-align: left; vertical-align: top; }
.cw-policy th { background: rgba(128, 128, 128, .08); }
.cw-policy__prefs { font-weight: 600; }
@media (max-width: 640px) {
	.cw-policy thead { display: none; }
	.cw-policy table, .cw-policy tbody, .cw-policy tr, .cw-policy td { display: block; width: 100%; }
	.cw-policy tr { margin-bottom: 12px; border: 1px solid rgba(128, 128, 128, .3); }
	.cw-policy td { border: 0; border-bottom: 1px solid rgba(128, 128, 128, .15); }
	.cw-policy td::before { content: attr(data-label); display: block; font-weight: 600; font-size: .85em; opacity: .75; }
}
