/* RODO Cookie Consent — style banera.
 *
 * Odporność na style szablonu / Elementora:
 * Elementor (Theme Style kitu) i motywy piszą reguły typu `.elementor-kit-5 button:hover`
 * (specyficzność 0,2,1) albo `table tbody>tr:nth-child(odd)>td` (0,1,4). Klasa wtyczki
 * (0,1,0) z nimi przegrywa, dlatego KAŻDA reguła tutaj ma w selektorze identyfikator:
 *   - baner i panel:          #rcc-root …
 *   - elementy poza banerem:  .rcc-floating:not(#rcc-root), .rcc-blocked:not(#rcc-root) …
 *     (`:not(#id)` zawsze pasuje, a podnosi specyficzność do poziomu identyfikatora)
 * Do tego reset wewnątrz banera (niżej), żeby nie przeciekały właściwości, których
 * komponenty same nie ustawiają (np. typografia etykiet i akapitów z kitu Elementora).
 *
 * Font: dziedziczony z szablonu (ustawienie "inherit") lub nazwa rodziny z panelu — nic nie pobieramy.
 */

#rcc-root[hidden], #rcc-root [hidden], .rcc-floating[hidden] { display: none !important; }

#rcc-root, #rcc-root *, .rcc-floating, .rcc-blocked, .rcc-blocked * { box-sizing: border-box; }

#rcc-root {
	font-family: var(--rcc-font, inherit);
	font-size: var(--rcc-font-size, 15px);
	line-height: 1.5;
	color: var(--rcc-text);
	letter-spacing: normal;
	text-transform: none;
	-webkit-font-smoothing: antialiased;
	text-align: left;
	text-shadow: none;
}

/* Reset: specyficzność 1,0,0 — bije kit Elementora / motyw, a przegrywa z regułami
 * komponentów poniżej (#rcc-root .klasa = 1,1,0), więc to one decydują o wyglądzie. */
#rcc-root :where(div, p, span, label, a, summary, details, code, ul, ol, li, table, thead, tbody, tr, th, td) {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-decoration: none;
	text-shadow: none;
	color: inherit;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	min-height: 0;
	float: none;
	transition: none;
}
#rcc-root :where(code) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; }
#rcc-root :where(label) { display: inline; vertical-align: baseline; }

html.rcc-lock, html.rcc-lock body { overflow: hidden !important; }

/* ---------- Baner ---------- */

#rcc-root .rcc-banner {
	position: fixed;
	z-index: 2147483640;
	background: var(--rcc-bg);
	color: var(--rcc-text);
	border: 1px solid var(--rcc-border);
	box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
	padding: 1.25em 1.5em;
	display: flex;
	gap: 1em 1.5em;
	outline: none;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

#rcc-root.rcc-layout-bar-bottom .rcc-banner {
	left: 0; right: 0; bottom: 0;
	border-width: 1px 0 0;
	align-items: center;
	justify-content: center;
}
#rcc-root.rcc-layout-bar-bottom .rcc-banner__body { max-width: 860px; }

#rcc-root.rcc-layout-box-left .rcc-banner,
#rcc-root.rcc-layout-box-right .rcc-banner {
	bottom: 16px;
	width: 440px;
	max-width: calc(100vw - 32px);
	flex-direction: column;
	border-radius: var(--rcc-radius);
}
#rcc-root.rcc-layout-box-left .rcc-banner { left: 16px; }
#rcc-root.rcc-layout-box-right .rcc-banner { right: 16px; }

#rcc-root.rcc-layout-modal .rcc-banner {
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 560px;
	max-width: calc(100vw - 32px);
	flex-direction: column;
	border-radius: var(--rcc-radius);
}

#rcc-root .rcc-overlay,
#rcc-root .rcc-prefs__overlay {
	position: fixed;
	inset: 0;
	background: var(--rcc-overlay);
	z-index: 2147483639;
}
#rcc-root:not(.rcc-is-banner) .rcc-overlay { display: none; }

#rcc-root .rcc-title {
	font-family: inherit;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 .4em;
	padding: 0;
	color: inherit;
}

#rcc-root .rcc-text { margin: 0; font-size: .93em; }
#rcc-root .rcc-text p { margin: 0 0 .5em; }
#rcc-root a { color: var(--rcc-accent); text-decoration: underline; }
#rcc-root a:hover { text-decoration: none; }

/* ---------- Przyciski ---------- */

#rcc-root .rcc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5em;
	align-items: center;
	flex-shrink: 0;
}
#rcc-root.rcc-layout-box-left .rcc-banner .rcc-actions,
#rcc-root.rcc-layout-box-right .rcc-banner .rcc-actions,
#rcc-root.rcc-layout-modal .rcc-banner .rcc-actions { justify-content: flex-end; }

#rcc-root .rcc-btn,
.rcc-blocked:not(#rcc-root) .rcc-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--rcc-font, inherit);
	font-size: .93em;
	font-weight: 600;
	line-height: 1.2;
	padding: .75em 1.15em;
	min-height: 44px;
	border-radius: var(--rcc-radius);
	border: 1px solid transparent;
	cursor: pointer;
	text-align: center;
	white-space: nowrap;
	transition: filter .15s ease, background-color .15s ease;
}
#rcc-root .rcc-btn--primary,
.rcc-blocked:not(#rcc-root) .rcc-btn--primary {
	background: var(--rcc-primary-bg);
	color: var(--rcc-primary-text);
	border-color: var(--rcc-primary-bg);
}
#rcc-root .rcc-btn--secondary {
	background: var(--rcc-secondary-bg);
	color: var(--rcc-secondary-text);
	border-color: var(--rcc-border);
}
#rcc-root .rcc-btn--link {
	background: transparent;
	color: var(--rcc-text);
	text-decoration: underline;
	padding-left: .5em;
	padding-right: .5em;
}
#rcc-root .rcc-btn:hover, .rcc-blocked:not(#rcc-root) .rcc-btn:hover { filter: brightness(.92); }
#rcc-root .rcc-btn:focus-visible,
#rcc-root .rcc-close:focus-visible,
#rcc-root summary:focus-visible,
#rcc-root .rcc-switch input:focus-visible + .rcc-switch__track,
.rcc-floating:not(#rcc-root):focus-visible,
.rcc-blocked:not(#rcc-root) .rcc-btn:focus-visible {
	outline: 3px solid var(--rcc-accent);
	outline-offset: 2px;
}

/* ---------- Panel ustawień ---------- */

#rcc-root .rcc-prefs__panel {
	position: fixed;
	z-index: 2147483641;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 680px;
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - 24px);
	display: flex;
	flex-direction: column;
	background: var(--rcc-bg);
	color: var(--rcc-text);
	border-radius: var(--rcc-radius);
	box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
	outline: none;
}
#rcc-root .rcc-prefs__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding: 1em 1.5em;
	border-bottom: 1px solid var(--rcc-border);
}
#rcc-root .rcc-prefs__head .rcc-title { margin: 0; }
#rcc-root .rcc-close {
	all: unset;
	cursor: pointer;
	font-size: 1.8em;
	line-height: 1;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--rcc-radius);
	color: var(--rcc-text);
}
#rcc-root .rcc-prefs__body {
	padding: 1em 1.5em;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
#rcc-root .rcc-prefs__foot {
	padding: 1em 1.5em;
	border-top: 1px solid var(--rcc-border);
	justify-content: flex-end;
}

#rcc-root .rcc-cat {
	border: 1px solid var(--rcc-border);
	border-radius: var(--rcc-radius);
	padding: .9em 1em;
	margin-top: .75em;
}
#rcc-root .rcc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
}
#rcc-root .rcc-cat__label { font-weight: 700; cursor: pointer; margin: 0; }
#rcc-root .rcc-cat__desc { font-size: .88em; margin: .4em 0 0; opacity: .9; }
#rcc-root .rcc-always { font-size: .82em; font-weight: 600; color: var(--rcc-accent); white-space: nowrap; }

#rcc-root .rcc-cat__cookies { margin-top: .5em; font-size: .85em; }
#rcc-root .rcc-cat__cookies summary { cursor: pointer; color: var(--rcc-accent); display: list-item; }

/* Przełącznik */
#rcc-root .rcc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
#rcc-root .rcc-switch input {
	position: absolute; inset: 0; width: 100%; height: 100%;
	margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
#rcc-root .rcc-switch__track {
	position: absolute; inset: 0;
	background: #8c959f;
	border-radius: 26px;
	transition: background-color .2s ease;
}
#rcc-root .rcc-switch__track::after {
	content: "";
	position: absolute; top: 3px; left: 3px;
	width: 20px; height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s ease;
}
#rcc-root .rcc-switch input:checked + .rcc-switch__track { background: var(--rcc-accent); }
#rcc-root .rcc-switch input:checked + .rcc-switch__track::after { transform: translateX(20px); }

#rcc-root .rcc-consent-id { font-size: .8em; margin: 1em 0 0; opacity: .8; word-break: break-all; }

/* ---------- Tabela ciasteczek (panel i shortcode) ---------- */

.rcc-table-wrap:not(#rcc-root) { overflow-x: auto; margin: .5em 0 1em; padding: 0; border: 0; }
.rcc-table-wrap:not(#rcc-root) .rcc-table { width: 100%; border-collapse: collapse; border: 0; margin: 0; background: none; font-size: .92em; }
.rcc-table-wrap:not(#rcc-root) .rcc-table th, .rcc-table-wrap:not(#rcc-root) .rcc-table td {
	border: 0;
	background: none;
	line-height: 1.45;
	text-align: left;
	vertical-align: top;
	padding: .45em .6em;
	border-bottom: 1px solid var(--rcc-border, #ddd);
}
.rcc-table-wrap:not(#rcc-root) .rcc-table th { font-weight: 700; white-space: nowrap; }
.rcc-table-wrap:not(#rcc-root) .rcc-table code { font-size: .95em; background: none; padding: 0; color: inherit; }

/* ---------- Pływający przycisk ---------- */

.rcc-floating:not(#rcc-root) {
	all: unset;
	position: fixed;
	bottom: var(--rcc-fl-y, 16px);
	z-index: 2147483630;
	width: var(--rcc-fl-size, 44px);
	height: var(--rcc-fl-size, 44px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--rcc-fl-radius, 50%);
	border: var(--rcc-fl-border, 0 solid transparent);
	background: var(--rcc-fl-bg, var(--rcc-primary-bg));
	color: var(--rcc-fl-color, var(--rcc-primary-text));
	box-shadow: var(--rcc-fl-shadow, 0 4px 14px rgba(0, 0, 0, .25));
	cursor: pointer;
	opacity: .9;
	transition: opacity .15s ease, transform .15s ease;
}
.rcc-floating:not(#rcc-root) svg { max-width: none; width: var(--rcc-fl-icon, 22px); height: var(--rcc-fl-icon, 22px); display: block; }
.rcc-floating:not(#rcc-root):hover, .rcc-floating:not(#rcc-root):focus { opacity: 1; transform: scale(1.06); }
.rcc-floating--left:not(#rcc-root) { left: var(--rcc-fl-x, 16px); }
.rcc-floating--right:not(#rcc-root) { right: var(--rcc-fl-x, 16px); }

/* ---------- Zablokowana treść (iframe) ---------- */

.rcc-blocked:not(#rcc-root) {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .75em;
	width: 100%;
	min-height: 200px;
	padding: 1.5em;
	text-align: center;
	background: #f3f4f6;
	color: #1f2328;
	border: 1px dashed #c4c9d0;
	border-radius: var(--rcc-radius, 8px);
	font-family: var(--rcc-font, inherit);
}
.rcc-blocked:not(#rcc-root) p { margin: 0; padding: 0; font: inherit; color: inherit; line-height: 1.5; }
.rcc-blocked:not(#rcc-root) a { color: inherit; font-size: .9em; font-weight: inherit; text-decoration: underline; }

/* ---------- Mobile ---------- */

@media (max-width: 782px) {
	#rcc-root.rcc-layout-bar-bottom .rcc-banner { flex-direction: column; align-items: stretch; }
	#rcc-root .rcc-banner { padding: 1em; }
	#rcc-root .rcc-actions { flex-direction: column-reverse; align-items: stretch; }
	#rcc-root .rcc-btn { width: 100%; white-space: normal; }
	#rcc-root.rcc-layout-box-left .rcc-banner,
	#rcc-root.rcc-layout-box-right .rcc-banner { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; }
	#rcc-root .rcc-prefs__panel { width: 100%; max-width: 100vw; max-height: 100%; height: 100%; top: 0; left: 0; transform: none; border-radius: 0; }
	#rcc-root .rcc-prefs__head, #rcc-root .rcc-prefs__body, #rcc-root .rcc-prefs__foot { padding-left: 1em; padding-right: 1em; }
	.rcc-table-wrap:not(#rcc-root) .rcc-table thead { display: none; }
	.rcc-table-wrap:not(#rcc-root) .rcc-table tr { display: block; border-bottom: 1px solid var(--rcc-border, #ddd); padding: .4em 0; }
	.rcc-table-wrap:not(#rcc-root) .rcc-table td { display: block; border: 0; padding: .15em 0; }
	.rcc-table-wrap:not(#rcc-root) .rcc-table td::before { content: attr(data-label) ": "; font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) {
	#rcc-root *, .rcc-floating { transition: none !important; }
}

@media print {
	#rcc-root, .rcc-floating { display: none !important; }
}
