/* Consent Compliance – front end */
#ccomp-root,
.ccomp-embed,
.ccomp-policy {
	--ccomp-bg: #fff;
	--ccomp-text: #1f2937;
	--ccomp-btn-bg: #1d4ed8;
	--ccomp-btn-text: #fff;
	--ccomp-link: #1d4ed8;
	--ccomp-radius: 8px;
	--ccomp-border: rgba(127, 127, 127, .28);
	--ccomp-shadow: 0 10px 40px rgba(0, 0, 0, .22);
}

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

#ccomp-root,
#ccomp-root * { box-sizing: border-box; }

#ccomp-root {
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ccomp-text);
}

.ccomp-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

html.ccomp-noscroll { overflow: hidden; }

.ccomp-overlay {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: 2147483640;
}

/* ---------- Banner ---------- */
.ccomp-banner {
	position: fixed;
	z-index: 2147483645;
	background: var(--ccomp-bg);
	color: var(--ccomp-text);
	box-shadow: var(--ccomp-shadow);
	max-height: 90vh;
	overflow: auto;
}
.ccomp-banner:focus { outline: none; }

.ccomp-layout-bar .ccomp-banner,
.ccomp-layout-bar-top .ccomp-banner {
	left: 0; right: 0;
}
.ccomp-layout-bar .ccomp-banner { bottom: 0; }
.ccomp-layout-bar-top .ccomp-banner { top: 0; }
.ccomp-layout-bar .ccomp-banner__inner,
.ccomp-layout-bar-top .ccomp-banner__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 24px;
	display: flex;
	gap: 24px;
	align-items: center;
}
.ccomp-layout-bar .ccomp-banner__content,
.ccomp-layout-bar-top .ccomp-banner__content { flex: 1 1 auto; }
.ccomp-layout-bar .ccomp-actions,
.ccomp-layout-bar-top .ccomp-actions { flex: 0 0 auto; }

.ccomp-layout-box-left .ccomp-banner,
.ccomp-layout-box-right .ccomp-banner {
	bottom: 20px;
	width: 420px;
	max-width: calc(100vw - 32px);
	border-radius: var(--ccomp-radius);
}
.ccomp-layout-box-left .ccomp-banner { left: 20px; }
.ccomp-layout-box-right .ccomp-banner { right: 20px; }

.ccomp-layout-modal .ccomp-banner {
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 560px;
	max-width: calc(100vw - 32px);
	border-radius: var(--ccomp-radius);
}

.ccomp-banner__inner { padding: 22px; }

.ccomp-title {
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 8px;
	color: inherit;
}
.ccomp-text p { margin: 0 0 8px; }
.ccomp-text a,
.ccomp-links a,
.ccomp-policy a { color: var(--ccomp-link); text-decoration: underline; }
.ccomp-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }

/* ---------- Buttons ---------- */
.ccomp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}
.ccomp-layout-bar .ccomp-actions,
.ccomp-layout-bar-top .ccomp-actions { margin-top: 0; }

.ccomp-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px; /* WCAG 2.5.5 target size */
	padding: 10px 18px;
	border: 2px solid var(--ccomp-btn-bg);
	border-radius: var(--ccomp-radius);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	transition: filter .15s ease;
}
/* Accept and Reject deliberately share identical styling (equal prominence). */
.ccomp-btn--primary { background: var(--ccomp-btn-bg); color: var(--ccomp-btn-text); }
.ccomp-btn--secondary { background: transparent; color: var(--ccomp-text); border-color: currentColor; }
.ccomp-btn--link {
	background: transparent;
	color: var(--ccomp-link);
	border-color: transparent;
	text-decoration: underline;
	padding-left: 6px; padding-right: 6px;
}
.ccomp-btn:hover { filter: brightness(1.1); }
.ccomp-btn:focus-visible,
.ccomp-close:focus-visible,
.ccomp-revisit:focus-visible,
.ccomp-switch input:focus-visible + .ccomp-switch__track,
.ccomp-cat__details summary:focus-visible {
	outline: 3px solid var(--ccomp-link);
	outline-offset: 2px;
}

/* ---------- Preference centre ---------- */
.ccomp-prefs {
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.ccomp-prefs:focus { outline: none; }
.ccomp-prefs__panel {
	background: var(--ccomp-bg);
	color: var(--ccomp-text);
	width: 680px;
	max-width: 100%;
	max-height: calc(100vh - 32px);
	border-radius: var(--ccomp-radius);
	box-shadow: var(--ccomp-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.ccomp-prefs__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--ccomp-border);
}
.ccomp-prefs__header .ccomp-title { margin: 0; }
.ccomp-prefs__body { padding: 18px 22px; overflow-y: auto; }
.ccomp-prefs__footer {
	margin: 0;
	padding: 16px 22px;
	border-top: 1px solid var(--ccomp-border);
	justify-content: flex-end;
}
.ccomp-close {
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 28px;
	line-height: 1;
	width: 44px; height: 44px;
	cursor: pointer;
	border-radius: var(--ccomp-radius);
}

.ccomp-cat {
	border: 1px solid var(--ccomp-border);
	border-radius: var(--ccomp-radius);
	padding: 14px 16px;
	margin: 12px 0;
}
.ccomp-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.ccomp-cat__title { font-size: 1em; font-weight: 700; margin: 0; color: inherit; }
.ccomp-cat__desc { margin-top: 6px; font-size: .93em; }
.ccomp-cat__desc p { margin: 0; }
.ccomp-always { font-size: .85em; font-weight: 600; opacity: .8; white-space: nowrap; }
.ccomp-cat__details { margin-top: 8px; font-size: .9em; }
.ccomp-cat__details summary { cursor: pointer; color: var(--ccomp-link); font-weight: 600; }

.ccomp-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: 0 0 auto; cursor: pointer; }
.ccomp-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.ccomp-switch__track {
	position: absolute; inset: 0;
	background: #8b8f97;
	border-radius: 28px;
	transition: background .2s;
}
.ccomp-switch__track::after {
	content: "";
	position: absolute;
	top: 3px; left: 3px;
	width: 22px; height: 22px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s;
}
.ccomp-switch input:checked + .ccomp-switch__track { background: var(--ccomp-btn-bg); }
.ccomp-switch input:checked + .ccomp-switch__track::after { transform: translateX(20px); }

.ccomp-consent-meta, .ccomp-gpc-notice { font-size: .85em; opacity: .85; word-break: break-all; }

/* ---------- Tables (preference centre and policy) ---------- */
.ccomp-table-wrap { overflow-x: auto; margin: 8px 0 16px; }
.ccomp-table { width: 100%; border-collapse: collapse; font-size: .9em; }
.ccomp-table th,
.ccomp-table td {
	text-align: left;
	vertical-align: top;
	padding: 6px 8px;
	border-bottom: 1px solid var(--ccomp-border);
}
.ccomp-table code { font-size: .95em; word-break: break-all; background: none; padding: 0; }
.ccomp-muted { opacity: .75; font-size: .9em; }

/* ---------- Revisit button ---------- */
.ccomp-revisit {
	position: fixed;
	bottom: 16px;
	z-index: 2147483600;
	width: 48px; height: 48px;
	border-radius: 50%;
	border: 0;
	background: var(--ccomp-btn-bg);
	color: var(--ccomp-btn-text);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.ccomp-revisit--left { left: 16px; }
.ccomp-revisit--right { right: 16px; }

/* ---------- Blocked embeds ---------- */
iframe[data-ccomp-blocked] { display: none !important; }
.ccomp-embed {
	position: relative;
	width: 100%;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
	color: #1f2937;
	border: 1px solid var(--ccomp-border);
	border-radius: var(--ccomp-radius);
	text-align: center;
	font-size: 15px;
	line-height: 1.5;
}
.wp-block-embed__wrapper > .ccomp-embed,
.fluid-width-video-wrapper > .ccomp-embed,
.elementor-video-wrapper > .ccomp-embed,
.responsive-embed > .ccomp-embed,
.embed-responsive > .ccomp-embed { position: absolute; inset: 0; min-height: 0; }
.ccomp-embed__inner { padding: 20px; max-width: 520px; }
.ccomp-embed__service { font-weight: 700; margin: 0 0 6px; }
.ccomp-embed__text { margin: 0 0 12px; }
.ccomp-embed__actions { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 782px) {
	.ccomp-layout-bar .ccomp-banner__inner,
	.ccomp-layout-bar-top .ccomp-banner__inner { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
	.ccomp-layout-box-left .ccomp-banner,
	.ccomp-layout-box-right .ccomp-banner { left: 16px; right: 16px; bottom: 16px; width: auto; }
	.ccomp-actions .ccomp-btn { flex: 1 1 100%; }
	.ccomp-prefs { padding: 0; align-items: flex-end; }
	.ccomp-prefs__panel { max-height: 92vh; border-radius: var(--ccomp-radius) var(--ccomp-radius) 0 0; }
	.ccomp-table thead { display: none; }
	.ccomp-table tr { display: block; border-bottom: 1px solid var(--ccomp-border); padding: 6px 0; }
	.ccomp-table td { display: block; border: 0; padding: 2px 0; }
	.ccomp-table td::before { content: attr(data-label) ": "; font-weight: 600; }
}

@media (prefers-reduced-motion: reduce) {
	.ccomp-btn, .ccomp-switch__track, .ccomp-switch__track::after { transition: none; }
}

@media print {
	#ccomp-root { display: none !important; }
}
