/**
 * CookieZee — OTI (jasny motyw, brand primary)
 */

.cookiezee {
	--cz-bg: #ffffff;
	--cz-surface: #f7f8fa;
	--cz-border: rgba(31, 41, 55, 0.12);
	--cz-text: #1f2937;
	--cz-text-muted: #6b7280;
	--cz-purple: #a21e19;
	--cz-glow: rgba(162, 30, 25, 0.22);
	--cz-glow-soft: rgba(162, 30, 25, 0.12);
	--cz-btn-bg: #a21e19;
	--cz-btn-text: #ffffff;
	--cz-btn-radius: 999px;
	--cz-btn-hover-bg: #7a1612;
	--cz-btn-hover-text: #ffffff;
	--cz-link: #a21e19;
	--cz-font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
	--cz-z: 999999;
}

#cookiezee-root {
	position: fixed;
	inset: 0;
	z-index: var(--cz-z);
	pointer-events: none;
}

#cookiezee-root:not([hidden]) {
	display: block;
}

.cookiezee__overlay,
.cookiezee__dialog,
.cookiezee-fab {
	pointer-events: auto;
}

html.cookiezee-open {
	overflow: hidden;
}

.cookiezee[hidden] {
	display: none !important;
}

.cookiezee:not([hidden]) {
	display: contents;
}

.cookiezee__overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, 0.42);
	z-index: var(--cz-z);
}

.cookiezee__dialog {
	position: fixed;
	z-index: calc(var(--cz-z) + 1);
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	max-height: calc(100vh - 32px);
	overflow: auto;
	background: var(--cz-bg);
	border: 1px solid var(--cz-border);
	border-radius: 20px;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.6),
		0 20px 56px rgba(17, 24, 39, 0.18),
		6px 0 40px var(--cz-glow),
		-4px 0 28px var(--cz-glow-soft);
	color: var(--cz-text);
	font-family: var(--cz-font);
	padding: 28px 32px 20px;
}

.cookiezee__dialog[hidden] {
	display: none !important;
}

.cookiezee__dialog--banner {
	width: min(580px, calc(100vw - 24px));
	text-align: center;
	padding-top: 36px;
	scrollbar-width: thin;
	scrollbar-color: var(--cz-btn-bg) rgba(17, 24, 39, 0.06);
}

.cookiezee__dialog--settings {
	width: min(560px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 32px));
	max-height: min(640px, calc(100vh - 32px));
	padding: 24px 22px 18px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cookiezee__dialog--settings .cookiezee__title {
	flex-shrink: 0;
	margin-bottom: 12px;
}

.cookiezee__settings-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	margin-bottom: 8px;
	padding-right: 6px;
	scrollbar-width: thin;
	scrollbar-color: var(--cz-btn-bg) transparent;
}

.cookiezee__settings-scroll::-webkit-scrollbar,
.cookiezee__dialog--banner::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

.cookiezee__settings-scroll::-webkit-scrollbar-track,
.cookiezee__dialog--banner::-webkit-scrollbar-track {
	background: rgba(17, 24, 39, 0.05);
	border-radius: 999px;
	margin: 6px 0;
}

.cookiezee__settings-scroll::-webkit-scrollbar-thumb,
.cookiezee__dialog--banner::-webkit-scrollbar-thumb {
	background: var(--cz-btn-bg);
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 0 8px var(--cz-glow-soft);
}

.cookiezee__settings-scroll::-webkit-scrollbar-thumb:hover,
.cookiezee__dialog--banner::-webkit-scrollbar-thumb:hover {
	background: var(--cz-btn-hover-bg, var(--cz-btn-bg));
}

.cookiezee__dialog--settings .cookiezee__actions--stack {
	flex-shrink: 0;
}

.cookiezee__banner-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}

.cookiezee__icon-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(162, 30, 25, 0.12);
	color: var(--cz-btn-bg);
	box-shadow: 0 0 24px var(--cz-glow);
}

.cookiezee__icon-svg {
	display: block;
	flex-shrink: 0;
}

.cookiezee__title {
	margin: 0 0 16px;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--cz-text);
}

.cookiezee__title--center {
	font-size: 1.5rem;
	margin-bottom: 14px;
}

.cookiezee__text {
	margin: 0 auto 24px;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--cz-text-muted);
	max-width: 720px;
}

.cookiezee__text--center {
	text-align: center;
}

.cookiezee__link {
	color: var(--cz-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cookiezee__link:hover {
	opacity: 0.9;
}

.cookiezee__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
}

.cookiezee__actions--row {
	flex-direction: row;
}

.cookiezee__actions--equal {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	width: 100%;
	gap: 8px;
}

.cookiezee__btn--equal {
	min-width: 0;
	white-space: normal;
	text-align: center;
	padding: 11px 8px;
	font-size: 0.8rem;
	line-height: 1.25;
}

.cookiezee__actions--stack {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
	margin-bottom: 8px;
}

.cookiezee__btn {
	appearance: none;
	border: 1px solid var(--cz-btn-bg);
	border-radius: var(--cz-btn-radius);
	background: var(--cz-btn-bg);
	color: var(--cz-btn-text);
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 11px 18px;
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		transform 0.15s ease;
	white-space: nowrap;
}

.cookiezee__btn:hover,
.cookiezee__btn:focus-visible {
	background: var(--cz-btn-hover-bg);
	border-color: var(--cz-btn-hover-bg);
	color: var(--cz-btn-hover-text);
	outline: none;
}

.cookiezee__btn:active {
	transform: scale(0.98);
}

.cookiezee__btn--block {
	flex: 1 1 0;
	min-width: 0;
	padding: 11px 18px;
	font-size: 0.82rem;
	white-space: normal;
	text-align: center;
}

.cookiezee__categories {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 4px;
}

.cookiezee__category {
	background: var(--cz-surface);
	border: 1px solid var(--cz-border);
	border-radius: 12px;
	overflow: hidden;
}

.cookiezee__category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
}

.cookiezee__category-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
	background: none;
	border: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	font-size: 0.92rem;
	text-align: left;
	cursor: pointer;
	padding: 0;
}

.cookiezee__chevron {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
	flex-shrink: 0;
	margin-top: -2px;
}

.cookiezee__category.is-expanded .cookiezee__chevron {
	transform: rotate(-135deg);
	margin-top: 2px;
}

.cookiezee__category-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cookiezee__switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
}

.cookiezee__switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.cookiezee__switch-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: #d1d5db;
	border-radius: 24px;
	transition: background 0.2s ease;
}

.cookiezee__switch-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 3px rgba(17, 24, 39, 0.2);
}

.cookiezee__switch input:checked + .cookiezee__switch-slider {
	background: var(--cz-btn-bg);
}

.cookiezee__switch input:checked + .cookiezee__switch-slider::before {
	transform: translateX(20px);
}

.cookiezee__switch input:disabled + .cookiezee__switch-slider {
	opacity: 0.95;
	cursor: not-allowed;
}

.cookiezee__category-body {
	display: none;
	padding: 0 14px 14px 32px;
}

.cookiezee__category.is-expanded .cookiezee__category-body {
	display: block;
}

.cookiezee__category-desc {
	margin: 0 0 12px;
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--cz-text-muted);
}

.cookiezee__category-detail {
	border-top: 1px solid var(--cz-border);
	padding-top: 12px;
}

.cookiezee__cookies-placeholder,
.cookiezee__cookies-empty {
	margin: 0;
	font-size: 0.78rem;
	color: #9ca3af;
	line-height: 1.45;
}

.cookiezee__cookie-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cookiezee__cookie-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 8px;
	background: rgba(17, 24, 39, 0.04);
	border-radius: 6px;
	font-size: 0.76rem;
}

.cookiezee__cookie-name {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	color: #374151;
	word-break: break-all;
}

.cookiezee__cookie-status {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	flex-shrink: 0;
}

.cookiezee__cookie-status.is-active {
	color: #15803d;
}

.cookiezee__cookie-status.is-inactive {
	color: #9ca3af;
}

.cookiezee__cookies-note {
	margin: 8px 0 0;
	font-size: 0.68rem;
	color: #9ca3af;
	line-height: 1.4;
}

.cookiezee-fab {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: calc(var(--cz-z, 999999) + 2);
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: none;
	background: #a21e19;
	color: #fff;
	box-shadow:
		0 6px 20px rgba(162, 30, 25, 0.3),
		0 0 0 1px rgba(255, 255, 255, 0.2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background-color 0.2s ease,
		transform 0.15s ease,
		box-shadow 0.2s ease;
}

.cookiezee-fab[hidden] {
	display: none !important;
}

.cookiezee-fab:hover,
.cookiezee-fab:focus-visible {
	background: #7a1612;
	color: #fff;
	outline: none;
	transform: scale(1.05);
}

.cookiezee-fab:active {
	transform: scale(0.96);
}

@media (max-width: 720px) {
	.cookiezee__dialog--banner {
		padding: 24px 18px 16px;
	}

	.cookiezee__actions--stack {
		flex-direction: column;
		width: 100%;
	}

	.cookiezee__actions--equal {
		grid-template-columns: repeat(3, 1fr);
		gap: 6px;
	}

	.cookiezee__btn--equal {
		font-size: 0.72rem;
		padding: 10px 4px;
		line-height: 1.2;
	}

	.cookiezee__btn--block {
		width: 100%;
		flex: 1 1 auto;
		min-width: 0;
	}
}

@media (min-width: 721px) {
	.cookiezee__actions--row {
		flex-direction: row;
		flex-wrap: nowrap;
	}

	.cookiezee__actions--stack {
		flex-direction: row;
		flex-wrap: nowrap;
	}

	.cookiezee__btn--equal {
		font-size: 0.82rem;
	}
}
