/* Cookie Booster — banner */
.cb-root {
	--cb-bg: #141414;
	--cb-text: #f3f1ec;
	--cb-muted: rgba(243, 241, 236, .68);
	--cb-line: rgba(243, 241, 236, .14);
	--cb-surface: rgba(243, 241, 236, .06);
	--cb-accent: #d9ff4f;
	--cb-accent-text: #111;
	--cb-radius: 14px;
	--cb-shadow: 0 18px 50px rgba(0, 0, 0, .28);
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--cb-text);
}
.cb-root.cb-theme-light {
	--cb-bg: #ffffff;
	--cb-text: #161616;
	--cb-muted: rgba(22, 22, 22, .66);
	--cb-line: rgba(22, 22, 22, .12);
	--cb-surface: rgba(22, 22, 22, .04);
	--cb-shadow: 0 18px 50px rgba(0, 0, 0, .14);
}
/* Tons secundários calculados a partir das cores escolhidas no painel. */
@supports (color: color-mix(in srgb, red, blue)) {
	.cb-root {
		--cb-muted: color-mix(in srgb, var(--cb-text) 68%, var(--cb-bg));
		--cb-line: color-mix(in srgb, var(--cb-text) 14%, transparent);
		--cb-surface: color-mix(in srgb, var(--cb-text) 6%, transparent);
	}
}
.cb-root *, .cb-root *::before, .cb-root *::after { box-sizing: border-box; }
.cb-root [hidden] { display: none !important; }

/* ---------- banner ---------- */
.cb-banner {
	position: fixed;
	z-index: 2147483000;
	background: var(--cb-panel, var(--cb-bg));
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	color: var(--cb-text);
	border: 1px solid var(--cb-line);
	border-radius: var(--cb-radius);
	box-shadow: var(--cb-shadow);
	padding: 22px 22px 18px;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .25s ease, transform .25s ease;
}
.cb-banner.cb-visible { opacity: 1; transform: none; }

.cb-root { --cb-box-width: 420px; --cb-overlay: rgba(10, 10, 10, .55); }

/* Caixas (cantos e centro) */
.cb-pos-box-left .cb-banner, .cb-pos-box-right .cb-banner, .cb-pos-box-bottom-center .cb-banner,
.cb-pos-box-top-left .cb-banner, .cb-pos-box-top-right .cb-banner, .cb-pos-box-top-center .cb-banner {
	width: min(var(--cb-box-width), calc(100vw - 40px));
}
.cb-pos-box-left .cb-banner { left: 20px; bottom: 20px; }
.cb-pos-box-right .cb-banner { right: 20px; bottom: 20px; }
.cb-pos-box-top-left .cb-banner { left: 20px; top: 20px; }
.cb-pos-box-top-right .cb-banner { right: 20px; top: 20px; }
.cb-pos-box-bottom-center .cb-banner, .cb-pos-box-top-center .cb-banner { left: 0; right: 0; margin: 0 auto; }
.cb-pos-box-bottom-center .cb-banner { bottom: 20px; }
.cb-pos-box-top-center .cb-banner { top: 20px; }
.cb-pos-box-top-left .cb-banner, .cb-pos-box-top-right .cb-banner, .cb-pos-box-top-center .cb-banner, .cb-pos-bar-top .cb-banner { transform: translateY(-12px); }

/* Barras */
.cb-pos-bar-bottom .cb-banner, .cb-pos-bar-top .cb-banner {
	left: 16px; right: 16px; display: grid;
	grid-template-columns: 1fr auto; gap: 4px 28px; align-items: center;
	max-width: 1200px; margin: 0 auto;
}
.cb-pos-bar-bottom .cb-banner { bottom: 16px; }
.cb-pos-bar-top .cb-banner { top: 16px; }
.cb-pos-bar-bottom .cb-banner > *:not(.cb-actions):not(.cb-close),
.cb-pos-bar-top .cb-banner > *:not(.cb-actions):not(.cb-close) { grid-column: 1; }
.cb-pos-bar-bottom .cb-actions, .cb-pos-bar-top .cb-actions { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; }

/* Janela ao centro */
.cb-pos-center .cb-banner {
	left: 50%; top: 50%; width: min(calc(var(--cb-box-width) + 100px), calc(100vw - 32px));
	transform: translate(-50%, calc(-50% + 12px));
}
.cb-pos-center .cb-banner.cb-visible { transform: translate(-50%, -50%); }

/* Painel lateral a toda a altura */
.cb-pos-side-left .cb-banner, .cb-pos-side-right .cb-banner {
	top: 0; bottom: 0; width: min(var(--cb-box-width), 100vw); border-radius: 0;
	display: flex; flex-direction: column; justify-content: flex-end; padding: 32px 28px; overflow-y: auto;
}
.cb-pos-side-left .cb-banner { left: 0; border-width: 0 1px 0 0; transform: translateX(-24px); }
.cb-pos-side-right .cb-banner { right: 0; border-width: 0 0 0 1px; transform: translateX(24px); }
.cb-pos-side-left .cb-actions, .cb-pos-side-right .cb-actions { flex-direction: column; }
.cb-pos-side-left .cb-actions .cb-btn, .cb-pos-side-right .cb-actions .cb-btn { flex: none; width: 100%; }
.cb-root .cb-banner.cb-visible { transform: none; }
.cb-pos-center .cb-banner.cb-visible { transform: translate(-50%, -50%); }

.cb-has-overlay::before {
	content: ""; position: fixed; inset: 0; z-index: 2147482999;
	background: var(--cb-overlay); backdrop-filter: blur(2px);
}

.cb-title { margin: 0 0 8px; font-size: 1.12em; line-height: 1.25; font-weight: 700; color: inherit; letter-spacing: -.01em; padding-right: 28px; }
.cb-text { margin: 0; color: var(--cb-muted); }
.cb-text p { margin: 0 0 .6em; }
.cb-text a, .cb-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cb-links { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9em; }
.cb-links a { color: var(--cb-text); }

/* Aceitar e rejeitar com o mesmo destaque e à mesma distância. */
.cb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: stretch; }
.cb-actions .cb-btn-link { align-self: center; }
.cb-pos-box-left .cb-actions .cb-btn:not(.cb-btn-link),
.cb-pos-box-right .cb-actions .cb-btn:not(.cb-btn-link),
.cb-pos-center .cb-actions .cb-btn:not(.cb-btn-link) { flex: 1 1 140px; }
.cb-btn {
	appearance: none; font: inherit; font-size: .95em; font-weight: 600; line-height: 1.2;
	border-radius: calc(var(--cb-radius) * .7); padding: 11px 16px; cursor: pointer;
	border: 1px solid transparent; text-align: center; transition: filter .15s, background .15s;
	margin: 0; min-height: 44px; text-transform: none; letter-spacing: normal;
}
.cb-btn-primary { background: var(--cb-accent); color: var(--cb-accent-text); border-color: var(--cb-accent); }
.cb-btn-primary:hover { filter: brightness(.94); }
.cb-btn-outline { background: transparent; color: var(--cb-text); border-color: var(--cb-line); }
.cb-btn-outline:hover { background: var(--cb-surface); }
.cb-btn-link { background: transparent; color: var(--cb-text); text-decoration: underline; text-underline-offset: 3px; padding-left: 6px; padding-right: 6px; }
.cb-btn:focus-visible, .cb-close:focus-visible, .cb-floating:focus-visible, .cb-root summary:focus-visible, .cb-switch input:focus-visible + .cb-slider {
	outline: 2px solid var(--cb-accent); outline-offset: 2px;
}

.cb-close {
	position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center;
	background: transparent; border: 0; border-radius: 50%; color: var(--cb-text); cursor: pointer; padding: 0;
}
.cb-close:hover { background: var(--cb-surface); }
.cb-branding { margin: 12px 0 0; font-size: .75em; color: var(--cb-muted); }

/* ---------- preferências ---------- */
.cb-prefs-wrap { position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: center; padding: 16px; }
.cb-backdrop { position: absolute; inset: 0; background: var(--cb-overlay); opacity: 0; transition: opacity .2s; }
.cb-prefs {
	position: relative; width: min(640px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column;
	background: var(--cb-panel, var(--cb-bg)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--cb-text); border-radius: var(--cb-radius); box-shadow: var(--cb-shadow);
	border: 1px solid var(--cb-line); outline: none; opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.cb-prefs-wrap.cb-visible .cb-backdrop { opacity: 1; }
.cb-prefs-wrap.cb-visible .cb-prefs { opacity: 1; transform: none; }
.cb-prefs-head { position: relative; padding: 22px 24px 8px; }
.cb-prefs-head .cb-close { top: 16px; right: 16px; }
.cb-prefs-body { padding: 0 24px 8px; overflow-y: auto; overscroll-behavior: contain; }
.cb-prefs-foot { padding: 14px 24px 18px; border-top: 1px solid var(--cb-line); }
.cb-prefs-foot .cb-actions { margin-top: 0; }
.cb-prefs-foot .cb-btn:not(.cb-btn-link) { flex: 1 1 150px; }

.cb-cat { border-top: 1px solid var(--cb-line); padding: 16px 0; }
.cb-cat:first-of-type { margin-top: 14px; }
.cb-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cb-cat-title { margin: 0; font-size: 1em; font-weight: 700; color: inherit; }
.cb-cat-title label { cursor: pointer; }
.cb-cat-desc { margin: 6px 0 0; color: var(--cb-muted); font-size: .92em; }
.cb-always { font-size: .82em; font-weight: 600; color: var(--cb-muted); white-space: nowrap; }

.cb-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.cb-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cb-slider { position: absolute; inset: 0; background: var(--cb-line); border-radius: 26px; transition: background .2s; }
.cb-slider::before {
	content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%;
	background: var(--cb-text); transition: transform .2s, background .2s;
}
.cb-switch input:checked + .cb-slider { background: var(--cb-accent); }
.cb-switch input:checked + .cb-slider::before { transform: translateX(20px); background: var(--cb-accent-text); }
.cb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cb-details { margin-top: 8px; font-size: .88em; }
.cb-details summary { cursor: pointer; color: var(--cb-text); font-weight: 600; width: fit-content; }
.cb-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .95em; }
.cb-table th, .cb-table td { text-align: left; vertical-align: top; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--cb-line); color: var(--cb-muted); background: none; }
.cb-table th { color: var(--cb-text); font-weight: 600; }
.cb-table code { font-size: .95em; background: var(--cb-surface); padding: 1px 5px; border-radius: 4px; color: var(--cb-text); word-break: break-all; }
.cb-empty { color: var(--cb-muted); margin: 8px 0 0; }
.cb-consent-id { margin: 10px 0 0; font-size: .75em; color: var(--cb-muted); word-break: break-all; }

/* ---------- botão flutuante ---------- */
.cb-floating {
	position: fixed; bottom: 16px; z-index: 2147482998; display: inline-flex; align-items: center; gap: 0;
	background: var(--cb-bg); color: var(--cb-text); border: 1px solid var(--cb-line); border-radius: 999px;
	padding: 10px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font: inherit; font-size: 14px; font-weight: 600;
}
.cb-floating span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .25s, margin .25s; }
.cb-floating:hover span, .cb-floating:focus-visible span { max-width: 220px; margin: 0 6px 0 8px; }
.cb-floating-left { left: 16px; }
.cb-floating-right { right: 16px; }
.cb-floating svg { color: var(--cb-accent); flex: none; }
.cb-theme-light .cb-floating svg { color: var(--cb-text); }

html.cb-lock, html.cb-lock body { overflow: hidden; }

/* ---------- conteúdo bloqueado (YouTube, mapas…) ---------- */
.cb-placeholder {
	box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
	width: 100%; min-height: 220px; padding: 24px; margin: 0 0 1em; border-radius: 12px;
	background: #f1eee9; color: #1a1a1a; border: 1px dashed rgba(0, 0, 0, .2); font-size: 15px;
}
.cb-placeholder p { margin: 0; max-width: 46ch; }
.cb-placeholder .cb-btn { --cb-radius: 12px; background: #111; color: #fff; border-color: #111; }

/* ---------- telemóvel ---------- */
@media (max-width: 640px) {
	.cb-root:not(.cb-pos-center) .cb-banner {
		left: 10px; right: 10px; bottom: 10px; top: auto; width: auto; display: block; margin: 0;
		border-radius: var(--cb-radius); border-width: 1px;
	}
	.cb-pos-bar-top .cb-banner, .cb-pos-box-top-left .cb-banner, .cb-pos-box-top-right .cb-banner, .cb-pos-box-top-center .cb-banner { top: 10px !important; bottom: auto !important; }
	.cb-pos-side-left .cb-actions, .cb-pos-side-right .cb-actions { flex-direction: row; }
	.cb-actions .cb-btn:not(.cb-btn-link) { flex: 1 1 100%; }
	.cb-prefs-wrap { padding: 0; align-items: end; }
	.cb-prefs { max-height: 92vh; border-radius: var(--cb-radius) var(--cb-radius) 0 0; }
	.cb-table thead { display: none; }
	.cb-table, .cb-table tbody, .cb-table tr, .cb-table td { display: block; width: 100%; }
	.cb-table tr { border-bottom: 1px solid var(--cb-line); padding: 6px 0; }
	.cb-table td { border: 0; padding: 2px 0; }
	.cb-table td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--cb-text); }
}

@media (prefers-reduced-motion: reduce) {
	.cb-banner, .cb-prefs, .cb-backdrop, .cb-floating span { transition: none; }
}

@media print { .cb-root { display: none !important; } }
