/**
 * Cookie Consent Banner + Privacy Footer
 *
 * Styles for the GDPR cookie consent banner, floating settings icon,
 * category toggles, and the auto-injected privacy footer links.
 */

/* ── Floating settings icon ────────────────────────────────────────────────── */

.cc-fab {
	position: fixed;
	bottom: 1rem;
	left: 1rem;
	z-index: 99998;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: var(--wp--preset--color--surface, #fff);
	color: var(--wp--preset--color--text, #1a1a1a);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .15), 0 1px 3px rgba(0, 0, 0, .1);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease, box-shadow .15s ease;
	-webkit-tap-highlight-color: transparent;
}

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

.cc-fab:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

/* ── Banner ────────────────────────────────────────────────────────────────── */

.cc {
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 99999;
	padding: 1rem;
	font-family: var(--wp--preset--font-family--body, "Untitled Sans", system-ui, sans-serif);
}

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

.cc__inner {
	max-width: 480px;
	margin: 0;
	padding: 1.5rem;
	background: var(--wp--preset--color--surface, #fff);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--text, #1a1a1a) 10%, transparent);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, .1), 0 -1px 6px rgba(0, 0, 0, .06);
	opacity: 0;
	transform: translateY(12px);
	max-height: 90vh;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.cc.is-visible .cc__inner {
	animation: ccSlideUp .3s ease forwards;
}

@keyframes ccSlideUp {
	to { opacity: 1; transform: translateY(0); }
}

.cc__title {
	margin: 0 0 .5rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--wp--preset--color--text, #1a1a1a);
}

.cc__text {
	margin: 0 0 1rem;
	font-size: .875rem;
	line-height: 1.6;
	color: var(--wp--preset--color--text, #1a1a1a);
}

.cc__link {
	color: var(--wp--preset--color--primary, #0170b9);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.cc__btn {
	padding: .625rem 1.5rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--text, #1a1a1a) 15%, transparent);
	background: transparent;
	font-size: .8125rem;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
	-webkit-tap-highlight-color: transparent;
	flex: 1;
	text-align: center;
	min-width: 0;
}

.cc__btn--accept {
	background: var(--wp--preset--color--text, #1a1a1a);
	color: var(--wp--preset--color--surface, #fff);
	border-color: transparent;
}

.cc__btn--accept:hover { opacity: .85; }

.cc__btn--save {
	background: transparent;
	border-color: color-mix(in srgb, var(--wp--preset--color--text, #1a1a1a) 20%, transparent);
}

.cc__btn--reject:hover,
.cc__btn--settings:hover,
.cc__btn--save:hover {
	background: color-mix(in srgb, var(--wp--preset--color--text, #1a1a1a) 6%, transparent);
}

/* ── Details / categories panel ────────────────────────────────────────────── */

.cc__details {
	padding-top: 1rem;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--text, #1a1a1a) 8%, transparent);
	margin-top: 1rem;
}

.cc__details[hidden] { display: none; }

.cc__details .cc__actions { margin-top: 1rem; }

.cc__category {
	display: block;
	padding: .75rem 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--text, #1a1a1a) 6%, transparent);
	cursor: default;
}

.cc__category:last-of-type { border-bottom: none; }

label.cc__category { cursor: pointer; }

.cc__cat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: .875rem;
}

.cc__cat-desc {
	margin: .375rem 0 0;
	font-size: .8125rem;
	color: var(--wp--preset--color--text-muted, #666);
	line-height: 1.5;
}

/* "Alltid aktiv" label */
.cc__always-active {
	font-size: .75rem;
	font-weight: 600;
	color: #16a34a;
	text-transform: uppercase;
	letter-spacing: .02em;
}

/* ── Toggle switch ─────────────────────────────────────────────────────────── */

.cc__toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

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

.cc__toggle-track {
	display: block;
	width: 44px;
	height: 24px;
	border-radius: 12px;
	background: color-mix(in srgb, var(--wp--preset--color--text, #1a1a1a) 20%, transparent);
	transition: background .2s ease;
	cursor: pointer;
}

.cc__toggle-track::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	transition: transform .2s ease;
}

.cc__toggle input:checked + .cc__toggle-track {
	background: var(--wp--preset--color--text, #1a1a1a);
}

.cc__toggle input:checked + .cc__toggle-track::after {
	transform: translateX(20px);
}

/* ── Inline reopen link/button ─────────────────────────────────────────────── */

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

.cc-reopen:hover { opacity: .7; }

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
	.cc { padding: .5rem; }
	.cc__inner { padding: 1rem; }
	.cc__actions { flex-direction: column; }
	.cc__btn { width: 100%; text-align: center; }
	.cc-fab { bottom: .75rem; left: .75rem; width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
	.cc__inner { animation: none; opacity: 1; transform: none; }
}

/* ── Privacy footer ────────────────────────────────────────────────────────── */

.privacy-footer {
	text-align: center;
	padding: .75rem 1rem;
	font-size: .75rem;
	color: var(--wp--preset--color--text-muted, #666);
	font-family: var(--wp--preset--font-family--body, "Untitled Sans", system-ui, sans-serif);
}

.privacy-footer a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.privacy-footer a:hover,
.privacy-footer .cc-reopen:hover { opacity: .7; }

.privacy-footer__sep {
	margin: 0 .5rem;
	opacity: .4;
}
