/**
 * Cookie Consent Manager – Front-end Banner Styles
 *
 * BEM methodology, ccm- prefix throughout.
 * Lightweight. No external dependencies.
 * Colours and typography are supplemented at runtime via ccmConfig in consent-banner.js.
 *
 * CSS Custom Properties (set by JavaScript):
 *   --ccm-bg-colour
 *   --ccm-text-colour
 *   --ccm-button-colour
 *   --ccm-button-text-colour
 *   --ccm-font-family
 *   --ccm-heading-size
 *   --ccm-heading-colour
 *   --ccm-body-size
 *   --ccm-body-colour
 *   --ccm-link-colour
 */

/* ---------------------------------------------------------------------------
   Banner
--------------------------------------------------------------------------- */

.ccm-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	background: var( --ccm-bg-colour, #ffffff );
	border-top: 1px solid #dddddd;
	box-shadow: 0 -2px 8px rgba( 0, 0, 0, 0.08 );
	padding: 16px 24px;
	color: var( --ccm-text-colour, #333333 );
	font-family: var( --ccm-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif ) !important;
}

.ccm-banner--hidden {
	display: none;
}

.ccm-banner__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.ccm-banner__heading {
	margin: 0 0 4px;
	font-size: var( --ccm-heading-size, 24px );
	font-weight: 600;
	color: var( --ccm-heading-colour, #000000 );
	font-family: var( --ccm-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif ) !important;
}

.ccm-banner__body {
	margin: 0;
	font-size: var( --ccm-body-size, 14px );
	line-height: 1.5;
	color: var( --ccm-body-colour, #333333 );
	font-family: inherit !important;
}

.ccm-banner__content {
	flex: 1;
	min-width: 200px;
}

.ccm-banner__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
	flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */

.ccm-btn {
	display: inline-block;
	padding: 8px 18px;
	border-radius: 4px;
	font-size: 0.9em;
	cursor: pointer;
	border: 2px solid transparent;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	transition: opacity 0.15s ease;
	font-family: inherit !important;
}

.ccm-btn:hover {
	opacity: 0.88;
}

.ccm-btn--primary {
	background-color: #0073aa;
	color: #ffffff;
	border-color: #0073aa;
}

.ccm-btn--secondary {
	background-color: transparent;
	color: #0073aa;
	border-color: #0073aa;
}

.ccm-btn--tertiary {
	background-color: transparent;
	color: #555555;
	border-color: transparent;
	text-decoration: underline;
	font-weight: 400;
}

/* ---------------------------------------------------------------------------
   Overlay
--------------------------------------------------------------------------- */

.ccm-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba( 0, 0, 0, 0.5 );
	z-index: 99998;
}

.ccm-overlay--hidden {
	display: none;
}

/* ---------------------------------------------------------------------------
   Preference centre
--------------------------------------------------------------------------- */

.ccm-preference-centre {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	z-index: 100000;
	background: #ffffff;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba( 0, 0, 0, 0.2 );
	width: 90%;
	max-width: 560px;
	max-height: 80vh;
	overflow-y: auto;
	padding: 24px;
	font-family: var( --ccm-font-family, inherit ) !important;
}

.ccm-preference-centre--hidden {
	display: none;
}

.ccm-preference-centre__heading {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 1.1em;
	font-family: inherit !important;
}

.ccm-preference-centre__actions {
	display: flex;
	gap: 8px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #eeeeee;
}

/* ---------------------------------------------------------------------------
   Category list
--------------------------------------------------------------------------- */

.ccm-category-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ccm-category {
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 12px 14px;
}

.ccm-category__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 4px;
}

.ccm-category__label {
	font-weight: 600;
	font-size: 0.95em;
}

.ccm-category__description {
	margin: 0;
	font-size: 0.85em;
	color: #666666;
	line-height: 1.5;
}

.ccm-category__badge {
	font-size: 0.75em;
	padding: 2px 8px;
	border-radius: 10px;
	background: #e5e5e5;
	color: #555555;
}

/* ---------------------------------------------------------------------------
   Toggle switch
--------------------------------------------------------------------------- */

.ccm-toggle {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	cursor: pointer;
}

.ccm-toggle__input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.ccm-toggle__slider {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cccccc;
	border-radius: 24px;
	transition: background-color 0.2s ease;
}

.ccm-toggle__slider::before {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #ffffff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}

.ccm-toggle__input:checked + .ccm-toggle__slider {
	background-color: #0073aa;
}

.ccm-toggle__input:checked + .ccm-toggle__slider::before {
	transform: translateX( 20px );
}

.ccm-toggle__input:focus + .ccm-toggle__slider {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Policy links in banner and preference centre
--------------------------------------------------------------------------- */

.ccm-banner__links {
	display: inline;
	margin-left: 6px;
	font-size: 0.88em;
}

.ccm-banner__link {
	color: inherit;
	text-decoration: underline;
	opacity: 0.8;
}

.ccm-banner__link:hover {
	opacity: 1;
}

.ccm-banner__link-sep {
	margin: 0 4px;
	opacity: 0.5;
}

.ccm-preference-centre__links {
	margin: 16px 0 0;
	font-size: 0.85em;
	color: #666666;
}

/* ---------------------------------------------------------------------------
   Responsive adjustments
--------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Floating preference button
--------------------------------------------------------------------------- */

.ccm-floating-button {
	position: fixed;
	bottom: 16px;
	z-index: 99997;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #0073aa;
	color: #ffffff;
	border: none;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.12 );
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
}

.ccm-floating-button:hover {
	transform: scale( 1.08 );
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.18 );
	filter: brightness( 1.15 );
}

.ccm-floating-button svg {
	width: 18px;
	height: 18px;
}

/* Position variants */
.ccm-floating-button--right {
	right: 16px;
}

.ccm-floating-button--left {
	left: 16px;
}

/* ---------------------------------------------------------------------------
   Responsive adjustments
--------------------------------------------------------------------------- */

@media ( max-width: 600px ) {
	.ccm-banner__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.ccm-banner__actions {
		width: 100%;
	}

	.ccm-btn {
		flex: 1;
		text-align: center;
	}

	.ccm-floating-button--right {
		right: 16px;
	}

	.ccm-floating-button--left {
		left: 16px;
	}
}
