/*
 * Cookie Consent MD — public banner styles.
 *
 * Mobile-first, self-contained (no external fonts or images). Colors come
 * from CSS custom properties set by the JS on #cc-banner-root:
 *   --cc-bg, --cc-text, --cc-accent, --cc-btn-text
 * Every rule provides a neutral fallback so the banner is usable unstyled.
 *
 * All selectors are prefixed with #cc-banner-root and interactive elements
 * carry explicit resets (some with !important): the banner is injected into
 * arbitrary themes whose generic `button`/`a` rules (borders, outlines,
 * radii, gradients) must never restyle it.
 */

/* ------------------------------------------------------------------ *
 * Base
 * ------------------------------------------------------------------ */

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

#cc-banner-root {
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* The hidden attribute must always win over display rules. */
#cc-banner-root [hidden] {
	display: none !important;
}

/* Neutralize theme styling of form controls inside the banner. */
#cc-banner-root button {
	-webkit-appearance: none !important;
	appearance: none !important;
	margin: 0;
	font-family: inherit;
	text-transform: none !important;
	letter-spacing: normal;
	background-image: none !important;
}

/* Visible focus indication on every interactive element. */
#cc-banner-root a:focus,
#cc-banner-root button:focus {
	outline: 2px solid var(--cc-accent, #1d4ed8) !important;
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Layer 1 — notice
 * ------------------------------------------------------------------ */

#cc-banner-root .cc-notice {
	position: fixed;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	z-index: 99999;
	max-width: 100%;
	padding: 1.25rem;
	border-radius: 0.5rem;
	background: var(--cc-bg, #ffffff);
	color: var(--cc-text, #1f2933);
	box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.25);
}

#cc-banner-root .cc-notice__title {
	margin: 0 0 0.5rem;
	padding: 0;
	font-size: 1.125rem;
	font-weight: 700;
	color: inherit;
}

#cc-banner-root .cc-notice__message {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
}

#cc-banner-root .cc-notice__message p {
	margin: 0 0 0.5rem;
}

#cc-banner-root .cc-notice__links {
	margin: 0 0 1rem;
	font-size: 0.875rem;
}

#cc-banner-root .cc-link {
	color: var(--cc-accent, #1d4ed8);
	text-decoration: underline;
	border: 0;
	margin-right: 1rem;
}

#cc-banner-root .cc-link:last-child {
	margin-right: 0;
}

#cc-banner-root .cc-notice__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* ------------------------------------------------------------------ *
 * Buttons — Accept All and Reject All share the exact same style
 * (legal requirement: refusing must be as easy and visible as accepting).
 * ------------------------------------------------------------------ */

#cc-banner-root .cc-btn {
	display: inline-block;
	padding: 0.625rem 1.125rem;
	border: 1px solid transparent !important;
	border-radius: 0.375rem !important;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	box-shadow: none !important;
	transition: filter 0.15s ease;
}

#cc-banner-root .cc-btn:hover {
	filter: brightness(1.1);
}

#cc-banner-root .cc-btn--primary,
#cc-banner-root .cc-btn--save {
	background: var(--cc-accent, #1d4ed8) !important;
	color: var(--cc-btn-text, #ffffff) !important;
}

#cc-banner-root .cc-btn--secondary {
	background: transparent !important;
	color: var(--cc-accent, #1d4ed8) !important;
	border-color: var(--cc-accent, #1d4ed8) !important;
}

/* ------------------------------------------------------------------ *
 * Notice position variants (desktop)
 * ------------------------------------------------------------------ */

@media (min-width: 600px) {
	#cc-banner-root .cc-notice {
		max-width: 26rem;
		right: auto;
	}

	#cc-banner-root[data-position*="right"] .cc-notice {
		left: auto;
		right: 1rem;
	}

	#cc-banner-root[data-position$="center"] .cc-notice {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		max-width: 34rem;
		width: calc(100% - 2rem);
	}
}

/* ------------------------------------------------------------------ *
 * Notice type variant: bar — a full-width strip pinned to the bottom
 * edge. Placed after the position variants so it overrides their
 * horizontal placement at equal specificity; vertical position stays
 * "bottom" regardless of the position setting.
 * ------------------------------------------------------------------ */

#cc-banner-root[data-type="bar"] .cc-notice {
	left: 0;
	right: 0;
	bottom: 0;
	max-width: none;
	width: auto;
	transform: none;
	border-radius: 0;
	box-shadow: 0 -0.25rem 1.5rem rgba(0, 0, 0, 0.25);
}

/* Bar layout on wide screens: title on top, message + links growing left,
 * action buttons pinned to the right, everything vertically centred. */
@media (min-width: 900px) {
	#cc-banner-root[data-type="bar"] .cc-notice {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		column-gap: 1.5rem;
		padding: 1rem 1.5rem;
	}

	#cc-banner-root[data-type="bar"] .cc-notice__title {
		flex: 1 1 100%;
		margin-bottom: 0.375rem;
	}

	#cc-banner-root[data-type="bar"] .cc-notice__message {
		flex: 1 1 20rem;
		margin: 0;
	}

	#cc-banner-root[data-type="bar"] .cc-notice__links {
		margin: 0;
		white-space: nowrap;
	}

	#cc-banner-root[data-type="bar"] .cc-notice__actions {
		margin-left: auto;
		flex-wrap: nowrap;
	}
}

/* ------------------------------------------------------------------ *
 * Layer 2 — preference centre modal
 * ------------------------------------------------------------------ */

#cc-banner-root .cc-modal-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.55);
}

#cc-banner-root .cc-modal {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 40rem;
	max-height: 85vh;
	border-radius: 0.5rem;
	background: var(--cc-bg, #ffffff);
	color: var(--cc-text, #1f2933);
	box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

#cc-banner-root .cc-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

#cc-banner-root .cc-modal__title {
	margin: 0;
	padding: 0;
	font-size: 1.125rem;
	font-weight: 700;
	color: inherit;
}

#cc-banner-root .cc-modal__close {
	flex: none;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0 !important;
	border-radius: 0.375rem !important;
	background: transparent !important;
	color: inherit !important;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
}

#cc-banner-root .cc-modal__close:hover {
	background: rgba(128, 128, 128, 0.15) !important;
}

/* Inner scroll: the modal itself never exceeds the viewport. */
#cc-banner-root .cc-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 1rem 1.25rem;
}

#cc-banner-root .cc-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-top: 1px solid rgba(128, 128, 128, 0.25);
}

/* ------------------------------------------------------------------ *
 * Category blocks
 * ------------------------------------------------------------------ */

#cc-banner-root .cc-category {
	padding: 0.875rem 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

#cc-banner-root .cc-category:last-child {
	border-bottom: none;
}

#cc-banner-root .cc-category__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

#cc-banner-root .cc-category__name {
	margin: 0;
	padding: 0;
	font-size: 1rem;
	font-weight: 600;
	color: inherit;
}

#cc-banner-root .cc-category__always {
	flex: none;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--cc-accent, #1d4ed8);
}

#cc-banner-root .cc-category__desc {
	margin: 0.375rem 0 0;
	font-size: 0.875rem;
	opacity: 0.85;
}

/* ------------------------------------------------------------------ *
 * Operator identity block (art. 13) below the categories
 * ------------------------------------------------------------------ */

#cc-banner-root .cc-modal__operator {
	margin-top: 0.875rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(128, 128, 128, 0.25);
	font-size: 0.8125rem;
	opacity: 0.75;
}

#cc-banner-root .cc-operator__line {
	margin: 0 0 0.25rem;
}

#cc-banner-root .cc-operator__line:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Toggle switch (button[role="switch"])
 * ------------------------------------------------------------------ */

/*
 * iOS/Material-style pill: 44x24 track, 18px thumb with a 3px inset,
 * thumb vertically self-centered (top 50% + translateY) so the geometry
 * survives even if a theme inflates the button box (e.g. min-height
 * tap-target rules — that is what turned the pill into a circle).
 * Fixed px sizes: rem would scale with html font-size tricks
 * (62.5% themes) and distort the control.
 */
#cc-banner-root .cc-switch {
	position: relative;
	flex: none;
	display: inline-block;
	width: 44px !important;
	height: 24px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: #9aa5b1 !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color 0.2s ease;
}

#cc-banner-root .cc-switch__thumb {
	position: absolute;
	top: 50%;
	left: 3px;
	width: 18px !important;
	height: 18px !important;
	border-radius: 50% !important;
	background: #ffffff !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transform: translateY(-50%);
	transition: transform 0.2s ease;
}

#cc-banner-root .cc-switch[aria-checked="true"] {
	background: var(--cc-accent, #1d4ed8) !important;
}

#cc-banner-root .cc-switch[aria-checked="true"] .cc-switch__thumb {
	transform: translate(20px, -50%);
}

/* ------------------------------------------------------------------ *
 * Expandable cookie table
 * ------------------------------------------------------------------ */

#cc-banner-root .cc-category__expand {
	margin-top: 0.5rem;
	padding: 0.25rem 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--cc-accent, #1d4ed8) !important;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
	box-shadow: none !important;
}

#cc-banner-root .cc-category__expand[aria-expanded="true"] {
	text-decoration: none;
}

#cc-banner-root .cc-category__panel {
	margin-top: 0.5rem;
}

/* Wide tables scroll horizontally inside their own wrapper. */
#cc-banner-root .cc-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

#cc-banner-root .cc-cookie-table {
	width: 100%;
	min-width: 30rem;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: 0.8125rem;
}

#cc-banner-root .cc-cookie-table th,
#cc-banner-root .cc-cookie-table td {
	padding: 0.375rem 0.5rem;
	border: 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.2);
	background: transparent;
	text-align: left;
	vertical-align: top;
}

#cc-banner-root .cc-cookie-table th {
	font-weight: 600;
}

/* ------------------------------------------------------------------ *
 * Reduced motion
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	#cc-banner-root *,
	#cc-banner-root *::before,
	#cc-banner-root *::after {
		transition: none !important;
		animation: none !important;
	}
}
