/* Cookie Consent WP — banner styles */

:root {
	--ccwp-primary: #1a73e8;
}

/* Light theme variables (default). The badge lives outside #ccwp-root,
   so both elements carry the variables and the theme class. */
#ccwp-root,
#ccwp-badge {
	--ccwp-bg: #ffffff;
	--ccwp-surface: #f4f6fa;
	--ccwp-text: #0f172a;
	--ccwp-muted: #5b6577;
	--ccwp-border: #e4e8f0;
	--ccwp-radius: 16px;
	--ccwp-shadow: 0 2px 6px rgba(15, 23, 42, 0.06), 0 24px 60px rgba(15, 23, 42, 0.22);
}

#ccwp-root.ccwp-theme-dark,
#ccwp-badge.ccwp-theme-dark {
	--ccwp-bg: #1b2331;
	--ccwp-surface: #242e40;
	--ccwp-text: #eef2f8;
	--ccwp-muted: #9aa6ba;
	--ccwp-border: #2e3a4f;
	--ccwp-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 24px 60px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
	#ccwp-root.ccwp-theme-auto,
	#ccwp-badge.ccwp-theme-auto {
		--ccwp-bg: #1b2331;
		--ccwp-surface: #242e40;
		--ccwp-text: #eef2f8;
		--ccwp-muted: #9aa6ba;
		--ccwp-border: #2e3a4f;
		--ccwp-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 24px 60px rgba(0, 0, 0, 0.5);
	}
}

#ccwp-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--ccwp-text);
	pointer-events: none;
}

#ccwp-root[hidden] { display: none !important; }

/* Page scroll is locked while the preferences modal (or the centre-position
   banner) is open — toggled by banner.js on <html>. */
.ccwp-no-scroll,
.ccwp-no-scroll body {
	overflow: hidden !important;
}

.ccwp-overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 15, 28, 0.45);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.ccwp-pos-center .ccwp-overlay,
#ccwp-root:has(.ccwp-modal:not([hidden])) .ccwp-overlay {
	opacity: 1;
	pointer-events: auto;
}

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

.ccwp-banner {
	position: absolute;
	background: var(--ccwp-bg);
	border: 1px solid var(--ccwp-border);
	border-radius: var(--ccwp-radius);
	box-shadow: var(--ccwp-shadow);
	padding: 22px 24px;
	pointer-events: auto;
	animation: ccwp-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* !important: the bar-position media query sets display:flex with equal
   specificity later in the file — hidden must always win. */
.ccwp-banner[hidden] { display: none !important; }

/* Positions */

.ccwp-pos-bar .ccwp-banner {
	left: 16px;
	right: 16px;
	bottom: 16px;
	max-width: 880px;
	margin: 0 auto;
}

@media (min-width: 782px) {
	.ccwp-pos-bar .ccwp-banner {
		display: flex;
		align-items: center;
		gap: 28px;
	}
	.ccwp-pos-bar .ccwp-content { flex: 1 1 auto; }
	.ccwp-pos-bar .ccwp-desc { margin-bottom: 0; }
	.ccwp-pos-bar .ccwp-actions { flex-shrink: 0; }
}

.ccwp-pos-bottom-left .ccwp-banner,
.ccwp-pos-bottom-right .ccwp-banner {
	bottom: 16px;
	width: min(400px, calc(100vw - 32px));
	padding: 20px;
}

.ccwp-pos-bottom-left .ccwp-banner { left: 16px; }
.ccwp-pos-bottom-right .ccwp-banner { right: 16px; }

/* The corner card is too narrow for three buttons in one row —
   let them share the full width instead of ragged right-alignment. */
.ccwp-pos-bottom-left .ccwp-actions .ccwp-btn,
.ccwp-pos-bottom-right .ccwp-actions .ccwp-btn {
	flex: 1 1 auto;
	white-space: nowrap;
}

.ccwp-pos-center .ccwp-banner {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px));
	animation: ccwp-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Typography --- */

.ccwp-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--ccwp-text);
}

.ccwp-desc {
	margin: 0 0 16px;
	color: var(--ccwp-muted);
	font-size: 14px;
}

.ccwp-desc a {
	color: var(--ccwp-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* --- Buttons --- */

.ccwp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

.ccwp-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: var(--ccwp-btn-radius, 10px);
	padding: 10px 18px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ccwp-btn:focus-visible,
.ccwp-close:focus-visible,
.ccwp-expand:focus-visible,
#ccwp-badge:focus-visible {
	outline: 2px solid var(--ccwp-primary);
	outline-offset: 2px;
}

/* Accept: --ccwp-accept falls back to the primary colour.
   Reject: --ccwp-reject falls back to the accept colour, so by default
   both consent buttons are equally prominent (GDPR). */

.ccwp-btn-primary {
	background: var(--ccwp-accept, var(--ccwp-primary));
	color: #fff;
}

.ccwp-btn-reject {
	background: var(--ccwp-reject, var(--ccwp-accept, var(--ccwp-primary)));
	color: #fff;
}

.ccwp-btn-ghost {
	background: transparent;
	border-color: var(--ccwp-border);
	color: var(--ccwp-text);
}

.ccwp-btn-ghost:hover {
	background: var(--ccwp-surface);
}

/* Button shadow variants (class on #ccwp-root) */

.ccwp-btnshadow-soft .ccwp-btn-primary,
.ccwp-btnshadow-soft .ccwp-btn-reject {
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.ccwp-btnshadow-strong .ccwp-btn-primary,
.ccwp-btnshadow-strong .ccwp-btn-reject {
	box-shadow: 0 6px 22px rgba(15, 23, 42, 0.32);
}

/* Button hover variants (class on #ccwp-root) */

.ccwp-btnhover-lift .ccwp-btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.06);
}

.ccwp-btnhover-brighten .ccwp-btn:hover {
	filter: brightness(1.12);
}

/* --- Preferences modal --- */

.ccwp-modal {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	pointer-events: auto;
}

.ccwp-modal[hidden] { display: none !important; }

.ccwp-modal-inner {
	position: relative;
	background: var(--ccwp-bg);
	border: 1px solid var(--ccwp-border);
	border-radius: var(--ccwp-radius);
	box-shadow: var(--ccwp-shadow);
	width: min(640px, 100%);
	max-height: min(84vh, 760px);
	overflow-y: auto;
	padding: 26px 26px 22px;
	animation: ccwp-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.ccwp-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: var(--ccwp-surface);
	font-size: 20px;
	line-height: 1;
	color: var(--ccwp-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.ccwp-close:hover {
	color: var(--ccwp-text);
	filter: brightness(0.96);
}

.ccwp-category {
	border-top: 1px solid var(--ccwp-border);
	padding: 14px 0;
}

.ccwp-category-head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ccwp-category-desc {
	margin: 6px 0 0 56px;
	color: var(--ccwp-muted);
	font-size: 14px;
}

.ccwp-expand {
	margin-left: auto;
	border: 0;
	border-radius: 6px;
	padding: 2px 8px;
	background: var(--ccwp-surface);
	color: var(--ccwp-primary);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.ccwp-cookie-list {
	margin: 10px 0 0 56px;
	overflow-x: auto;
}

.ccwp-cookie-list table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.ccwp-cookie-list th,
.ccwp-cookie-list td {
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid var(--ccwp-border);
	vertical-align: top;
}

.ccwp-cookie-list code {
	background: var(--ccwp-surface);
	padding: 1px 6px;
	border-radius: 5px;
	font-size: 12px;
	color: var(--ccwp-text);
}

/* --- Toggle switch --- */

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

.ccwp-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.ccwp-slider {
	position: absolute;
	inset: 0;
	background: #c3c9d4;
	border-radius: 24px;
	transition: background 0.15s ease;
}

.ccwp-theme-dark .ccwp-slider { background: #3a475e; }

@media (prefers-color-scheme: dark) {
	.ccwp-theme-auto .ccwp-slider { background: #3a475e; }
}

.ccwp-slider::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
	transition: transform 0.15s ease;
}

.ccwp-switch input:checked + .ccwp-slider {
	background: var(--ccwp-primary);
}

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

.ccwp-switch input:focus-visible + .ccwp-slider {
	outline: 2px solid var(--ccwp-primary);
	outline-offset: 2px;
}

.ccwp-switch input:disabled + .ccwp-slider {
	opacity: 0.55;
	cursor: not-allowed;
}

/* --- Reopen badge --- */

#ccwp-badge {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999998;
	width: 48px;
	height: 48px;
	border: 1px solid var(--ccwp-border);
	border-radius: 50%;
	background: var(--ccwp-bg);
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
	font-size: 22px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#ccwp-badge:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
}

#ccwp-badge[hidden] { display: none; }

/* --- Blocked iframe placeholder --- */

iframe.ccwp-iframe-blocked {
	background: #f4f6f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='%235f6a7d' stroke-width='1.5'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center no-repeat;
	border: 1px dashed #d5dae3;
}

/* --- Declaration shortcode --- */

.ccwp-declaration table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 24px;
}

.ccwp-declaration th,
.ccwp-declaration td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid #e4e8f0;
	vertical-align: top;
}

/* --- Animations --- */

@keyframes ccwp-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: none; }
}

@keyframes ccwp-pop {
	from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
	to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.ccwp-banner,
	.ccwp-modal-inner {
		animation: none;
	}
	.ccwp-btn,
	#ccwp-badge {
		transition: none;
	}
}

/* --- Small screens: every position becomes a bottom sheet --- */

@media (max-width: 600px) {
	.ccwp-pos-bar .ccwp-banner,
	.ccwp-pos-bottom-left .ccwp-banner,
	.ccwp-pos-bottom-right .ccwp-banner,
	.ccwp-pos-center .ccwp-banner {
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		width: 100%;
		max-width: none;
		margin: 0;
		transform: none;
		border-radius: 20px 20px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
		animation: ccwp-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	}

	/* Buttons stacked, primary choice on top. */
	.ccwp-actions {
		flex-direction: column-reverse;
		gap: 8px;
	}

	.ccwp-actions .ccwp-btn {
		width: 100%;
		padding: 12px 18px;
	}

	/* Preferences modal docks to the bottom edge too. */
	.ccwp-modal {
		align-items: flex-end;
		padding: 0;
	}

	.ccwp-modal-inner {
		width: 100%;
		max-height: 88vh;
		border-radius: 20px 20px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		padding-bottom: calc(22px + env(safe-area-inset-bottom));
		animation: ccwp-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.ccwp-category-desc,
	.ccwp-cookie-list { margin-left: 0; }
}
