/**
 * Cyberiusz Cookies - style banera i okna ustawień.
 *
 * Kolory i kroje pisma dziedziczą po motywie tam, gdzie to możliwe.
 * Zmienne poniżej pozwalają dostroić wygląd bez ruszania reszty arkusza.
 */

.cyb-cookies {
	--cyb-ink: #0E1B33;
	--cyb-slate: #5A6A85;
	--cyb-line: #E4EAF3;
	--cyb-blue: #2B62F6;
	--cyb-blue-soft: #EBF1FE;
	--cyb-radius: 16px;
	--cyb-shadow: 0 18px 50px rgba(14, 27, 51, .16);

	font-family: inherit;
}

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

.cyb-cookies__banner {
	position: fixed;
	left: 24px;
	right: 24px;
	bottom: 24px;
	z-index: 99998;
	display: none;
	gap: 28px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	max-width: 1180px;
	margin: 0 auto;
	padding: 26px 30px;
	background: #fff;
	border: 1px solid var(--cyb-line);
	border-radius: var(--cyb-radius);
	box-shadow: var(--cyb-shadow);
}

.cyb-cookies[data-pos="center"] .cyb-cookies__banner {
	top: 50%;
	bottom: auto;
	transform: translateY(-50%);
	max-width: 560px;
	flex-direction: column;
	align-items: flex-start;
}

.cyb-cookies[data-open="banner"] .cyb-cookies__banner {
	display: flex;
	animation: cyb-up .32s ease both;
}

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

.cyb-cookies[data-pos="center"][data-open="banner"] .cyb-cookies__banner {
	animation: none;
}

.cyb-cookies__body {
	flex: 1 1 460px;
	min-width: 0;
}

.cyb-cookies__title {
	margin: 0 0 8px;
	font-size: 1.06rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--cyb-ink);
}

.cyb-cookies__text {
	margin: 0;
	font-size: .9rem;
	line-height: 1.65;
	color: var(--cyb-slate);
}

.cyb-cookies__text a {
	color: var(--cyb-blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cyb-cookies__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	flex-shrink: 0;
}

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

.cyb-cookies .cyb-btn {
	font: inherit;
	font-size: .88rem;
	font-weight: 600;
	padding: 12px 20px;
	border-radius: 100px;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: .18s ease;
	white-space: nowrap;
}

.cyb-cookies .cyb-btn--primary {
	background: var(--cyb-blue);
	color: #fff;
}

.cyb-cookies .cyb-btn--primary:hover {
	background: #1A4FE0;
}

.cyb-cookies .cyb-btn--ghost {
	background: #fff;
	color: var(--cyb-ink);
	border-color: var(--cyb-line);
}

.cyb-cookies .cyb-btn--ghost:hover {
	border-color: var(--cyb-blue);
	color: var(--cyb-blue);
}

.cyb-cookies .cyb-btn:focus-visible {
	outline: 3px solid var(--cyb-blue-soft);
	outline-offset: 2px;
}

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

/*
 * Atrybut hidden musi wygrać z display ustawionym na klasie. Domyślny styl
 * przeglądarki dla [hidden] ma niższą specyficzność niż reguła klasowa,
 * przez co element z display:flex pozostawał widoczny mimo hidden.
 */
.cyb-cookies [hidden] {
	display: none !important;
}

.cyb-cookies__overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(14, 27, 51, .5);
	backdrop-filter: blur(2px);
}

.cyb-cookies__modal {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 99999;
	width: min(620px, calc(100vw - 32px));
	max-height: min(86vh, 780px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: var(--cyb-radius);
	box-shadow: var(--cyb-shadow);
	overflow: hidden;
}

.cyb-cookies__modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 24px 28px;
	border-bottom: 1px solid var(--cyb-line);
}

.cyb-cookies__modal-head h2 {
	margin: 0;
	font-size: 1.16rem;
	font-weight: 700;
	color: var(--cyb-ink);
}

.cyb-cookies__close {
	background: none;
	border: none;
	font-size: 1.7rem;
	line-height: 1;
	color: var(--cyb-slate);
	cursor: pointer;
	padding: 0 4px;
	transition: .16s;
}

.cyb-cookies__close:hover {
	color: var(--cyb-ink);
}

.cyb-cookies__modal-body {
	padding: 24px 28px;
	overflow-y: auto;
	flex: 1;
}

.cyb-cookies__lead {
	margin: 0 0 22px;
	font-size: .9rem;
	line-height: 1.65;
	color: var(--cyb-slate);
}

.cyb-cookies__modal-foot {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
	padding: 20px 28px;
	border-top: 1px solid var(--cyb-line);
	background: #F8FAFD;
}

/* ---------------------------------------------------------------- */
/* Kategorie                                                         */
/* ---------------------------------------------------------------- */

.cyb-cat {
	padding: 18px 0;
	border-bottom: 1px solid var(--cyb-line);
}

.cyb-cat:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.cyb-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 8px;
}

.cyb-cat__badge {
	font-size: .74rem;
	font-weight: 600;
	color: var(--cyb-blue);
	background: var(--cyb-blue-soft);
	padding: 4px 11px;
	border-radius: 100px;
	white-space: nowrap;
}

.cyb-cat__desc {
	margin: 0;
	font-size: .86rem;
	line-height: 1.65;
	color: var(--cyb-slate);
}

/* Przełącznik */

.cyb-switch {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
}

.cyb-switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.cyb-switch__track {
	position: relative;
	width: 44px;
	height: 25px;
	border-radius: 100px;
	background: #CBD6E8;
	transition: .2s;
	flex-shrink: 0;
}

.cyb-switch__dot {
	position: absolute;
	left: 3px;
	top: 3px;
	width: 19px;
	height: 19px;
	border-radius: 50%;
	background: #fff;
	transition: .2s;
	box-shadow: 0 1px 3px rgba(14, 27, 51, .2);
}

.cyb-switch input:checked + .cyb-switch__track {
	background: var(--cyb-blue);
}

.cyb-switch input:checked + .cyb-switch__track .cyb-switch__dot {
	transform: translateX(19px);
}

.cyb-switch input:disabled + .cyb-switch__track {
	background: #A8BEF6;
	cursor: not-allowed;
}

.cyb-switch input:focus-visible + .cyb-switch__track {
	outline: 3px solid var(--cyb-blue-soft);
	outline-offset: 2px;
}

.cyb-switch__label {
	font-size: .97rem;
	font-weight: 600;
	color: var(--cyb-ink);
}

/* ---------------------------------------------------------------- */
/* Odnośnik ponownego otwarcia                                       */
/* ---------------------------------------------------------------- */

.cyb-cookies-reopen {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cyb-cookies-reopen:hover {
	color: var(--cyb-blue, #2B62F6);
}

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

@media (max-width: 780px) {
	.cyb-cookies__banner {
		left: 12px;
		right: 12px;
		bottom: 12px;
		padding: 22px;
		gap: 18px;
	}

	.cyb-cookies__actions {
		width: 100%;
	}

	.cyb-cookies .cyb-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	.cyb-cookies__modal-head,
	.cyb-cookies__modal-body,
	.cyb-cookies__modal-foot {
		padding-left: 20px;
		padding-right: 20px;
	}

	.cyb-cookies__modal-foot .cyb-btn {
		flex: 1 1 100%;
	}
}

/* Szanujemy systemowe ograniczenie animacji. */
@media (prefers-reduced-motion: reduce) {
	.cyb-cookies[data-open="banner"] .cyb-cookies__banner {
		animation: none;
	}

	.cyb-cookies .cyb-btn,
	.cyb-switch__track,
	.cyb-switch__dot {
		transition: none;
	}
}
