/* Consent Guard – style baneru. Pozycjonowanie fixed = zero wpływu na CLS. */

/* Motywy (zmienne per motyw; "custom" nadpisywany inline z panelu) */
#cg-root.cg-theme-light {
	--cg-primary: #2b3674;   /* granat – przyciski */
	--cg-accent: #c9973f;    /* złoto – nagłówki, znaczniki */
	--cg-bg: #ffffff;
	--cg-text: #2f3a4a;
	--cg-muted: #6b7280;
	--cg-line: #e8eaf1;
	--cg-secondary-bg: #eef0f6;
	--cg-secondary-text: #2b3674;
}
#cg-root.cg-theme-navy {
	--cg-primary: #c9973f;
	--cg-accent: #c9973f;
	--cg-bg: #2b3674;
	--cg-text: #ffffff;
	--cg-muted: #c3c9de;
	--cg-line: rgba(255, 255, 255, .16);
	--cg-secondary-bg: rgba(255, 255, 255, .12);
	--cg-secondary-text: #ffffff;
}
#cg-root.cg-theme-dark {
	--cg-primary: #c9973f;
	--cg-accent: #c9973f;
	--cg-bg: #171c2b;
	--cg-text: #eceef4;
	--cg-muted: #9aa1b5;
	--cg-line: rgba(255, 255, 255, .12);
	--cg-secondary-bg: rgba(255, 255, 255, .1);
	--cg-secondary-text: #eceef4;
}
#cg-root.cg-theme-custom {
	--cg-muted: color-mix(in srgb, var(--cg-text) 60%, transparent);
	--cg-line: color-mix(in srgb, var(--cg-text) 14%, transparent);
	--cg-secondary-bg: color-mix(in srgb, var(--cg-text) 10%, transparent);
	--cg-secondary-text: var(--cg-text);
}

/* Czcionka dziedziczona z motywu strony – baner wygląda "natywnie". */
#cg-root { font-family: inherit; }
#cg-root, #cg-root * { box-sizing: border-box; }

.cg-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 26, 54, .45);
	z-index: 999998;
}

.cg-banner {
	position: fixed;
	z-index: 999999;
	background: var(--cg-bg);
	color: var(--cg-text);
	line-height: 1.55;
	max-height: min(80vh, 640px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

@keyframes cg-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Układ: mała karta w rogu (domyślny) ---------- */
.cg-layout-card .cg-banner {
	bottom: 20px;
	width: min(380px, calc(100vw - 32px));
	border-radius: 14px;
	border-top: 3px solid var(--cg-accent);
	box-shadow: 0 8px 40px rgba(20, 26, 54, .22);
	animation: cg-rise .35s ease both;
}
.cg-pos-right.cg-layout-card .cg-banner { right: 20px; }
.cg-pos-left.cg-layout-card .cg-banner { left: 20px; }
.cg-layout-card .cg-banner-inner { padding: 18px 20px; }
.cg-layout-card .cg-title { font-size: 15px; }
.cg-layout-card .cg-message { font-size: 13px; }
.cg-layout-card .cg-actions { flex-direction: column; }
.cg-layout-card .cg-actions .cg-btn { width: 100%; text-align: center; }

/* ---------- Układ: pasek dolny ---------- */
.cg-layout-bar .cg-banner {
	left: 0;
	right: 0;
	bottom: 0;
	border-top: 3px solid var(--cg-accent);
	box-shadow: 0 -4px 30px rgba(20, 26, 54, .15);
	animation: cg-rise .35s ease both;
}
.cg-layout-bar .cg-banner-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 18px 24px;
}

/* ---------- Układ: pop-up ---------- */
.cg-layout-popup .cg-banner {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px));
	border-radius: 14px;
	border-top: 3px solid var(--cg-accent);
	box-shadow: 0 10px 50px rgba(20, 26, 54, .35);
}
.cg-layout-popup .cg-banner-inner { padding: 26px 28px; }

/* ---------- Treść ---------- */
.cg-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}
.cg-logo { max-height: 34px; max-width: 140px; width: auto; }
.cg-title {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	color: var(--cg-text);
	letter-spacing: .2px;
}
/* Złoty znacznik przed tytułem – nawiązanie do nagłówków strony. */
.cg-title::before {
	content: "\00BB\00A0";
	color: var(--cg-accent);
	font-weight: 800;
}

.cg-message { font-size: 14px; margin-bottom: 14px; color: var(--cg-muted); }
.cg-message p { margin: 0 0 6px; }
.cg-privacy-link { color: var(--cg-accent); text-decoration: underline; }

/* ---------- Kategorie ---------- */
.cg-details { border-top: 1px solid var(--cg-line); padding-top: 10px; margin-bottom: 14px; }
.cg-cat { border-bottom: 1px solid var(--cg-line); padding: 7px 0; }
.cg-cat-row { display: flex; align-items: center; gap: 12px; }
.cg-cat-toggle {
	background: none;
	border: 0;
	padding: 4px 0;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--cg-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: inherit;
}
.cg-caret { font-size: 10px; opacity: .55; }
.cg-cat-desc { font-size: 12.5px; color: var(--cg-muted); padding: 6px 0 4px; }
.cg-cat-desc p { margin: 0 0 6px; }

/* ---------- Przełączniki ---------- */
.cg-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.cg-switch input { opacity: 0; width: 0; height: 0; }
.cg-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: #cbd5e1;
	border-radius: 22px;
	transition: background .2s;
}
.cg-slider::before {
	content: "";
	position: absolute;
	height: 16px;
	width: 16px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.cg-switch input:checked + .cg-slider { background: var(--cg-accent); }
.cg-switch input:checked + .cg-slider::before { transform: translateX(18px); }
.cg-switch input:disabled + .cg-slider { opacity: .55; cursor: not-allowed; }
.cg-switch input:focus-visible + .cg-slider { outline: 2px solid var(--cg-accent); outline-offset: 2px; }

/* ---------- Przyciski (pigułki, jak na stronie) ---------- */
.cg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cg-btn {
	border: 0;
	border-radius: 999px;
	padding: 10px 24px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: filter .15s, transform .1s;
	font-family: inherit;
	letter-spacing: .2px;
}
.cg-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cg-btn:active { transform: translateY(0); }
.cg-btn:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: 2px; }
.cg-btn-primary { background: var(--cg-primary); color: #fff; }
.cg-theme-navy .cg-btn-primary, .cg-theme-dark .cg-btn-primary { color: #1d2340; }
.cg-btn-secondary { background: var(--cg-secondary-bg); color: var(--cg-secondary-text); }
.cg-btn-ghost { background: transparent; color: var(--cg-accent); text-decoration: underline; padding: 10px 12px; }

/* ---------- Pływający znaczek ---------- */
.cg-badge {
	position: fixed;
	bottom: 16px;
	z-index: 999997;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 2px solid var(--cg-accent);
	background: var(--cg-bg);
	box-shadow: 0 2px 12px rgba(20, 26, 54, .3);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 5px;
	transition: transform .15s;
}
.cg-badge:hover { transform: scale(1.08); }
.cg-pos-right .cg-badge { right: 16px; }
.cg-pos-left .cg-badge { left: 16px; }
.cg-badge img { max-width: 100%; max-height: 100%; border-radius: 50%; }
.cg-badge-icon { font-size: 20px; }

/* ---------- Deklaracja cookies (shortcode) ---------- */
.cg-declaration table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.cg-declaration th, .cg-declaration td { border: 1px solid #e8eaf1; padding: 10px 12px; text-align: left; vertical-align: top; }
.cg-declaration th { background: #f7f8fb; }

/* ---------- RWD ---------- */
@media (max-width: 640px) {
	.cg-layout-card .cg-banner { left: 12px; right: 12px; bottom: 12px; width: auto; }
	.cg-layout-bar .cg-banner-inner { padding: 14px 16px; }
	.cg-actions { justify-content: stretch; }
	.cg-actions .cg-btn { flex: 1 1 auto; text-align: center; }
}

/* ---------- Dostępność ---------- */
@media (prefers-reduced-motion: reduce) {
	.cg-banner, .cg-slider, .cg-slider::before, .cg-btn, .cg-badge { animation: none; transition: none; }
}
