/**
 * WHY Tracking & Consent — banner styles.
 * Colours come from CSS custom properties printed inline by the plugin.
 */

.why-consent,
.why-consent-badge,
.why-consent-placeholder {
	--why-bg: #ffffff;
	--why-text: #111827;
	--why-muted: #4b5563;
	--why-accent: #111827;
	--why-accent-text: #ffffff;
	--why-border: #e5e7eb;
	--why-radius: 14px;

	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.5;
}

.why-consent *,
.why-consent *::before,
.why-consent *::after {
	box-sizing: border-box;
}

.why-consent[hidden] {
	display: none;
}

html.why-consent-locked {
	overflow: hidden;
}

/* ---------------------------------------------------------------- Backdrop */

.why-consent__backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	z-index: 999998;
}

.why-consent--overlay.is-banner-open .why-consent__backdrop,
.why-consent.is-modal-open .why-consent__backdrop {
	display: block;
}

/* ------------------------------------------------------------------ Banner */

.why-consent__banner {
	position: fixed;
	z-index: 999999;
	max-width: 30rem;
	width: calc(100% - 2rem);
	padding: 1.25rem;
	background: var(--why-bg);
	color: var(--why-text);
	border: 1px solid var(--why-border);
	border-radius: var(--why-radius);
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
	animation: why-consent-in 0.25s ease-out both;
}

.why-consent__banner[hidden] {
	display: none;
}

.why-consent--bottom-left .why-consent__banner {
	inset: auto auto 1rem 1rem;
}

.why-consent--bottom-right .why-consent__banner {
	inset: auto 1rem 1rem auto;
}

.why-consent--bottom .why-consent__banner {
	inset: auto auto 1rem 50%;
	transform: translateX(50%);
}

.why-consent--top .why-consent__banner {
	inset: 1rem auto auto 50%;
	transform: translateX(50%);
}

.why-consent--bar .why-consent__banner {
	max-width: none;
	width: 100%;
	inset: auto 0 0 0;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	padding: 1rem clamp(1rem, 4vw, 3rem);
	transform: none;
}

.why-consent--bar.why-consent--top .why-consent__banner {
	inset: 0 0 auto 0;
	border-top: 0;
	border-bottom: 1px solid var(--why-border);
}

.why-consent--bar .why-consent__text {
	flex: 1 1 20rem;
	margin: 0;
}

.why-consent--bar .why-consent__title {
	flex: 1 0 100%;
}

.why-consent--bar .why-consent__actions {
	margin: 0;
	flex: 0 0 auto;
}

.why-consent--modal .why-consent__banner {
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	max-width: 34rem;
}

.why-consent--modal.is-banner-open .why-consent__backdrop {
	display: block;
}

/* ------------------------------------------------------------------- Typography */

.why-consent__title {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--why-text);
	line-height: 1.3;
}

.why-consent__text {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--why-muted);
}

.why-consent__text p {
	margin: 0 0 0.5rem;
}

.why-consent__links {
	margin: 0.25rem 0 0;
	font-size: 0.8125rem;
}

.why-consent__links a {
	color: var(--why-muted);
	text-decoration: underline;
}

.why-consent__links a:hover,
.why-consent__links a:focus {
	color: var(--why-text);
}

/* ----------------------------------------------------------------- Buttons */

.why-consent__actions,
.why-consent__modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.why-consent__btn {
	appearance: none;
	cursor: pointer;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	padding: 0.65rem 1.1rem;
	border-radius: calc(var(--why-radius) / 2);
	border: 1px solid transparent;
	transition: opacity 0.15s ease, background-color 0.15s ease;
	min-height: 2.75rem;
}

.why-consent__btn:focus-visible {
	outline: 2px solid var(--why-accent);
	outline-offset: 2px;
}

/* Accept and reject share the same visual weight — a "reject" that is harder
   to find than "accept" is not valid consent under the GDPR. */
.why-consent__btn--primary {
	background: var(--why-accent);
	color: var(--why-accent-text);
	border-color: var(--why-accent);
}

.why-consent__btn--secondary {
	background: transparent;
	color: var(--why-text);
	border-color: var(--why-border);
}

.why-consent__btn--primary:hover,
.why-consent__btn--secondary:hover {
	opacity: 0.85;
}

.why-consent__btn--link {
	background: none;
	border: 0;
	padding: 0.65rem 0.5rem;
	color: var(--why-muted);
	text-decoration: underline;
}

.why-consent__btn--link:hover {
	color: var(--why-text);
}

/* ------------------------------------------------------------------- Modal */

.why-consent__modal {
	position: fixed;
	z-index: 1000000;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	width: min(38rem, calc(100% - 2rem));
	max-height: min(85vh, 46rem);
	display: flex;
	flex-direction: column;
	background: var(--why-bg);
	color: var(--why-text);
	border: 1px solid var(--why-border);
	border-radius: var(--why-radius);
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
	animation: why-consent-in 0.2s ease-out both;
}

.why-consent__modal[hidden] {
	display: none;
}

.why-consent__modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 1.25rem 0.75rem;
	border-bottom: 1px solid var(--why-border);
}

.why-consent__modal-head .why-consent__title {
	margin: 0;
}

.why-consent__close {
	appearance: none;
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--why-muted);
	padding: 0.25rem 0.5rem;
	border-radius: 0.375rem;
}

.why-consent__close:hover {
	color: var(--why-text);
}

.why-consent__modal-body {
	padding: 1rem 1.25rem;
	overflow-y: auto;
	flex: 1 1 auto;
}

.why-consent__intro {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--why-muted);
}

.why-consent__modal-actions {
	padding: 0.875rem 1.25rem;
	border-top: 1px solid var(--why-border);
}

/* -------------------------------------------------------------- Categories */

.why-consent__category {
	padding: 0.875rem 0;
	border-bottom: 1px solid var(--why-border);
}

.why-consent__category:last-of-type {
	border-bottom: 0;
}

.why-consent__category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.why-consent__category-label {
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--why-text);
}

.why-consent__category-desc {
	margin: 0.4rem 0 0;
	font-size: 0.8125rem;
	color: var(--why-muted);
}

.why-consent__badge-required {
	font-size: 0.75rem;
	color: var(--why-muted);
	white-space: nowrap;
}

/* Toggle */

.why-consent__switch {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	cursor: pointer;
}

.why-consent__switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.why-consent__slider {
	position: relative;
	flex: 0 0 auto;
	width: 2.5rem;
	height: 1.4rem;
	border-radius: 1rem;
	background: var(--why-border);
	transition: background-color 0.2s ease;
}

.why-consent__slider::after {
	content: "";
	position: absolute;
	top: 0.2rem;
	left: 0.2rem;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
	transition: transform 0.2s ease;
}

.why-consent__switch input:checked + .why-consent__slider {
	background: var(--why-accent);
}

.why-consent__switch input:checked + .why-consent__slider::after {
	transform: translateX(1.1rem);
}

.why-consent__switch input:disabled + .why-consent__slider {
	opacity: 0.6;
	cursor: not-allowed;
}

.why-consent__switch input:focus-visible + .why-consent__slider {
	outline: 2px solid var(--why-accent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------- Badge */

.why-consent-badge {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 999990;
	width: 2.75rem;
	height: 2.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	cursor: pointer;
	background: var(--why-bg);
	color: var(--why-text);
	border: 1px solid var(--why-border);
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
	transition: transform 0.15s ease;
}

.why-consent-badge[hidden] {
	display: none;
}

.why-consent-badge:hover {
	transform: scale(1.06);
}

/* ------------------------------------------------------- Blocked content */

.why-consent-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	text-align: center;
	padding: 2rem 1.25rem;
	min-height: 12rem;
	background: var(--why-bg);
	color: var(--why-text);
	border: 1px dashed var(--why-border);
	border-radius: var(--why-radius);
}

.why-consent-placeholder p {
	margin: 0;
	font-size: 0.875rem;
	color: var(--why-muted);
	max-width: 32rem;
}

/* ------------------------------------------------------------------ Status */

.why-consent-status__list {
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
	display: grid;
	gap: 0.25rem;
}

.why-consent-status__item {
	font-size: 0.875rem;
}

.why-consent-status__item.is-granted::before {
	content: "\2713\00a0";
	color: #15803d;
}

.why-consent-status__item.is-denied::before {
	content: "\2717\00a0";
	color: #b91c1c;
}

/* -------------------------------------------------------------- Responsive */

@media (max-width: 600px) {
	.why-consent__banner {
		inset: auto 0.5rem 0.5rem 0.5rem !important;
		width: auto;
		max-width: none;
		transform: none !important;
	}

	.why-consent--top .why-consent__banner {
		inset: 0.5rem 0.5rem auto 0.5rem !important;
	}

	.why-consent__actions .why-consent__btn,
	.why-consent__modal-actions .why-consent__btn {
		flex: 1 1 auto;
		justify-content: center;
		text-align: center;
	}

	.why-consent__modal {
		width: calc(100% - 1rem);
		max-height: 90vh;
	}
}

@keyframes why-consent-in {
	from {
		opacity: 0;
		transform: translateY(0.75rem);
	}
}

.why-consent--bottom .why-consent__banner,
.why-consent--top .why-consent__banner,
.why-consent--modal .why-consent__banner,
.why-consent__modal {
	animation-name: why-consent-fade;
}

@keyframes why-consent-fade {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.why-consent__banner,
	.why-consent__modal,
	.why-consent-badge,
	.why-consent__slider,
	.why-consent__slider::after {
		animation: none !important;
		transition: none !important;
	}
}
