/*
 * VapeEra Core: cookie consent banner. Colours, radii and fonts come from the theme's tokens
 * (--vc-*) when they exist. A theme that styles it itself declares
 * add_theme_support( 'vapeera-core', array( 'analytics-styles' ) ) and this file is not loaded.
 * Sits above the fixed WhatsApp / back-to-top buttons; below the age gate and the mobile drawer.
 */
.vapeera-consent {
	position: fixed;
	right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	left: 12px;
	z-index: 99990;
	box-sizing: border-box;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	overflow-y: auto;
	padding: 20px;
	border: 1px solid var(--vc-line, #d9e7ec);
	border-radius: var(--vc-radius, 16px);
	background: var(--vc-surface, #fff);
	color: var(--vc-ink, #021c24);
	box-shadow: var(--vc-shadow-lg, 0 16px 48px rgb(2 28 36 / 18%));
	font-family: var(--vc-font, inherit);
	font-size: 0.9375rem;
	line-height: 1.5;
	outline: 0;
	animation: vapeera-consent-in 0.25s var(--vc-ease, ease-out);
}

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

/* Focus is moved to the banner so screen readers announce it; the container itself needs no ring. */
.vapeera-consent[data-vapeera-consent]:focus,
.vapeera-consent[data-vapeera-consent]:focus-visible {
	outline: 0;
}

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

@media (min-width: 640px) {
	.vapeera-consent {
		right: auto;
		left: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		width: 440px;
		max-width: calc(100vw - 32px);
		padding: 24px;
	}
}

.vapeera-consent__title {
	margin: 0 0 8px;
	color: var(--vc-ink, #021c24);
	font-family: var(--vc-font-heading, inherit);
	font-size: 1.125rem;
	line-height: 1.25;
}

.vapeera-consent__text {
	margin: 0;
	color: var(--vc-ink-soft, #2e576a);
}

.vapeera-consent__text a {
	color: var(--vc-primary-ink, #0e4f58);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.vapeera-consent__prefs {
	margin-top: 14px;
}

.vapeera-consent__group {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.vapeera-consent__option {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 10px 12px;
	border-radius: var(--vc-radius-sm, 10px);
	background: var(--vc-primary-tint, #e3f2f5);
}

.vapeera-consent__option + .vapeera-consent__option {
	margin-top: 8px;
}

.vapeera-consent__option input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--vc-primary-deep, #16646f);
	cursor: pointer;
}

.vapeera-consent__option input:disabled {
	cursor: not-allowed;
}

.vapeera-consent__option label {
	display: block;
	min-width: 0;
	cursor: pointer;
}

.vapeera-consent__option strong {
	display: block;
	color: var(--vc-ink, #021c24);
}

.vapeera-consent__option span {
	display: block;
	color: var(--vc-ink-soft, #2e576a);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.vapeera-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.vapeera-consent__btn {
	display: inline-flex;
	flex: 1 1 110px;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	border: 1px solid transparent;
	border-radius: var(--vc-radius-pill, 999px);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.vapeera-consent__btn[hidden] {
	display: none;
}

/* Accept and Reject look the same: no nudging towards either. */
.vapeera-consent__btn--primary {
	background: var(--vc-primary-deep, #16646f);
	color: #fff;
}

.vapeera-consent__btn--primary:hover {
	background: var(--vc-primary-ink, #0e4f58);
	color: #fff;
}

.vapeera-consent__btn--ghost {
	flex-basis: 100%;
	border-color: var(--vc-line, #d9e7ec);
	background: transparent;
	color: var(--vc-ink, #021c24);
}

.vapeera-consent__btn--ghost:hover {
	border-color: var(--vc-ink, #021c24);
	background: transparent;
	color: var(--vc-ink, #021c24);
}

.vapeera-consent__btn:focus-visible,
.vapeera-consent__option input:focus-visible,
.vapeera-consent__text a:focus-visible {
	outline: 3px solid var(--vc-primary, #3aa2b1);
	outline-offset: 2px;
}

/* Footer "Cookie settings" link (a button styled like the legal links next to it). */
.vapeera-consent-link {
	display: inline-block;
	margin: 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	text-align: left;
	cursor: pointer;
}

.vapeera-consent-link:hover {
	color: var(--vc-primary-soft, #7cc7d1);
}

.vapeera-consent-link:focus-visible {
	outline: 2px solid var(--vc-primary, #3aa2b1);
	outline-offset: 2px;
}

@keyframes vapeera-consent-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vapeera-consent {
		animation: none;
	}
}
