/*!
 * Universy Cookies — style banera zgody.
 * Zamknięte w .ucc-root, zmienne --ucc-* (domyślnie tokeny Universy). Nadpiszesz je jednym
 * kolorem w ustawieniach (--ucc-accent) albo własnym CSS. Font dziedziczony z motywu strony.
 */

.ucc-root {
	--ucc-accent: #4A7BF7;
	--ucc-accent-strong: #2E54C4;
	--ucc-radius: 9px;

	--ucc-surface: #FFFFFF;
	--ucc-surface-2: #FAF9F5;
	--ucc-ink: #05070E;
	--ucc-text: #4A5568;
	--ucc-muted: #6B7689;
	--ucc-line: rgba(10, 14, 28, 0.12);

	--ucc-primary-bg: #05070E;
	--ucc-primary-fg: #FFFFFF;
	--ucc-primary-bg-hover: var(--ucc-accent-strong);
	--ucc-ghost-fg: #05070E;
	--ucc-ghost-border: rgba(10, 14, 28, 0.20);

	--ucc-backdrop: rgba(5, 7, 14, 0.55);
	--ucc-shadow: 0 -6px 44px -14px rgba(10, 14, 28, 0.22), 0 2px 10px -6px rgba(10, 14, 28, 0.14);
	--ucc-shadow-modal: 0 34px 90px -24px rgba(5, 7, 14, 0.55);

	font-family: inherit;
	line-height: 1.55;
	color: var(--ucc-text);
}

.ucc-root[data-ucc-theme="dark"] {
	--ucc-surface: #0F1A3E;
	--ucc-surface-2: #0A1128;
	--ucc-ink: #FFFFFF;
	--ucc-text: rgba(255, 255, 255, 0.80);
	--ucc-muted: rgba(255, 255, 255, 0.56);
	--ucc-line: rgba(255, 255, 255, 0.16);
	--ucc-primary-bg: var(--ucc-accent);
	--ucc-primary-fg: #FFFFFF;
	--ucc-primary-bg-hover: var(--ucc-accent-strong);
	--ucc-ghost-fg: #FFFFFF;
	--ucc-ghost-border: rgba(255, 255, 255, 0.30);
	--ucc-backdrop: rgba(2, 4, 10, 0.70);
}

.ucc-root *,
.ucc-root *::before,
.ucc-root *::after { box-sizing: border-box; }

/* ---------- Banner ---------- */

.ucc-banner {
	position: fixed;
	z-index: 2147483000;
	left: 0;
	right: 0;
	bottom: 0;
	display: none;
	gap: clamp(16px, 3vw, 40px);
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	padding: 20px clamp(16px, 4vw, 40px);
	background: var(--ucc-surface);
	border-top: 1px solid var(--ucc-line);
	box-shadow: var(--ucc-shadow);
}
.ucc-banner.is-visible { display: flex; animation: ucc-slide-up .45s cubic-bezier(0.16, 1, 0.3, 1); }

.ucc-root[data-ucc-pos="box"] .ucc-banner {
	left: auto;
	right: clamp(14px, 3vw, 28px);
	bottom: clamp(14px, 3vw, 28px);
	max-width: 460px;
	flex-direction: column;
	align-items: stretch;
	border: 1px solid var(--ucc-line);
	border-radius: var(--ucc-radius);
	padding: 26px;
}
/* W układzie kolumnowym (karta) tekst ma mieć NATURALNĄ wysokość, nie 420px z flex-basis */
.ucc-root[data-ucc-pos="box"] .ucc-banner-text { flex: 0 1 auto; min-width: 0; }

.ucc-banner-text { flex: 1 1 420px; min-width: 260px; }

.ucc-title {
	margin: 0 0 6px;
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--ucc-ink);
	letter-spacing: -0.01em;
}
.ucc-desc { margin: 0; font-size: 0.9rem; color: var(--ucc-text); }

.ucc-link { color: var(--ucc-accent); text-decoration: underline; text-underline-offset: 2px; }
.ucc-link:hover { color: var(--ucc-accent-strong); }

.ucc-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	flex-shrink: 0;
}
.ucc-root[data-ucc-pos="box"] .ucc-actions { margin-top: 20px; }

/* ---------- Buttons (język przycisków Universy) ---------- */

.ucc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 24px;
	font-family: inherit;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1;
	white-space: nowrap;
	border: 1px solid transparent;
	border-radius: var(--ucc-radius);
	cursor: pointer;
	transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1), background .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.ucc-btn:focus-visible { outline: 2px solid var(--ucc-accent); outline-offset: 2px; }

.ucc-btn-primary {
	background: var(--ucc-primary-bg);
	color: var(--ucc-primary-fg);
	box-shadow: 0 1px 1px rgba(10, 14, 28, 0.05), 0 8px 20px -12px rgba(10, 14, 28, 0.55);
}
.ucc-btn-primary:hover {
	background: var(--ucc-primary-bg-hover);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 14px 30px -12px rgba(46, 84, 196, 0.55);
}

/* GHOST = „Odrzuć” — równorzędny wizualnie z „Akceptuj” (wymóg EDPB: równa waga wyboru) */
.ucc-btn-ghost {
	background: transparent;
	color: var(--ucc-ghost-fg);
	border-color: var(--ucc-ghost-border);
}
.ucc-btn-ghost:hover {
	background: var(--ucc-ink);
	border-color: var(--ucc-ink);
	color: #fff;
	transform: translateY(-2px);
}
.ucc-root[data-ucc-theme="dark"] .ucc-btn-ghost:hover { background: #fff; border-color: #fff; color: var(--ucc-ink); }

/* LINK = „Ustawienia” — trzeciorzędny, ale wyraźny */
.ucc-btn-link {
	background: transparent;
	color: var(--ucc-muted);
	padding-left: 14px;
	padding-right: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ucc-btn-link:hover { color: var(--ucc-ink); }
.ucc-root[data-ucc-theme="dark"] .ucc-btn-link:hover { color: #fff; }

/* ---------- Modal ---------- */

.ucc-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: var(--ucc-backdrop);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}
.ucc-modal.is-visible { display: flex; animation: ucc-fade .3s ease; }

.ucc-modal-panel {
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	overflow-y: auto;
	background: var(--ucc-surface);
	border-radius: 14px;
	box-shadow: var(--ucc-shadow-modal);
	animation: ucc-pop .4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ucc-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 24px 26px 14px;
}
.ucc-modal-title { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--ucc-ink); }
.ucc-close {
	flex-shrink: 0;
	display: inline-flex;
	padding: 6px;
	color: var(--ucc-muted);
	background: transparent;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.ucc-close:hover { color: var(--ucc-ink); background: var(--ucc-line); }
.ucc-close:focus-visible { outline: 2px solid var(--ucc-accent); outline-offset: 2px; }

.ucc-modal-intro { margin: 0; padding: 0 26px; font-size: 0.88rem; color: var(--ucc-text); }

.ucc-cats { padding: 16px 26px 6px; }
.ucc-cat { padding: 16px 0; border-bottom: 1px solid var(--ucc-line); }
.ucc-cat:last-child { border-bottom: none; }
.ucc-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ucc-cat-label { font-size: 0.96rem; font-weight: 600; color: var(--ucc-ink); }
.ucc-cat-desc { margin: 6px 0 0; font-size: 0.84rem; color: var(--ucc-muted); }
.ucc-always { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ucc-accent); white-space: nowrap; }

.ucc-modal-foot {
	position: sticky;
	bottom: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 18px 26px 24px;
	background: var(--ucc-surface);
	border-top: 1px solid var(--ucc-line);
}
.ucc-modal-foot .ucc-btn { flex: 1 1 auto; }

/* ---------- Switch (dostępny checkbox) ---------- */

.ucc-switch-wrap { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.ucc-switch-input {
	position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.ucc-switch {
	width: 46px; height: 26px; border-radius: 999px; background: var(--ucc-line);
	transition: background .25s ease; display: inline-block; position: relative;
}
.ucc-switch::after {
	content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
	border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ucc-switch-input:checked + .ucc-switch { background: var(--ucc-accent); }
.ucc-switch-input:checked + .ucc-switch::after { transform: translateX(20px); }
.ucc-switch-input:focus-visible + .ucc-switch { outline: 2px solid var(--ucc-accent); outline-offset: 2px; }

/* ---------- Reopen (trwały dostęp do zmiany zgody = łatwe wycofanie) ---------- */

.ucc-reopen {
	position: fixed;
	z-index: 2147482999;
	left: 18px;
	bottom: 18px;
	display: none;
	align-items: center;
	gap: 0;
	padding: 11px;
	color: var(--ucc-ink);
	background: var(--ucc-surface);
	border: 1px solid var(--ucc-line);
	border-radius: 999px;
	box-shadow: 0 6px 22px -10px rgba(10, 14, 28, 0.4);
	cursor: pointer;
	overflow: hidden;
	transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1), gap .3s ease, padding .3s ease, box-shadow .3s ease;
}
.ucc-reopen.is-visible { display: inline-flex; }
.ucc-reopen svg { display: block; flex-shrink: 0; }
.ucc-reopen-label {
	max-width: 0; opacity: 0; white-space: nowrap; overflow: hidden;
	font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
	transition: max-width .35s ease, opacity .25s ease;
}
.ucc-reopen:hover { transform: translateY(-2px); gap: 8px; padding-right: 18px; }
.ucc-reopen:hover .ucc-reopen-label { max-width: 200px; opacity: 1; }
.ucc-reopen:focus-visible { outline: 2px solid var(--ucc-accent); outline-offset: 2px; }

/* ---------- Compact (subtelny footprint) ---------- */

/* Typografia i przyciski — mniejsze, dla bar i box */
.ucc-root[data-ucc-size="compact"] .ucc-title { font-size: 0.94rem; margin-bottom: 5px; }
.ucc-root[data-ucc-size="compact"] .ucc-title::before { content: "🍪 "; }
.ucc-root[data-ucc-size="compact"] .ucc-desc { font-size: 0.82rem; line-height: 1.45; }
.ucc-root[data-ucc-size="compact"] .ucc-btn { padding: 10px 16px; font-size: 0.68rem; letter-spacing: 0.08em; }

/* Karta w rogu (box + compact) — mała, lewy dolny róg */
.ucc-root[data-ucc-size="compact"][data-ucc-pos="box"] .ucc-banner {
	right: auto;
	left: clamp(12px, 3vw, 24px);
	bottom: clamp(12px, 3vw, 24px);
	max-width: min(340px, calc(100vw - 24px));
	padding: 20px 22px;
}
.ucc-root[data-ucc-size="compact"][data-ucc-pos="box"] .ucc-actions { margin-top: 16px; gap: 8px; }
/* Odrzuć + Akceptuj równorzędnie w rzędzie; Ustawienia jako link pod spodem */
.ucc-root[data-ucc-size="compact"][data-ucc-pos="box"] .ucc-actions .ucc-btn-ghost,
.ucc-root[data-ucc-size="compact"][data-ucc-pos="box"] .ucc-actions .ucc-btn-primary { flex: 1 1 0; }
.ucc-root[data-ucc-size="compact"][data-ucc-pos="box"] .ucc-actions .ucc-btn-link {
	order: 3;
	flex-basis: 100%;
	padding: 2px;
	margin-top: 2px;
}

/* Smukły pasek (bar + compact) — jeden niski rząd, bez tytułu */
.ucc-root[data-ucc-size="compact"][data-ucc-pos="bar"] .ucc-banner { padding: 12px clamp(16px, 4vw, 40px); gap: 16px; }
.ucc-root[data-ucc-size="compact"][data-ucc-pos="bar"] .ucc-title { display: none; }
.ucc-root[data-ucc-size="compact"][data-ucc-pos="bar"] .ucc-desc::before { content: "🍪 "; }

/* ---------- Animacje ---------- */

@keyframes ucc-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes ucc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ucc-pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.ucc-banner.is-visible, .ucc-modal.is-visible, .ucc-modal-panel { animation: none; }
	.ucc-btn, .ucc-switch::after, .ucc-reopen, .ucc-close { transition: none; }
	.ucc-btn:hover, .ucc-reopen:hover { transform: none; }
}

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

@media (max-width: 640px) {
	.ucc-banner { padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
	.ucc-actions { width: 100%; }
	.ucc-actions .ucc-btn { flex: 1 1 100%; }
	.ucc-actions .ucc-btn-link { order: 3; }
	.ucc-root[data-ucc-pos="box"] .ucc-banner { right: 0; left: 0; bottom: 0; max-width: none; border-radius: 0; }
	.ucc-modal-foot { flex-direction: column; }
	.ucc-reopen { left: 12px; bottom: 12px; }
}
