.ccm-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	background: var( --ccm-bg, #1e1e1e );
	color: var( --ccm-text, #ffffff );
	box-shadow: 0 -2px 12px rgba( 0, 0, 0, 0.25 );
	font-size: 14px;
	line-height: 1.5;
}

.ccm-banner[hidden] {
	display: none;
}

/* "Card" layout: a compact box in the bottom-left corner instead of a
   full-width bar. Colors still come from the same --ccm-bg/--ccm-text/
   --ccm-accent variables as the bar - only the shape/position differs. */
.ccm-banner--card {
	left: 24px;
	right: auto;
	bottom: 24px;
	width: calc( 100% - 48px );
	max-width: 420px;
	align-items: flex-start;
	border-radius: 8px;
	box-shadow: 0 8px 30px rgba( 0, 0, 0, 0.2 );
}

.ccm-banner--card .ccm-banner__content,
.ccm-banner--card .ccm-banner__actions {
	flex: 1 1 100%;
}

.ccm-banner--card .ccm-banner__actions {
	gap: 12px 24px;
}

.ccm-banner--card .ccm-btn--text[data-ccm-action="open-preferences"] {
	order: 1;
}

.ccm-banner--card .ccm-btn--text[data-ccm-action="reject-all"] {
	order: 2;
}

/* id-scoped (#ccm-banner.ccm-banner--card, not just .ccm-banner--card): this
   overrides border/padding/font-size/color/etc. set by the now id-scoped
   base button rules further down (and by the button-collision blanket reset
   above them). Before those were id-scoped, a plain two-class selector like
   this correctly won against a plain one-class base rule; afterwards, an id
   selector would have started beating it - see the button-collision-
   hardening comment further down for the general version of this trap. */
#ccm-banner.ccm-banner--card .ccm-btn--text {
	border: none;
	padding: 0;
	text-transform: uppercase;
	font-weight: 600;
	font-size: 12px;
	letter-spacing: 0.03em;
	color: var( --ccm-accent, #2271b1 );
}

#ccm-banner.ccm-banner--card .ccm-btn--primary {
	order: 3;
	flex-basis: 100%;
	width: 100%;
	text-align: center;
	padding: 12px 20px;
}

.ccm-banner__content {
	flex: 1 1 320px;
}

.ccm-banner__heading {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: bold;
	color: inherit;
}

.ccm-banner__message {
	margin: 0;
	color: inherit;
	opacity: 0.9;
}

.ccm-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* --- Button-collision hardening -----------------------------------------
   Themes (Elementor's global Kit CSS is the most common culprit) often ship
   a generic reset like:
     .elementor-kit-27 button, .elementor-kit-27 input[type="button"],
     .elementor-kit-27 .elementor-button { background-color: ...; font-size:
     ...; border-style: solid; border-radius: ...; padding: ...; }
   That selector's specificity is (0,1,1) - one class plus the "button"
   element - which beats a plain class selector like .ccm-btn at (0,1,0),
   even though the theme rule is "just a reset" and loads before ours. Every
   real <button> this plugin renders is therefore scoped under its
   container's id below (id selectors are specificity (1,0,0) - they
   unconditionally outrank any selector built only from classes/elements/
   attributes, regardless of stylesheet load order).

   Part 2, immediately below: a blanket reset declaring every property a
   generic theme reset commonly touches, for every real <button> in the
   plugin - not just the properties our own .ccm-btn classes happen to set.
   Without this, a property our rules never explicitly declared (e.g.
   font-weight, which nothing below sets) could still leak through even
   after id-scoping, since CSS only overrides a property a rule actually
   declares - there'd be no competing declaration to beat.

   IMPORTANT - ordering: for #ccm-reopen-button, #ccm-embed-placeholder-btn
   and #ccm-shortcode-button (real buttons with no separate wrapper id to
   scope under), both this reset and their specific-look rule further down
   in this file are a single, unscoped id selector - identical specificity -
   so the later one in this file wins. This block must stay above those
   three rules; don't reorder. */
#ccm-banner button,
#ccm-preferences-modal button,
#ccm-privacy-request button,
#ccm-reopen-button,
#ccm-embed-placeholder-btn,
#ccm-shortcode-button {
	font-family: inherit;
	font-size: inherit;
	font-weight: normal;
	line-height: inherit;
	text-transform: none;
	letter-spacing: normal;
	background-color: transparent;
	color: inherit;
	border-style: none;
	border-width: 0;
	border-radius: 0;
	padding: 0;
}

#ccm-banner .ccm-btn,
#ccm-preferences-modal .ccm-btn,
#ccm-privacy-request .ccm-btn,
#ccm-shortcode-button {
	border: 1px solid transparent;
	border-radius: 4px;
	padding: 10px 18px;
	font-size: 14px;
	cursor: pointer;
	background: transparent;
	color: inherit;
}

#ccm-banner .ccm-btn--primary,
#ccm-preferences-modal .ccm-btn--primary,
#ccm-privacy-request .ccm-btn--primary,
#ccm-shortcode-button {
	background: var( --ccm-accent, #2271b1 );
	border-color: var( --ccm-accent, #2271b1 );
	color: #fff;
}

#ccm-banner .ccm-btn--text,
#ccm-preferences-modal .ccm-btn--text {
	border-color: currentColor;
}

.ccm-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ccm-modal[hidden] {
	display: none;
}

.ccm-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
}

.ccm-modal__panel {
	position: relative;
	max-width: 640px;
	width: calc( 100% - 40px );
	max-height: calc( 100vh - 80px );
	overflow-y: auto;
	background: #fff;
	color: #1e1e1e;
	border-radius: 6px;
	padding: 24px;
}

.ccm-modal__title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: bold;
	line-height: 1.3;
	color: inherit;
}

.ccm-category {
	border-top: 1px solid #e2e2e2;
	padding: 14px 0;
}

.ccm-category:first-of-type {
	border-top: none;
}

.ccm-category__header label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ccm-category__cookies {
	margin: 10px 0 0;
	padding-left: 20px;
	font-size: 13px;
}

.ccm-category__purpose {
	color: #555;
}

.ccm-category__expiry {
	color: #777;
}

.ccm-category__empty {
	margin: 8px 0 0;
	font-size: 13px;
	color: #777;
}

.ccm-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

/* id-selector instead of .ccm-reopen-button: the id is already on this exact
   element (see class-ccm-banner-renderer.php), so this is the simplest form
   of the button-collision fix - no wrapper needed since the id IS the button. */
#ccm-reopen-button {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999998;
	border: none;
	border-radius: 999px;
	padding: 10px 16px;
	background: var( --ccm-accent, #2271b1 );
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.25 );
}

#ccm-reopen-button[hidden] {
	display: none;
}

/* Category toggles: the checkbox is restyled into an on/off switch purely
   in CSS (no markup change), so keyboard/label behaviour is unchanged. */
.ccm-category__header input[type="checkbox"][data-ccm-category-toggle] {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: 0 0 auto;
	width: 40px;
	height: 22px;
	margin: 0;
	border-radius: 999px;
	background: #c3c7ce;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ccm-category__header input[type="checkbox"][data-ccm-category-toggle]::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.3 );
	transition: transform 0.15s ease;
}

.ccm-category__header input[type="checkbox"][data-ccm-category-toggle]:checked {
	background: var( --ccm-accent, #2271b1 );
}

.ccm-category__header input[type="checkbox"][data-ccm-category-toggle]:checked::before {
	transform: translateX( 18px );
}

.ccm-category__header input[type="checkbox"][data-ccm-category-toggle]:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.ccm-category__header input[type="checkbox"][data-ccm-category-toggle]:focus-visible {
	outline: 2px solid var( --ccm-accent, #2271b1 );
	outline-offset: 2px;
}

/* Pre-consent embed placeholder (shown in place of a blocked third-party
   iframe until the visitor consents or clicks to load it). */
.ccm-embed-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	margin: 1em 0;
	padding: 24px;
	background: #f2f3f5;
	border: 1px dashed #c3c7ce;
	border-radius: 8px;
	text-align: center;
	color: #1e1e1e;
}

.ccm-embed-placeholder__inner {
	max-width: 440px;
}

.ccm-embed-placeholder__text {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.5;
}

/* id-selector instead of .ccm-embed-placeholder__btn (see the
   button-collision-hardening comment near the .ccm-btn rules): this button
   can repeat once per blocked embed on a page, so there's no unique wrapper
   to scope under - see the id="ccm-embed-placeholder-btn" comment in
   class-ccm-embed-blocker.php for why a repeated, non-unique id is safe here. */
#ccm-embed-placeholder-btn {
	border: none;
	border-radius: 4px;
	padding: 9px 18px;
	background: var( --ccm-accent, #2271b1 );
	color: #fff;
	font-size: 14px;
	cursor: pointer;
}
