.cg-root {
	--cg-accent: #0c7ee9;
	--cg-bg: #fff;
	--cg-fg: #1a1a1a;
	--cg-muted: #323232;
	--cg-border: #e1e3e8;

	position: fixed;
	inset: 0;
	display: flex;
	pointer-events: none; /* let clicks through to the page; banner re-enables them */

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: var(--cg-fg);
	z-index: 999999;
}
.cg-root[hidden] { display: none; } /* hidden attribute beats display:flex without this */
/* Keep the consent banner bar hidden whenever the preferences modal is open
   (cg-prefs-open), and when the modal was opened standalone via the
   [consentinel_preferences] shortcode / floating button (cg-modal-only). The
   modal is a full-screen position:fixed overlay with its own scrim and actions,
   so the banner behind it is redundant — and a full-width bar would otherwise
   show through the scrim and look like it reappeared. */
.cg-root.cg-modal-only .cg-banner,
.cg-root.cg-prefs-open .cg-banner { display: none; }

.cg-banner {
	position: relative; /* anchor for the close button */
	pointer-events: auto;
	background: var(--cg-bg);
	padding: 16px 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

/* Close-and-accept "×" (banner only, not the modal). Clicking it records
   "Accept all" and hides the banner (data-cg-action="accept"). */
.cg-banner__close {
	position: absolute;
	top: 4px;
	right: 8px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px!important;
	height: 26px;
	padding: 0!important;
	background: none;
	border: 0;
	font-size: 22px!important;
	line-height: 1;
	cursor: pointer;
	color: var(--cg-fg); /* follows the Text color (subtle via opacity) */
	opacity: 0.7;
	transition: opacity 0.15s ease;
}
.cg-banner__close:hover,
.cg-banner__close:focus-visible { opacity: 1; }

/* Reset */
.cg-banner, .cg-banner p, .cg-banner a {letter-spacing:0}
.cg-banner a {text-transform: capitalize}

/* Vertical placement (applies to both layouts) */
.cg-root[data-position="top"]    { align-items: flex-start; }
.cg-root[data-position="bottom"] { align-items: flex-end; }

/* --- Bar layout: full-width strip --- */
.cg-root[data-layout="bar"] .cg-banner {
	width: 100%;
	border-top: 1px solid var(--cg-border);
	box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
	margin:0 20px 20px;
	border-radius: 12px;
}
.cg-root[data-layout="bar"][data-position="top"] .cg-banner {
	border-top: 0;
	border-bottom: 1px solid var(--cg-border);
	box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* --- Box layout: floating card, aligned via justify-content --- */
.cg-root[data-layout="box"] {
	padding: 16px;
}
.cg-root[data-layout="box"] .cg-banner {
	max-width: 420px;
	border: 1px solid var(--cg-border);
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.cg-root[data-layout="box"][data-box-align="left"]   { justify-content: flex-start; }
.cg-root[data-layout="box"][data-box-align="center"] { justify-content: center; }
.cg-root[data-layout="box"][data-box-align="right"]  { justify-content: flex-end; }

.cg-body { flex: 1 1 320px; }
/* Title is a <span> (not a heading) so theme/Elementor h2 rules can't
   inflate it; display:block keeps it stacked above the message. */
.cg-title { display: block; margin: 0 0 6px; font-size: 1.3em; font-weight: 600; color: var(--cg-title, var(--cg-fg)); }
.cg-message { margin: 0; color: var(--cg-fg); }

/* Heading icons (banner cookie, modal shield). CSS mask so the single-color SVG
   is recolored via background-color — it inherits the contrast-aware theme var
   (--cg-bg-fg, the auto-contrast of the banner/modal background) and stays
   legible on any background instead of rendering as fixed black. */
.cg-heading-icon {
	display: inline-block;
	flex: 0 0 auto;
	background-color: var(--cg-bg-fg, var(--cg-fg));
	-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
	-webkit-mask-position: center; mask-position: center;
	-webkit-mask-size: contain; mask-size: contain;
}
.cg-heading-icon--cookie {
	width: 20px; height: 20px;
	-webkit-mask-image: url(../img/cookie.svg); mask-image: url(../img/cookie.svg);
}
.cg-heading-icon--shield {
	width: 22px; height: 24px;
	-webkit-mask-image: url(../img/consentinel-icon-black.svg); mask-image: url(../img/consentinel-icon-black.svg);
}
/* Banner: cookie + title on one row; the row owns the title's bottom margin. */
.cg-title-row { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.cg-title-row .cg-title { margin: 0; }
/* Modal: shield + title grouped at the left of the header; close button stays right. */
.cg-prefs__heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cg-links { margin: 8px 0 0; }
/* Policy links auto-contrast against the banner background (so they stay
   legible on any background); underlined to remain identifiable as links. */
.cg-links a { color: var(--cg-bg-fg, var(--cg-accent)); display: inline-block; border-bottom: 1px dotted }
.cg-links__sep { color: var(--cg-fg); margin: 0 2px; }
button.cg-link { text-decoration: none}

.cg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* BUTTON RESET - Elementor Reset */
button, button:hover {
	border: inherit;
}


.cg-btn, button.cg-btn {
	border: 1px solid var(--cg-border);
	background: #fff;
	color: var(--cg-fg);
	padding: 4px 14px !important;
	border-radius: 8px;
	font: inherit;
	cursor: pointer;
	font-size:1.1em !important;
	line-height:1.2em !important;
}
.cg-btn:hover { border-color: var(--cg-accent); }
.cg-btn--primary {
	background: var(--cg-accent);
	color: var(--cg-accent-fg, #fff); /* auto-contrast so the label stays legible on a light accent */
	border-color: var(--cg-accent);
}
.cg-btn--ghost { background: transparent; }
.cg-link {
	background: none;
	border: 0;
	color: var(--cg-accent);
	cursor: pointer;
	text-decoration: underline;
	font: inherit;
	padding: 0;
}

/* Preferences modal */
.cg-prefs {
	position: fixed;
	inset: 0;
	background: rgba(15,20,28,0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 1000000;
	pointer-events: auto; /* re-enable: parent .cg-root sets pointer-events:none */
}
.cg-prefs__inner {
	background: var(--cg-bg);
	border-radius: 12px;
	max-width: 560px;
	width: 100%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden; /* clip the full-bleed brand strip to the rounded corners */
}

/* "Powered by Consentinel" branding strip (banner + preferences modal). */
.cg-brandbar {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 8px 20px;
	background: #eef4fb;
	border-radius: 8px 8px 0 0;
}
.cg-brandbar__link { display: inline-flex; align-items: center; opacity: 0.85; transition: opacity 0.15s ease; }
.cg-brandbar__link:hover,
.cg-brandbar__link:focus { opacity: 1; }
.cg-brandbar__logo { height: 18px; width: auto; display: block; border-radius:0!important}
/* Banner: full-bleed across the banner's own padding (16px 20px). */
.cg-banner .cg-brandbar { flex: 0 0 100%; margin: 0 0 -16px; }
.cg-root[data-layout="box"] .cg-banner { overflow: hidden; }
.cg-prefs__head, .cg-prefs__foot {
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--cg-border);
}
.cg-prefs__foot {
	border-top: 1px solid var(--cg-border);
	border-bottom: 0;
	gap: 8px;
	justify-content: flex-end;
}
.cg-prefs__title { display: block; margin: 0; font-size: clamp(1.8em, 1.7vw, 26px); text-transform: capitalize; font-weight:500; }
.cg-iconbtn, button.cg-iconbtn {
	background: none; border: 0; font-size: 2em !important;
	line-height: 1em; cursor: pointer; color: var(--cg-bg-fg, var(--cg-muted));
	border-radius: 999px;
	padding: 0 !important;
	width: 35px;
	height: 35px;
	align-self: start;
	border: inherit;
}
.cg-prefs__body { padding: 8px 20px 20px; overflow: auto; }

.cg-category {
	display: flex; align-items: flex-start; justify-content: space-between;
	gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--cg-border);
}
.cg-category:last-of-type { border-bottom: 0; }
.cg-category__label { flex: 1; }
/* Auto-contrast against the banner/modal background so the muted description
   stays legible on a dark background (falls back to --cg-muted). */
.cg-category__desc { display: block; color: var(--cg-bg-fg, var(--cg-muted)); opacity: 0.75; font-size: 13px; margin-top: 2px; }

.cg-switch { position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.cg-switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cg-switch__slider {
	position: absolute; inset: 0;
	background: #c8ccd2;
	border-radius: 999px;
	transition: background 120ms ease;
	pointer-events: none;
}
.cg-switch__slider::before {
	content: '';
	position: absolute;
	top: 2px; left: 2px;
	width: 18px; height: 18px;
	/* Knob sits on the accent-colored "on" track, so it takes the accent's
	   contrast color — stays visible even when the accent is light/white.
	   Defaults to #fff (unchanged) for the default dark accent. */
	background: var(--cg-accent-fg, #fff);
	border-radius: 50%;
	transition: transform 120ms ease;
}
.cg-switch input:checked ~ .cg-switch__slider { background: var(--cg-accent); }
.cg-switch input:checked ~ .cg-switch__slider::before { transform: translateX(18px); }
.cg-switch input:disabled ~ .cg-switch__slider { opacity: 0.6; }

.cg-detected { margin-top: 16px; }
.cg-detected__group { margin-top: 12px; letter-spacing: 0;}
/* Group heading is a <span> (not <h4>) so theme/Elementor heading rules can't
   recolor/resize it; display:block keeps it above its tracker list. */
.cg-detected__title { display: block; margin: 0 0 4px; font-size: 13px; text-transform: uppercase; color: var(--cg-bg-fg, var(--cg-muted)); opacity: 0.75; }
.cg-detected__group ul { margin: 0; padding-left: 0; list-style-type: none; }
.cg-detected__group li { margin-bottom: 6px; font-size: 13px; }
.cg-detected__data { color: var(--cg-bg-fg, var(--cg-muted)); opacity: 0.75; }

@media (max-width: 600px) {
	.cg-banner { flex-direction: column; align-items: stretch; }
	.cg-actions { justify-content: stretch; }
	.cg-btn { flex: 1; }
	.cg-body { flex: 1 1 auto}
	.cg-title{font-size:1.4em}
}

/* Floating launcher — reopens the preferences modal ([consentinel_preferences]'s
   `reopen` action). Rendered outside #consentinel-root and carries the banner's
   CSS vars inline, so its accent/contrast colors track the theme. The cookie
   glyph is a CSS mask filled with --cg-accent-fg (auto-contrast of the accent),
   so it stays legible on any accent color. Hidden while the banner or modal is
   open (html.cg-open, toggled by show() in banner.js). */
.cg-fab, button.cg-fab {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 999998; /* below the root (999999) and modal (1000000); it's hidden while they're open anyway */
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%!important;
	background: var(--cg-accent);
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cg-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.30); }
.cg-fab:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: 3px; }
.cg-fab__icon {
	width: 26px;
	height: 26px;
	background-color: var(--cg-accent-fg, #fff);
	-webkit-mask: url(../img/cookie.svg) no-repeat center / contain;
	        mask: url(../img/cookie.svg) no-repeat center / contain;
}
.cg-open .cg-fab { display: none; } /* banner or modal open → hide the launcher */

@media (max-width: 600px) {
	.cg-fab, button.cg-fab { width: 46px; height: 46px; left: 14px; bottom: 14px; }
	.cg-fab__icon { width: 23px; height: 23px; }
}
