/* Kalnberzs Cookie Consent */
:root {
	--kcc-primary: #1d4ed8;
	--kcc-bg: #ffffff;
	--kcc-text: #1f2937;
	--kcc-muted: #4b5563;
	--kcc-border: #e5e7eb;
	--kcc-radius: 8px;
}

.kcc-banner[hidden],
.kcc-reopen[hidden] {
	display: none !important;
}

.kcc-banner {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 99998;
	max-width: 1100px;
	margin: 0 auto;
	background: var(--kcc-bg);
	color: var(--kcc-text);
	border: 1px solid var(--kcc-border);
	border-radius: var(--kcc-radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
	font-size: 15px;
	line-height: 1.5;
}

.kcc-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 20px;
}

.kcc-banner__text {
	flex: 1 1 420px;
}

.kcc-banner__text p {
	margin: 0;
	color: var(--kcc-muted);
}

.kcc-banner__text .kcc-banner__title {
	margin-bottom: 4px;
	font-weight: 700;
	color: var(--kcc-text);
}

.kcc-banner a,
.kcc-modal a {
	color: var(--kcc-primary);
	text-decoration: underline;
}

.kcc-banner__buttons,
.kcc-modal__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* "Accept" and "Reject" deliberately look the same. */
.kcc-btn {
	flex: 1 1 auto;
	padding: 10px 18px;
	border: 2px solid var(--kcc-primary);
	border-radius: var(--kcc-radius);
	background: var(--kcc-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.kcc-btn--secondary {
	background: transparent;
	color: var(--kcc-primary);
}

.kcc-btn:hover {
	filter: brightness(1.1);
}

.kcc-btn:focus-visible,
.kcc-reopen:focus-visible,
.kcc-modal__close:focus-visible,
.kcc-switch:focus-visible {
	outline: 3px solid var(--kcc-primary);
	outline-offset: 2px;
}

/* Settings dialog */
.kcc-modal {
	width: min(560px, calc(100% - 32px));
	max-height: calc(100% - 32px);
	padding: 0;
	border: 0;
	border-radius: var(--kcc-radius);
	background: var(--kcc-bg);
	color: var(--kcc-text);
	font-size: 15px;
	line-height: 1.5;
}

.kcc-modal::backdrop {
	background: rgba(0, 0, 0, .5);
}

.kcc-modal__form {
	margin: 0;
	padding: 20px;
}

.kcc-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.kcc-modal__head h2 {
	margin: 0;
	font-size: 20px;
}

.kcc-modal__close {
	border: 0;
	background: none;
	color: var(--kcc-muted);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.kcc-cat {
	padding: 12px 0;
	border-bottom: 1px solid var(--kcc-border);
}

.kcc-cat p {
	margin: 4px 0 0;
	color: var(--kcc-muted);
	font-size: 14px;
}

.kcc-cat__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	cursor: pointer;
}

.kcc-cat__always {
	color: var(--kcc-primary);
	font-size: 13px;
	font-weight: 600;
}

.kcc-modal__policy {
	margin: 12px 0 0;
	font-size: 14px;
}

.kcc-modal__buttons {
	margin-top: 16px;
}

/* Toggle switch */
.kcc-switch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	margin: 0;
	border-radius: 12px;
	background: #9ca3af;
	cursor: pointer;
	transition: background .2s;
}

.kcc-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform .2s;
}

.kcc-switch:checked {
	background: var(--kcc-primary);
}

.kcc-switch:checked::after {
	transform: translateX(20px);
}

/* Floating "cookie settings" button */
.kcc-reopen {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 99997;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--kcc-primary);
	color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
	cursor: pointer;
}

@media (max-width: 600px) {
	.kcc-banner {
		left: 8px;
		right: 8px;
		bottom: 8px;
	}

	.kcc-banner__buttons,
	.kcc-modal__buttons {
		flex-direction: column;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kcc-switch,
	.kcc-switch::after {
		transition: none;
	}
}
