/* Bàner de galetes */
.cookie-banner {
	position: fixed;
	inset: 0;
	z-index: 2000;
}

.cookie-banner__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(32, 37, 31, 0.35);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.cookie-banner__card {
	position: absolute;
	left: 24px;
	bottom: 24px;
	width: min(440px, calc(100% - 32px));
	max-height: calc(100% - 48px);
	overflow-y: auto;
	padding: 30px 28px 28px;
	border-radius: 16px;
	background-color: var(--color-cream);
	color: var(--color-green-950);
	box-shadow: 0 24px 60px rgba(32, 37, 31, 0.35);
}

/* Franja beix a dalt de la targeta */
.cookie-banner__card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	border-radius: 16px 16px 0 0;
	background-color: var(--color-tan-light);
}

.cookie-banner__logo {
	width: 64px;
	height: 64px;
	object-fit: contain;
	margin-bottom: 16px;
}

.cookie-banner__text {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.6;
}

.cookie-banner__text a {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: var(--color-tan);
}

.cookie-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.cookie-banner__button {
	flex: 1 1 auto;
	padding: 11px 18px;
	border: 1px solid var(--color-green-900);
	border-radius: 4px;
	background-color: transparent;
	color: var(--color-green-950);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.cookie-banner__button:hover {
	opacity: 0.8;
}

.cookie-banner__button--primary {
	background-color: var(--color-green-900);
	color: var(--color-white);
}

.cookie-banner__button--light {
	border-color: rgba(32, 37, 31, 0.25);
}

.cookie-banner__button--block {
	width: 100%;
	margin-top: 22px;
	padding: 13px 18px;
}

/* Vista de configuració */
.cookie-banner__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 18px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-green-950);
	font-family: var(--font-body);
	font-size: 14px;
	cursor: pointer;
}

.cookie-banner__back svg {
	width: 16px;
	height: 16px;
}

.cookie-banner__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 16px 0;
	border-bottom: 1px solid rgba(32, 37, 31, 0.12);
}

.cookie-banner__option-title {
	margin: 0 0 4px;
	font-family: var(--font-heading);
	font-size: 17px;
}

.cookie-banner__option-text {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	opacity: 0.8;
}

/* Interruptor */
.cookie-switch {
	position: relative;
	flex-shrink: 0;
	width: 46px;
	height: 26px;
	cursor: pointer;
}

.cookie-switch input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.cookie-switch__slider {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background-color: rgba(32, 37, 31, 0.2);
	transition: background-color 0.2s ease;
	pointer-events: none;
}

.cookie-switch__slider::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-color: var(--color-white);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease;
}

.cookie-switch input:checked + .cookie-switch__slider {
	background-color: var(--color-green-700);
}

.cookie-switch input:checked + .cookie-switch__slider::after {
	transform: translateX(20px);
}

.cookie-switch input:disabled {
	cursor: not-allowed;
}

.cookie-switch input:disabled + .cookie-switch__slider {
	opacity: 0.6;
}

.cookie-switch input:focus-visible + .cookie-switch__slider {
	outline: 2px solid var(--color-tan);
	outline-offset: 2px;
}

.screen-reader-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

body.cookie-banner-open {
	overflow: hidden;
}

/* Enllaç «Configurar galetes» del footer, amb aspecte d'enllaç */
.site-footer__legal button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.site-footer__legal button:hover {
	opacity: 0.7;
}

@media (max-width: 560px) {
	.cookie-banner__card {
		left: 16px;
		bottom: 16px;
		padding: 26px 20px 20px;
	}
}
