/**
 * Gedanken — módulo de consentimento.
 *
 * Todo o tema vem de custom properties inline no elemento raiz, definidas em
 * PHP a partir das configurações. Assim este arquivo é único e cacheável, sem
 * nenhum <style> por página.
 *
 * A visibilidade é comandada pela classe gdk-cc-pending que o bootstrap põe
 * no <html> ainda no <head> — antes do primeiro paint, então não há flash nem
 * para quem já decidiu nem para quem não decidiu.
 */

.gdk-cc {
	--gdk-cc-accent: #003B7B;
	--gdk-cc-accent-text: #fff;
	--gdk-cc-bg: #fff;
	--gdk-cc-text: #1d2327;
	--gdk-cc-border: #e0e0e0;
	--gdk-cc-radius: 8px;
	--gdk-cc-max: 768px;

	font-family: inherit;
	color: var(--gdk-cc-text);
}

/* Estado base: nada aparece sem que o JS/CSS diga o contrário. */
.gdk-cc__banner[hidden],
.gdk-cc__modal[hidden],
.gdk-cc__fab[hidden] {
	display: none;
}

/* --------------------------------------------------------------- banner */

.gdk-cc__banner {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 2147483001;
	display: flex;
	justify-content: center;
	pointer-events: none;
}

html.gdk-cc-pending .gdk-cc__banner[hidden] {
	display: flex;
}

.gdk-cc--left .gdk-cc__banner {
	justify-content: flex-start;
}

.gdk-cc--right .gdk-cc__banner {
	justify-content: flex-end;
}

.gdk-cc__card {
	pointer-events: auto;
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 24px;
	width: 100%;
	max-width: var(--gdk-cc-max);
	padding: 16px 20px;
	background: var(--gdk-cc-bg);
	border: 1px solid var(--gdk-cc-border);
	border-radius: var(--gdk-cc-radius);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}

.gdk-cc__text {
	flex: 1 1 320px;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	font-weight: 500;
	text-wrap: balance;
}

.gdk-cc__text a {
	color: inherit;
	text-decoration: underline;
}

.gdk-cc__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* --------------------------------------------------------------- botões */

.gdk-cc__btn {
	appearance: none;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	padding: 9px 20px;
	border-radius: 9999px;
	border: 1px solid transparent;
	transition: opacity .15s ease, background-color .15s ease;
}

.gdk-cc__btn:hover {
	opacity: .88;
}

.gdk-cc__btn:focus-visible {
	outline: 2px solid var(--gdk-cc-accent);
	outline-offset: 2px;
}

.gdk-cc__btn--primary {
	background: var(--gdk-cc-accent);
	color: var(--gdk-cc-accent-text);
}

/*
 * "Recusar" tem o mesmo peso visual de "Aceitar": a ANPD trata uma recusa
 * escondida ou em segunda camada como consentimento inválido.
 */
.gdk-cc__btn--ghost {
	background: transparent;
	color: var(--gdk-cc-text);
	border-color: var(--gdk-cc-border);
}

.gdk-cc__link {
	appearance: none;
	background: none;
	border: 0;
	padding: 4px 2px;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	color: var(--gdk-cc-text);
	text-decoration: underline;
	opacity: .8;
}

.gdk-cc__link:hover {
	opacity: 1;
}

/* ---------------------------------------------------------------- modal */

.gdk-cc__modal {
	position: fixed;
	inset: 0;
	z-index: 2147483002;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.gdk-cc.is-modal-open .gdk-cc__modal[hidden] {
	display: flex;
}

.gdk-cc__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

.gdk-cc__dialog {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	max-height: 85vh;
	max-height: 85dvh;
	overflow-y: auto;
	padding: 28px 24px 24px;
	background: var(--gdk-cc-bg);
	border-radius: var(--gdk-cc-radius);
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
}

.gdk-cc__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	background: transparent;
	color: var(--gdk-cc-text);
	border: 0;
	border-radius: 50%;
}

.gdk-cc__close:hover {
	background: rgba(0, 0, 0, .06);
}

.gdk-cc__title {
	margin: 0 0 8px;
	font-size: 18px;
	line-height: 1.3;
}

.gdk-cc__intro {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.5;
	opacity: .85;
}

.gdk-cc__cats {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}

.gdk-cc__cat {
	padding: 14px 0;
	border-top: 1px solid var(--gdk-cc-border);
}

.gdk-cc__cat:last-child {
	border-bottom: 1px solid var(--gdk-cc-border);
}

.gdk-cc__cat-head {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
}

.gdk-cc__toggle {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	accent-color: var(--gdk-cc-accent);
	cursor: pointer;
}

.gdk-cc__toggle:disabled {
	cursor: default;
}

.gdk-cc__badge {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 3px 8px;
	border-radius: 9999px;
	background: var(--gdk-cc-border);
	opacity: .9;
}

.gdk-cc__cat-desc {
	margin: 6px 0 0 28px;
	font-size: 13px;
	line-height: 1.5;
	opacity: .8;
}

.gdk-cc__modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.gdk-cc__sentinel {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* ----------------------------------------------------- botão de reabrir */

.gdk-cc__fab {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482999;
	width: 40px;
	height: 40px;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	background: var(--gdk-cc-bg);
	color: var(--gdk-cc-text);
	border: 1px solid var(--gdk-cc-border);
	border-radius: 50%;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .12);
	opacity: .65;
	transition: opacity .15s ease;
}

.gdk-cc__fab:hover {
	opacity: 1;
}

/* Só depois de decidir — antes disso quem aparece é o banner. */
html:not(.gdk-cc-pending) .gdk-cc__fab[hidden] {
	display: flex;
}

/* ----------------------------------------------------------- responsivo */

@media (min-width: 768px) {
	.gdk-cc__banner {
		left: 24px;
		right: 24px;
		bottom: 24px;
	}

	.gdk-cc__fab {
		left: 24px;
		bottom: 24px;
	}
}

@media (max-width: 600px) {
	.gdk-cc__card {
		padding: 16px;
	}

	.gdk-cc__actions {
		width: 100%;
	}

	.gdk-cc__btn {
		flex: 1 1 auto;
		text-align: center;
	}

	.gdk-cc__link {
		flex: 1 1 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gdk-cc__btn,
	.gdk-cc__fab {
		transition: none;
	}
}
