/* RODO Cookie Consent — style banera.
 * Selektory z #rcc-root, żeby style szablonu / Elementora nie nadpisywały przycisków.
 * 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;
}

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 .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 .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 .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:focus-visible,
.rcc-blocked .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 { overflow-x: auto; margin: .5em 0 1em; }
.rcc-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.rcc-table th, .rcc-table td {
	text-align: left;
	vertical-align: top;
	padding: .45em .6em;
	border-bottom: 1px solid var(--rcc-border, #ddd);
}
.rcc-table th { font-weight: 700; white-space: nowrap; }
.rcc-table code { font-size: .95em; background: none; padding: 0; color: inherit; }

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

.rcc-floating {
	all: unset;
	position: fixed;
	bottom: 16px;
	z-index: 2147483630;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--rcc-primary-bg);
	color: var(--rcc-primary-text);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	cursor: pointer;
	opacity: .85;
	transition: opacity .15s ease;
}
.rcc-floating:hover { opacity: 1; }
.rcc-floating--left { left: 16px; }
.rcc-floating--right { right: 16px; }

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

.rcc-blocked {
	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 p { margin: 0; }
.rcc-blocked a { color: inherit; font-size: .9em; }

/* ---------- 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 thead { display: none; }
	.rcc-table tr { display: block; border-bottom: 1px solid var(--rcc-border, #ddd); padding: .4em 0; }
	.rcc-table td { display: block; border: 0; padding: .15em 0; }
	.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; }
}
