/* Zgody Cookies – baner. Kolory pochodzą ze zmiennych ustawianych w panelu. */

#zc-banner,
#zc-modal,
#zc-revisit {
	--zc-bg: #fff;
	--zc-text: #1f2937;
	--zc-primary: #1d4ed8;
	--zc-primary-text: #fff;
	--zc-link: var(--zc-primary); /* linki i przycisk obramowany; PHP podmienia, gdy kolor przycisku ma za słaby kontrast z tłem */
	--zc-secondary: #e5e7eb;
	--zc-secondary-text: #111827;
	--zc-radius: 8px;
	--zc-font-size: 15px;
}

#zc-banner[hidden],
#zc-modal[hidden],
#zc-revisit[hidden],
#zc-banner [hidden],
#zc-modal [hidden] {
	display: none !important;
}

html.zc-locked {
	overflow: hidden;
}

#zc-banner,
#zc-modal {
	font-family: inherit;
	font-size: var(--zc-font-size);
	line-height: 1.5;
	color: var(--zc-text);
	box-sizing: border-box;
}

#zc-banner *,
#zc-modal * {
	box-sizing: border-box;
}

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

#zc-banner {
	position: fixed;
	z-index: 2147483000;
	background: var(--zc-bg);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
}

:is(#zc-banner, #zc-modal) .zc-banner__inner {
	display: flex;
	gap: 16px 32px;
	align-items: center;
	max-width: 1240px;
	margin: 0 auto;
	padding: 20px 24px;
}

:is(#zc-banner, #zc-modal) .zc-banner__text {
	flex: 1 1 auto;
}

:is(#zc-banner, #zc-modal) .zc-banner__title {
	margin: 0 0 6px;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
	outline: none;
}

#zc-banner p {
	margin: 0;
	color: inherit;
}

#zc-banner a,
#zc-modal a {
	color: var(--zc-link);
	text-decoration: underline;
}

:is(#zc-banner, #zc-modal) .zc-banner__buttons {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

#zc-banner.zc-pos-bottom {
	left: 0;
	right: 0;
	bottom: 0;
}

#zc-banner.zc-pos-top {
	left: 0;
	right: 0;
	top: 0;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .18);
}

#zc-banner.zc-pos-box-left,
#zc-banner.zc-pos-box-right,
#zc-banner.zc-pos-center {
	bottom: 20px;
	width: 420px;
	max-width: calc(100vw - 32px);
	border-radius: var(--zc-radius);
}

#zc-banner.zc-pos-box-left {
	left: 20px;
}

#zc-banner.zc-pos-box-right {
	right: 20px;
}

#zc-banner.zc-pos-box-left .zc-banner__inner,
#zc-banner.zc-pos-box-right .zc-banner__inner,
#zc-banner.zc-pos-center .zc-banner__inner {
	flex-direction: column;
	align-items: stretch;
}

#zc-banner.zc-pos-box-left .zc-banner__buttons,
#zc-banner.zc-pos-box-right .zc-banner__buttons,
#zc-banner.zc-pos-center .zc-banner__buttons {
	justify-content: stretch;
}

#zc-banner.zc-pos-box-left .zc-btn,
#zc-banner.zc-pos-box-right .zc-btn,
#zc-banner.zc-pos-center .zc-btn {
	flex: 1 1 auto;
}

#zc-banner.zc-pos-center {
	top: 50%;
	left: 50%;
	bottom: auto;
	width: 560px;
	transform: translate(-50%, -50%);
	box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5), 0 10px 40px rgba(0, 0, 0, .3);
}

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

:is(#zc-banner, #zc-modal) .zc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	margin: 0;
	padding: 8px 18px;
	border: 2px solid transparent;
	border-radius: var(--zc-radius);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	letter-spacing: normal;
	white-space: normal;
	width: auto;
	max-width: 100%;
	height: auto;
	cursor: pointer;
	box-shadow: none;
	transition: filter .15s;
}

:is(#zc-banner, #zc-modal) .zc-btn:hover {
	filter: brightness(.92);
}

:is(#zc-banner, #zc-modal) .zc-btn:focus-visible,
#zc-revisit:focus-visible,
:is(#zc-banner, #zc-modal) .zc-modal__close:focus-visible,
:is(#zc-banner, #zc-modal) .zc-cat__name:focus-visible,
:is(#zc-banner, #zc-modal) .zc-switch input:focus-visible + .zc-switch__slider,
.zc-open-settings:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 2px;
}

:is(#zc-banner, #zc-modal) .zc-btn--primary {
	background: var(--zc-primary);
	border-color: var(--zc-primary);
	color: var(--zc-primary-text);
}

:is(#zc-banner, #zc-modal) .zc-btn--secondary {
	background: var(--zc-secondary);
	border-color: var(--zc-secondary);
	color: var(--zc-secondary-text);
}

:is(#zc-banner, #zc-modal) .zc-btn--link {
	background: transparent;
	border-color: var(--zc-link);
	color: var(--zc-link);
}

/* ---------- Okno ustawień ---------- */

#zc-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

:is(#zc-banner, #zc-modal) .zc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

:is(#zc-banner, #zc-modal) .zc-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 720px;
	max-width: 100%;
	max-height: calc(100vh - 32px);
	background: var(--zc-bg);
	border-radius: var(--zc-radius);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

:is(#zc-banner, #zc-modal) .zc-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 24px;
	border-bottom: 1px solid rgba(127, 127, 127, .25);
}

:is(#zc-banner, #zc-modal) .zc-modal__header h2 {
	margin: 0;
	font-size: 1.2em;
	font-weight: 700;
	color: inherit;
}

:is(#zc-banner, #zc-modal) .zc-modal__close {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-family: Arial, Helvetica, sans-serif; /* stały krój znaku „×”, niezależnie od motywu */
	font-size: 28px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
}

:is(#zc-banner, #zc-modal) .zc-modal__close:hover {
	background: rgba(127, 127, 127, .15);
}

:is(#zc-banner, #zc-modal) .zc-modal__body {
	padding: 16px 24px;
	overflow-y: auto;
}

:is(#zc-banner, #zc-modal) .zc-modal__body > p {
	margin: 0 0 16px;
}

:is(#zc-banner, #zc-modal) .zc-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
	padding: 16px 24px;
	border-top: 1px solid rgba(127, 127, 127, .25);
}

:is(#zc-banner, #zc-modal) .zc-cat {
	padding: 14px 0;
	border-top: 1px solid rgba(127, 127, 127, .2);
}

:is(#zc-banner, #zc-modal) .zc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

:is(#zc-banner, #zc-modal) .zc-cat__name {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

:is(#zc-banner, #zc-modal) .zc-cat__chevron {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform .15s;
}

:is(#zc-banner, #zc-modal) .zc-cat__name[aria-expanded="true"] .zc-cat__chevron {
	transform: rotate(45deg);
}

:is(#zc-banner, #zc-modal) .zc-cat__count {
	font-weight: 400;
	opacity: .7;
}

:is(#zc-banner, #zc-modal) .zc-cat__always {
	font-size: .9em;
	font-weight: 600;
	color: #15803d;
}

:is(#zc-banner, #zc-modal) .zc-cat__desc {
	margin: 6px 0 0;
	font-size: .93em;
	opacity: .85;
}

:is(#zc-banner, #zc-modal) .zc-cat__details {
	margin-top: 10px;
}

:is(#zc-banner, #zc-modal) .zc-switch {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 48px;
	height: 26px;
	margin: 0;
	cursor: pointer;
}

:is(#zc-banner, #zc-modal) .zc-switch input {
	position: absolute;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

:is(#zc-banner, #zc-modal) .zc-switch__slider {
	position: absolute;
	inset: 0;
	border-radius: 26px;
	background: #9ca3af;
	transition: background .15s;
	pointer-events: none;
}

:is(#zc-banner, #zc-modal) .zc-switch__slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform .15s;
}

:is(#zc-banner, #zc-modal) .zc-switch input:checked + .zc-switch__slider {
	background: var(--zc-primary);
}

:is(#zc-banner, #zc-modal) .zc-switch input:checked + .zc-switch__slider::before {
	transform: translateX(22px);
}

:is(#zc-banner, #zc-modal) .zc-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

:is(#zc-banner, #zc-modal) .zc-consent-info {
	margin: 16px 0 0;
	padding: 10px 12px;
	border-radius: var(--zc-radius);
	background: rgba(127, 127, 127, .1);
	font-size: .85em;
}

:is(#zc-banner, #zc-modal) .zc-muted {
	opacity: .7;
}

/* ---------- Tabela ciasteczek (okno + polityka cookies) ---------- */

.zc-table-wrap {
	overflow-x: auto;
}

.zc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .88em;
}

.zc-table th,
.zc-table td {
	padding: 6px 8px;
	border: 1px solid rgba(127, 127, 127, .3);
	text-align: left;
	vertical-align: top;
}

.zc-table th {
	background: rgba(127, 127, 127, .1);
}

.zc-table code {
	word-break: break-all;
}

/* ---------- Przycisk ponownego otwarcia ---------- */

#zc-revisit {
	position: fixed;
	bottom: 16px;
	z-index: 2147482999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--zc-primary);
	color: var(--zc-primary-text);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
	cursor: pointer;
}

/* Motyw uniwersytecki i Elementor: biała ramka z cienką ciemną obwódką – przycisk jest widoczny także
   na tle w kolorze przycisku (np. na granatowej stopce strony uczelni) i na jasnym tle. */
#zc-revisit.zc-style-university,
#zc-revisit.zc-style-elementor {
	box-sizing: border-box;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 2px 10px rgba(0, 0, 0, .3);
}

#zc-revisit.zc-revisit--left {
	left: 16px;
}

#zc-revisit.zc-revisit--right {
	right: 16px;
}

.zc-open-settings {
	cursor: pointer;
}

/* ---------- Telefony ---------- */

@media (max-width: 782px) {
	:is(#zc-banner, #zc-modal) .zc-banner__inner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
	}

	:is(#zc-banner, #zc-modal) .zc-banner__buttons,
:is(#zc-banner, #zc-modal) .zc-modal__footer {
		flex-direction: column-reverse;
	}

	:is(#zc-banner, #zc-modal) .zc-banner__buttons .zc-btn,
:is(#zc-banner, #zc-modal) .zc-modal__footer .zc-btn {
		width: 100%;
	}

	#zc-banner.zc-pos-box-left,
#zc-banner.zc-pos-box-right {
		left: 16px;
		right: 16px;
		bottom: 16px;
		width: auto;
	}

	:is(#zc-banner, #zc-modal) .zc-banner__text {
		max-height: 45vh;
		overflow-y: auto;
	}

	:is(#zc-banner, #zc-modal) .zc-modal__header,
:is(#zc-banner, #zc-modal) .zc-modal__body,
:is(#zc-banner, #zc-modal) .zc-modal__footer {
		padding-left: 16px;
		padding-right: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	:is(#zc-banner, #zc-modal) .zc-btn,
:is(#zc-banner, #zc-modal) .zc-switch__slider,
:is(#zc-banner, #zc-modal) .zc-switch__slider::before,
:is(#zc-banner, #zc-modal) .zc-cat__chevron {
		transition: none;
	}
}
