/*
 * Consent & Tag Guardian - structural CSS.
 *
 * This file carries only what keeps the banner usable and lawful: positioning,
 * focus visibility, and the equal weight of accept and reject. The few
 * !important declarations here exist so a theme cannot accidentally turn the
 * choice into a dark pattern. Colours and shapes live in the theme file and
 * can be overridden freely.
 */

.ctg-root {
	--ctg-bg: #ffffff;
	--ctg-fg: #1a1a1a;
	--ctg-muted: #6b7280;
	--ctg-border: #e5e7eb;
	--ctg-radius: 12px;
	--ctg-shadow: 0 10px 40px rgba(0, 0, 0, .15);
	--ctg-accent: #7c3aed;
	--ctg-accent-fg: #ffffff;
	--ctg-reject-bg: transparent;
	--ctg-reject-fg: var(--ctg-fg);
	--ctg-reject-border: var(--ctg-border);
	--ctg-font: inherit;
	--ctg-z: 999999;
	--ctg-max-width: 1100px;
	--ctg-gap: 12px;
}

.ctg-root[hidden] {
	display: none !important;
}

.ctg-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: var(--ctg-z);
	font-family: var(--ctg-font);
}

.ctg-banner--bottom {
	bottom: 0;
}

.ctg-banner--top {
	top: 0;
}

.ctg-banner--center {
	top: 50%;
	transform: translateY(-50%);
	max-width: 560px;
	margin: 0 auto;
}

.ctg-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ctg-gap);
	max-width: var(--ctg-max-width);
	margin: 0 auto;
	padding: 16px;
	box-sizing: border-box;
}

.ctg-banner__content {
	flex: 1 1 320px;
	min-width: 0;
}

.ctg-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ctg-gap);
	align-items: stretch;
}

/* Equal weight. Not a style choice: unequal buttons invalidate the consent. */
.ctg-btn {
	font-size: 15px !important;
	line-height: 1.3 !important;
	padding: 12px 20px !important;
	min-width: 150px !important;
	min-height: 44px !important;
	border: 1px solid transparent;
	border-radius: var(--ctg-radius);
	cursor: pointer;
	font-family: inherit;
	text-align: center;
	box-sizing: border-box;
}

.ctg-btn:focus-visible,
.ctg-modal__close:focus-visible,
.ctg-revoke:focus-visible,
.ctg-switch__input:focus-visible + .ctg-switch__track {
	outline: 3px solid currentColor !important;
	outline-offset: 2px !important;
}

.ctg-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--ctg-z);
}

.ctg-modal {
	position: fixed;
	z-index: calc(var(--ctg-z) + 1);
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(680px, calc(100vw - 32px));
	max-height: min(85vh, 900px);
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.ctg-modal__body {
	overflow-y: auto;
	flex: 1 1 auto;
	-webkit-overflow-scrolling: touch;
}

.ctg-modal__header,
.ctg-modal__footer {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: var(--ctg-gap);
}

.ctg-modal__header {
	justify-content: space-between;
}

.ctg-modal__footer {
	flex-wrap: wrap;
}

.ctg-category__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ctg-gap);
}

.ctg-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	cursor: pointer;
}

.ctg-switch--locked {
	cursor: not-allowed;
}

.ctg-switch__input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: inherit;
}

.ctg-switch__track {
	position: relative;
	display: block;
	width: 46px;
	height: 26px;
	border-radius: 999px;
}

.ctg-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	transition: transform .15s ease;
}

.ctg-switch__input:checked + .ctg-switch__track .ctg-switch__thumb {
	transform: translateX(20px);
}

.ctg-revoke {
	position: fixed;
	z-index: calc(var(--ctg-z) - 1);
	bottom: 16px;
	cursor: pointer;
	border: 1px solid var(--ctg-border);
	font-family: inherit;
}

.ctg-revoke--bottom-left {
	left: 16px;
}

.ctg-revoke--bottom-right {
	right: 16px;
}

.ctg-placeholder {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 160px;
	padding: 16px;
	box-sizing: border-box;
}

.ctg-placeholder iframe {
	display: none;
	width: 100%;
	border: 0;
}

.ctg-placeholder--released {
	display: block;
	min-height: 0;
	padding: 0;
}

.ctg-placeholder--released iframe {
	display: block;
}

.ctg-category__services {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
}

.ctg-service {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
}

@media (max-width: 640px) {
	.ctg-banner__actions {
		width: 100%;
	}

	.ctg-btn {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ctg-switch__thumb {
		transition: none;
	}
}
