/*
 * Cookie consent banner + preferences panel.
 * Uses the v3 design tokens from global.css (--green, --black, --text-*, fonts).
 * Loaded on every page via inc/consent.php.
 */

.yoda-consent[hidden] { display: none !important; }

.yoda-consent {
	position: fixed;
	inset: 0;
	z-index: 2147483000; /* above WA FAB and sticky CTA */
	display: flex;
	align-items: flex-end;
	justify-content: center;
	font-family: var(--font-body, system-ui, sans-serif);
}

.yoda-consent__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

/* Shared card look */
.yoda-consent__banner,
.yoda-consent__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	margin: 16px;
	margin-bottom: max(16px, env(safe-area-inset-bottom, 16px));
	background: var(--black-forest, #0a1510);
	border: 1px solid rgba(255, 255, 255, 0.10);
	border-radius: 18px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(37, 211, 102, 0.08);
	padding: 24px;
	color: var(--text-1, #f5f5f7);
	animation: yoda-consent-rise 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.yoda-consent__panel {
	max-width: 520px;
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	align-self: center;
}

@keyframes yoda-consent-rise {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}

.yoda-consent__title {
	font-family: var(--font-display, system-ui, sans-serif);
	font-weight: 600;
	font-size: 19px;
	line-height: 1.2;
	margin: 0 0 10px;
	color: var(--white, #fff);
}

.yoda-consent__text {
	font-size: 14px;
	line-height: 1.55;
	color: var(--text-2, #a1a1a6);
	margin: 0 0 18px;
}

.yoda-consent__policy {
	color: var(--green, #25d366);
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}
.yoda-consent__policy:hover { opacity: 0.85; }

.yoda-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: flex-end;
}

.yoda-consent__btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 11px 20px;
	font-family: var(--font-body, system-ui, sans-serif);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
	line-height: 1;
}
.yoda-consent__btn:active { transform: scale(0.97); }

/* Reject / Customize and Accept carry equal visual weight (GDPR: reject as easy as accept) */
.yoda-consent__btn--ghost {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.16);
	color: var(--text-1, #f5f5f7);
}
.yoda-consent__btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }

.yoda-consent__btn--solid {
	background: var(--green, #25d366);
	color: #04210f;
	box-shadow: 0 0 20px rgba(37, 211, 102, 0.28);
}
.yoda-consent__btn--solid:hover { opacity: 0.92; }

/* Category rows */
.yoda-consent__cat {
	padding: 14px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.yoda-consent__cat:first-of-type { border-top: none; }
.yoda-consent__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}
.yoda-consent__cat-title {
	font-weight: 600;
	font-size: 15px;
	color: var(--text-1, #f5f5f7);
}
.yoda-consent__cat-desc {
	font-size: 13px;
	line-height: 1.5;
	color: var(--text-3, #6e6e73);
	margin: 0;
}
.yoda-consent__always {
	font-size: 12px;
	font-weight: 600;
	color: var(--green, #25d366);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Toggle switch */
.yoda-consent__switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 26px;
	flex: 0 0 auto;
	cursor: pointer;
}
.yoda-consent__switch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.yoda-consent__slider {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	transition: background 0.2s ease;
}
.yoda-consent__slider::before {
	content: "";
	position: absolute;
	width: 20px;
	height: 20px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}
.yoda-consent__switch input:checked + .yoda-consent__slider {
	background: var(--green, #25d366);
}
.yoda-consent__switch input:checked + .yoda-consent__slider::before {
	transform: translateX(18px);
}
.yoda-consent__switch input:focus-visible + .yoda-consent__slider {
	outline: 2px solid var(--green, #25d366);
	outline-offset: 2px;
}

.yoda-consent__panel .yoda-consent__actions {
	margin-top: 18px;
	justify-content: space-between;
}

/* Footer "Cookie settings" trigger */
.footer__cookie-link {
	appearance: none;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	color: inherit;
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.footer__cookie-link:hover { color: var(--green, #25d366); }

@media (max-width: 480px) {
	.yoda-consent__banner,
	.yoda-consent__panel { padding: 20px; margin: 10px; border-radius: 16px; }
	.yoda-consent__actions { justify-content: stretch; }
	.yoda-consent__btn { flex: 1 1 auto; text-align: center; }
	.yoda-consent__panel .yoda-consent__actions .yoda-consent__policy { flex-basis: 100%; }
}
