/* ==========================================================================
   Banner cookie — usa i token di main.css, mai colori scritti qui.
   "Rifiuta" e "Accetta tutti" hanno lo stesso peso visivo (Garante 2021).
   ========================================================================== */

.gw-cookie {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 200;
	background: var(--gw-paper);
	color: var(--gw-ink);
	border-top: 1px solid var(--gw-ink-14);
	box-shadow: 0 -14px 44px rgba(28, 23, 20, 0.18);
	font-family: var(--gw-font-sans);
}

.gw-cookie__inner {
	max-width: var(--gw-width-mid);
	margin: 0 auto;
	padding: 18px var(--gw-gutter) 20px;
	display: grid;
	gap: 14px;
}

@media (min-width: 920px) {
	.gw-cookie__inner {
		grid-template-columns: 1fr auto;
		align-items: center;
	}
	.gw-cookie__prefs {
		grid-column: 1 / -1;
	}
}

/* p.gw-cookie__title da solo perde contro ".gw-cookie__text p" (specificità):
   il titolo è rimasto per settimane a 13px proprio per questo. */
.gw-cookie__text p.gw-cookie__title {
	margin: 0 0 6px;
	font-family: var(--gw-font-serif);
	font-size: 2rem;
	line-height: 1.1;
	color: var(--gw-ink);
}

.gw-cookie__text p {
	margin: 0;
	font-size: var(--gw-text-s);
	line-height: 1.6;
	color: var(--gw-ink-72);
	max-width: 72ch;
}

.gw-cookie__text a {
	color: var(--gw-primary);
}

/* --- Pulsanti --------------------------------------------------------- */

.gw-cookie__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.gw-cookie__btn {
	font: 600 13px/1 var(--gw-font-sans);
	letter-spacing: 0.02em;
	padding: 12px 24px;
	border-radius: var(--gw-radius);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.gw-cookie__btn:focus-visible {
	outline: 2px solid var(--gw-gold);
	outline-offset: 2px;
}

.gw-cookie__btn--reject {
	background: var(--gw-ink);
	color: var(--gw-paper);
}

.gw-cookie__btn--reject:hover {
	background: var(--gw-base);
}

.gw-cookie__btn--accept,
.gw-cookie__btn--save {
	background: var(--gw-primary);
	color: #fff;
}

.gw-cookie__btn--accept:hover,
.gw-cookie__btn--save:hover {
	background: var(--gw-primary-dark);
}

.gw-cookie__btn--ghost {
	background: none;
	color: var(--gw-ink-72);
	padding-inline: 8px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gw-cookie__btn--ghost:hover {
	color: var(--gw-ink);
}

@media (max-width: 560px) {
	.gw-cookie__btn--reject,
	.gw-cookie__btn--accept,
	.gw-cookie__btn--save {
		flex: 1 1 40%;
	}
}

/* --- Pannello preferenze ---------------------------------------------- */

.gw-cookie__prefs {
	border-top: 1px solid var(--gw-ink-08);
	padding-top: 14px;
	display: grid;
	gap: 12px;
}

.gw-cookie__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	font-size: var(--gw-text-s);
}

.gw-cookie__row strong {
	display: block;
	font-weight: 700;
}

.gw-cookie__row span {
	color: var(--gw-ink-60);
}

.gw-cookie__always {
	font-size: var(--gw-text-xs);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gw-numeral);
	white-space: nowrap;
}

/* Interruttore: checkbox nativa vestita, resta accessibile da tastiera. */
.gw-switch {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	width: 42px;
	height: 24px;
	margin: 0;
	border-radius: 12px;
	background: var(--gw-ink-25);
	position: relative;
	cursor: pointer;
	transition: background 0.2s;
}

.gw-switch::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s;
}

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

.gw-switch:checked::after {
	transform: translateX(18px);
}

.gw-switch:focus-visible {
	outline: 2px solid var(--gw-gold);
	outline-offset: 2px;
}

/* --- Link di revoca nel footer ----------------------------------------- */

.gw-footer__cookies {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
