/* Banner cookie "Udienza sui biscotti". Solo transform e opacity per le animazioni. */

.adr-cookie {
	--ck-ink: var(--aadr-ebano, #231f1d);
	--ck-bronze: var(--aadr-bronzo, #8a5a2e);
	--ck-bronze-light: var(--aadr-bronzo-chiaro, #d9a66c);
	--ck-paper: #fffaf3;
	--ck-stamp: #a2452c;
	position: fixed;
	z-index: 99999;
	left: 20px;
	bottom: 20px;
	width: min(420px, calc(100vw - 32px));
	font-family: var(--aadr-font-sans, 'ADR Manrope', system-ui, sans-serif);
	color: var(--ck-ink);
	opacity: 0;
	transform: translateY(24px) scale(.98);
	transition: opacity 450ms cubic-bezier(.22, 1, .36, 1), transform 450ms cubic-bezier(.22, 1, .36, 1);
}

.adr-cookie[hidden] {
	display: none;
}

.adr-cookie.is-open {
	opacity: 1;
	transform: none;
}

.adr-cookie.is-leaving {
	opacity: 0;
	transform: translateY(40px) rotate(-2deg);
}

.adr-cookie__card {
	position: relative;
	overflow: hidden;
	padding: 22px 22px 16px;
	border: 1px solid rgba(138, 90, 46, .28);
	border-radius: 22px;
	background-color: var(--ck-paper);
	background-image:
		repeating-linear-gradient(0deg, rgba(138, 90, 46, .05) 0, rgba(138, 90, 46, .05) 1px, transparent 1px, transparent 26px),
		linear-gradient(90deg, transparent 0, transparent 46px, rgba(162, 69, 44, .14) 46px, rgba(162, 69, 44, .14) 47px, transparent 47px);
	box-shadow: 0 2px 6px rgba(35, 31, 29, .06), 0 30px 70px rgba(35, 31, 29, .28);
}

.adr-cookie__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ck-ink);
	cursor: pointer;
}

.adr-cookie__close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.adr-cookie__close:hover {
	background: rgba(138, 90, 46, .1);
}

.adr-cookie__head {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-right: 32px;
}

.adr-cookie__art {
	position: relative;
	flex: 0 0 62px;
	width: 62px;
	height: 62px;
	overflow: hidden;
	border: 1px solid rgba(138, 90, 46, .18);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 6px 16px rgba(35, 31, 29, .1);
}

/* Foto del martelletto sui biscotti: piccola, con un "colpo" leggero all'apertura. */
.adr-cookie__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform-origin: 50% 80%;
}

.adr-cookie.is-open .adr-cookie__photo {
	animation: adr-ck-tap 4.2s ease-in-out 350ms infinite;
}

.adr-cookie__dough {
	fill: #d9a66c;
	stroke: #a8733d;
	stroke-width: 2;
}

.adr-cookie__chip {
	fill: #4a2f1c;
}

.adr-cookie__kicker {
	margin: 0 0 2px;
	color: var(--ck-bronze);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .16em;
	text-transform: uppercase;
}

.adr-cookie__title {
	margin: 0;
	font-family: var(--aadr-font-serif, 'ADR Cormorant', Georgia, serif);
	font-size: 28px;
	font-weight: 600;
	line-height: 1.05;
	color: var(--ck-ink);
}

.adr-cookie__text {
	margin: 14px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: #4a433e;
}

.adr-cookie__text strong {
	color: var(--ck-ink);
}

.adr-cookie__prefs {
	margin-top: 12px;
}

.adr-cookie__prefs[hidden] {
	display: none;
}

.adr-cookie__prefs fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

.adr-cookie__legend {
	margin-bottom: 4px;
	padding: 0;
	color: var(--ck-bronze);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.adr-cookie__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 10px 0;
	border-top: 1px dashed rgba(138, 90, 46, .3);
	cursor: pointer;
}

.adr-cookie__row span {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 14px;
}

.adr-cookie__row small {
	color: #6b625b;
	font-size: 12px;
	line-height: 1.4;
}

.adr-cookie__switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 26px;
	margin: 0;
	border-radius: 999px;
	background: #d8cbbb;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: background-color 250ms ease;
}

.adr-cookie__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 4px rgba(35, 31, 29, .25);
	transition: transform 250ms cubic-bezier(.22, 1, .36, 1);
}

.adr-cookie__switch:checked {
	background: linear-gradient(145deg, #e2b47c, #b07a43 55%, #8a5a2e);
}

.adr-cookie__switch:checked::after {
	transform: translateX(18px);
}

.adr-cookie__switch:disabled {
	cursor: not-allowed;
	opacity: .6;
}

.adr-cookie__switch:focus-visible,
.adr-cookie__btn:focus-visible,
.adr-cookie__link:focus-visible,
.adr-cookie__close:focus-visible,
.adr-cookie-reopen:focus-visible {
	outline: 3px solid var(--ck-bronze);
	outline-offset: 3px;
}

.adr-cookie__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 16px;
}

.adr-cookie__btn {
	min-height: 46px;
	padding: 10px 16px;
	border: 1.5px solid var(--ck-ink);
	border-radius: 999px;
	background: transparent;
	color: var(--ck-ink);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 200ms ease, background-color 200ms ease;
}

.adr-cookie__btn:hover {
	transform: translateY(-1px);
	background: rgba(35, 31, 29, .05);
}

.adr-cookie__btn--accept,
.adr-cookie__btn--save {
	border-color: transparent;
	background: linear-gradient(145deg, #c08040 0%, #8a5a2e 60%, #6f4824 100%);
	color: #fff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px rgba(138, 90, 46, .3);
}

.adr-cookie__btn--accept:hover,
.adr-cookie__btn--save:hover {
	background: linear-gradient(145deg, #b07a43 0%, #7c4d23 60%, #5f3c1d 100%);
}

.adr-cookie__btn--save {
	grid-column: 1 / -1;
}

.adr-cookie__btn[hidden] {
	display: none;
}

.adr-cookie__foot {
	display: flex;
	justify-content: center;
	gap: 18px;
	margin-top: 12px;
}

.adr-cookie__link {
	padding: 4px 2px;
	border: 0;
	background: none;
	color: var(--ck-bronze);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.adr-cookie__appeal {
	margin: 8px 0 0;
	color: #7a7069;
	font-family: var(--aadr-font-serif, 'ADR Cormorant', Georgia, serif);
	font-size: 15px;
	font-style: italic;
	text-align: center;
}

/* Il timbro della sentenza. */
.adr-cookie__stamp {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 0;
	padding: 8px 22px;
	border: 4px double var(--ck-stamp);
	border-radius: 10px;
	color: var(--ck-stamp);
	font-family: var(--aadr-font-serif, 'ADR Cormorant', Georgia, serif);
	font-size: 40px;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	mix-blend-mode: multiply;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -50%) rotate(-14deg) scale(2.2);
}

.adr-cookie.is-stamped .adr-cookie__stamp {
	animation: adr-ck-stamp 420ms cubic-bezier(.3, 1.4, .5, 1) both;
}

.adr-cookie.is-stamped .adr-cookie__card {
	animation: adr-ck-thud 420ms ease-out 280ms both;
}

/* Riapertura: un biscotto discreto in basso a sinistra. */
.adr-cookie-reopen {
	position: fixed;
	z-index: 99998;
	left: 16px;
	bottom: 16px;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid rgba(138, 90, 46, .25);
	border-radius: 50%;
	background: #fffaf3;
	box-shadow: 0 8px 22px rgba(35, 31, 29, .18);
	cursor: pointer;
	transition: transform 300ms cubic-bezier(.22, 1, .36, 1);
}

.adr-cookie-reopen[hidden] {
	display: none;
}

.adr-cookie-reopen svg {
	width: 28px;
	height: 28px;
}

.adr-cookie-reopen:hover {
	transform: rotate(-18deg) scale(1.08);
}

.adr-cookie-live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Zoom lento sulla foto e, a ogni giro, un "colpo" del martelletto. */
@keyframes adr-ck-tap {
	0%, 100% { transform: scale(1); }
	8% { transform: scale(1.06) translateY(-3px) rotate(-5deg); }
	13% { transform: scale(1.1, 1.02) translateY(2px); }
	19% { transform: scale(1.05) rotate(2deg); }
	26% { transform: scale(1.06); }
	60% { transform: scale(1.14) translate(-2px, -2px); }
}

@keyframes adr-ck-stamp {
	from { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(2.2); }
	to { opacity: .92; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
}

@keyframes adr-ck-thud {
	0%, 100% { transform: none; }
	30% { transform: translateY(3px) scale(.99); }
}

@media (max-width: 479px) {
	.adr-cookie {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
	}

	.adr-cookie__card {
		padding: 18px 16px 14px;
	}

	.adr-cookie__title {
		font-size: 24px;
	}

	.adr-cookie__text {
		font-size: 13px;
	}

	.adr-cookie__stamp {
		font-size: 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.adr-cookie,
	.adr-cookie.is-leaving {
		transform: none;
	}
}
