/**
 * Consent Switch — banner styles.
 *
 * Color values are custom properties; the actual colors are set from
 * settings via a small inline :root block (see Banner::color_css()), so
 * this file itself stays static and cacheable.
 */

:root {
	--consent-switch-bg: #1f2937;
	--consent-switch-text: #f9fafb;
	--consent-switch-button-bg: #2563eb;
	--consent-switch-button-text: #ffffff;
	--consent-switch-button-secondary: #4b5563;
}

.consent-switch,
.consent-switch-backdrop {
	box-sizing: border-box;
}

.consent-switch *,
.consent-switch-backdrop * {
	box-sizing: inherit;
}

.consent-switch[hidden],
.consent-switch-backdrop[hidden] {
	display: none;
}

.consent-switch-backdrop {
	position: fixed;
	inset: 0;
	z-index: 999998;
	background: rgba( 0, 0, 0, 0.5 );
	opacity: 0;
}

.consent-switch-backdrop.is-visible {
	opacity: 1;
}

.consent-switch {
	position: fixed;
	z-index: 999999;
	max-width: 100%;
	background: var( --consent-switch-bg );
	color: var( --consent-switch-text );
	box-shadow: 0 -2px 16px rgba( 0, 0, 0, 0.25 );
	opacity: 0;
	transform: translateY( 16px );
}

.consent-switch.is-visible {
	opacity: 1;
	transform: translateY( 0 );
}

.consent-switch__panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
}

.consent-switch__title {
	margin: 0 0 8px;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}

.consent-switch__description {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.consent-switch__description p {
	margin: 0 0 8px;
}

.consent-switch__description p:last-child {
	margin-bottom: 0;
}

.consent-switch__links a {
	color: inherit;
}

.consent-switch__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.consent-switch__button {
	appearance: none;
	background: none;
	border: 2px solid transparent;
	border-radius: 4px;
	padding: 12px 20px;
	min-height: 44px;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.consent-switch__button--accept {
	background: var( --consent-switch-button-bg );
	color: var( --consent-switch-button-text );
}

.consent-switch__button--reject {
	color: var( --consent-switch-text );
	border-color: var( --consent-switch-button-secondary );
}

.consent-switch a:focus-visible,
.consent-switch__button:focus-visible,
.consent-switch:focus-visible {
	outline: 3px solid var( --consent-switch-button-bg );
	outline-offset: 2px;
}

.consent-switch-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* Position: bottom — full-width bar. */
.consent-switch--bottom {
	inset-inline: 0;
	bottom: 0;
	border-top: 1px solid rgba( 255, 255, 255, 0.1 );
}

/* Position: bottom-left / bottom-right — corner card. */
.consent-switch--bottom-left,
.consent-switch--bottom-right {
	bottom: 16px;
	max-width: 380px;
	margin-inline: 16px;
	border-radius: 8px;
}

.consent-switch--bottom-left {
	left: 0;
}

.consent-switch--bottom-right {
	right: 0;
}

/* Position: center — modal dialog. */
.consent-switch--center {
	top: 50%;
	left: 50%;
	width: calc( 100% - 32px );
	max-width: 480px;
	border-radius: 8px;
	transform: translate( -50%, -50% ) scale( 0.97 );
}

.consent-switch--center.is-visible {
	transform: translate( -50%, -50% ) scale( 1 );
}

@media ( min-width: 480px ) {
	.consent-switch__actions {
		flex-direction: row;
		justify-content: flex-end;
	}

	.consent-switch__button {
		flex: 0 0 auto;
	}

	.consent-switch--bottom .consent-switch__panel {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.consent-switch--bottom .consent-switch__body {
		flex: 1 1 auto;
	}
}

@media ( prefers-reduced-motion: no-preference ) {
	.consent-switch {
		transition: opacity 0.2s ease, transform 0.2s ease;
	}

	.consent-switch-backdrop {
		transition: opacity 0.2s ease;
	}
}
