/* ==========================================================================
   BAV Consent Banner
   Matches UX design from ux-design-directions.html — Variant A.
   References --bav-* design tokens from bav-components.css (Story 1.1).
   ========================================================================== */

/* ---- Body lock while banner is active ---- */
body.bav-consent--active {
	overflow: hidden !important;
}

/* ---- Overlay ---- */
.bav-consent__overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bav-bg-overlay);
	opacity: 0;
	transition: opacity var(--bav-transition-slow);
}

.bav-consent__overlay--visible {
	opacity: 1;
}

/* ---- Modal ---- */
.bav-consent__modal {
	position: relative;
	width: 100%;
	height: 100%;
	max-height: 100vh;
	overflow-y: auto;
	background: var(--bav-bg);
	border-radius: var(--bav-radius-none);
	box-shadow: none;
	padding: var(--bav-space-2xl);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--bav-space-lg);
	text-align: center;
}

/* Tablet and up — centered card */
@media (min-width: 768px) {
	.bav-consent__modal {
		width: auto;
		max-width: 520px;
		height: auto;
		max-height: 90vh;
		box-shadow: var(--bav-shadow-lg);
	}
}

/* ---- Logo ---- */
.bav-consent__logo {
	margin-bottom: var(--bav-space-sm);
}

.bav-consent__logo img {
	max-width: 300px;
	height: auto;
}

/* ---- Typography ---- */
.bav-consent__title {
	margin: 0;
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-xl);
	font-weight: var(--bav-font-weight-semibold);
	line-height: var(--bav-line-height-tight);
	color: var(--bav-text);
}

.bav-consent__text {
	margin: 0;
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-sm);
	font-weight: var(--bav-font-weight-normal);
	line-height: var(--bav-line-height-normal);
	color: var(--bav-text-secondary);
}

.bav-consent__privacy-link {
	color: var(--bav-text-secondary);
	text-decoration: underline;
	transition: color var(--bav-transition-fast);
}

@media (hover: hover) and (min-width: 992px) {
	.bav-consent__privacy-link:hover {
		color: var(--bav-text);
	}
}

/* ---- Actions container ---- */
.bav-consent__actions {
	display: flex;
	flex-direction: column;
	gap: var(--bav-space-sm);
	align-items: center;
}

/* ---- Primary CTA — full-width gold button ---- */
.bav-consent__btn-accept {
	width: 100%;
	min-height: 52px;
	padding: var(--bav-space-md) var(--bav-space-xl);
	background: var(--bav-accent);
	color: var(--bav-primary);
	border: none;
	border-radius: var(--bav-radius-none);
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-base);
	font-weight: var(--bav-font-weight-semibold);
	cursor: pointer;
	transition: background var(--bav-transition-fast);
	position: relative;
	overflow: hidden;
}

.bav-consent__btn-accept:focus-visible {
	outline: none;
	box-shadow: var(--bav-focus-ring);
}

.bav-consent__btn-accept:active {
	transform: scale(0.97);
}

/* Shine sweep — ::after pseudo-element, desktop only */
@keyframes bav-shine {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(200%); }
}

.bav-consent__btn-accept::after,
.bav-consent__btn--save::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
	transform: translateX(-100%);
	pointer-events: none;
}

@media (hover: hover) and (min-width: 992px) {
	.bav-consent__btn-accept:hover::after,
	.bav-consent__btn--save:hover::after {
		animation: bav-shine 0.6s ease-out;
	}
}

/* ---- Customize — underlined text link ---- */
.bav-consent__link-customize {
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-sm);
	color: var(--bav-text-secondary);
	text-decoration: underline;
	cursor: pointer;
	background: none;
	border: none;
	padding: var(--bav-space-sm);
	transition: color var(--bav-transition-fast);
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.bav-consent__link-customize:focus-visible {
	outline: none;
	box-shadow: var(--bav-focus-ring);
}

@media (hover: hover) and (min-width: 992px) {
	.bav-consent__link-customize:hover {
		color: var(--bav-text);
	}
}

/* ---- Reject — subtle small text link ---- */
.bav-consent__link-reject {
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-xs);
	color: var(--bav-text-secondary);
	text-decoration: none;
	cursor: pointer;
	background: none;
	border: none;
	padding: var(--bav-space-xs);
	opacity: 0.7;
	transition: opacity var(--bav-transition-fast);
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.bav-consent__link-reject:focus-visible {
	outline: none;
	box-shadow: var(--bav-focus-ring);
}

@media (hover: hover) and (min-width: 992px) {
	.bav-consent__link-reject:hover {
		opacity: 1;
		text-decoration: underline;
	}
}

/* ---- Save button in customize panel ---- */
.bav-consent__btn--save {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: var(--bav-space-md) var(--bav-space-xl);
	margin-top: var(--bav-space-sm);
	background-color: var(--bav-accent);
	color: var(--bav-primary);
	border: none;
	border-radius: var(--bav-radius-none);
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-base);
	font-weight: var(--bav-font-weight-semibold);
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.bav-consent__btn--save:focus-visible {
	outline: none;
	box-shadow: var(--bav-focus-ring);
}

.bav-consent__btn--save:active {
	transform: scale(0.97);
}

/* ==========================================================================
   Customize Panel
   ========================================================================== */

.bav-consent__panel {
	display: flex;
	flex-direction: column;
	gap: var(--bav-space-md);
	border-top: var(--bav-border-width) solid var(--bav-border);
	padding-top: var(--bav-space-lg);
	text-align: left;
}

/* ---- Category row ---- */
.bav-consent__category {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--bav-space-md);
}

.bav-consent__category-info {
	display: flex;
	flex-direction: column;
	gap: var(--bav-space-xs);
	flex: 1;
	min-width: 0;
}

.bav-consent__category-label {
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-base);
	font-weight: var(--bav-font-weight-semibold);
	color: var(--bav-text);
}

.bav-consent__category-desc {
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-sm);
	font-weight: var(--bav-font-weight-normal);
	color: var(--bav-text-secondary);
	line-height: var(--bav-line-height-normal);
}

/* ---- Locked badge ---- */
.bav-consent__badge--locked {
	flex-shrink: 0;
	font-family: var(--bav-font-family);
	font-size: var(--bav-font-size-xs);
	font-weight: var(--bav-font-weight-medium);
	color: var(--bav-success);
	white-space: nowrap;
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */

.bav-consent__toggle {
	position: relative;
	flex-shrink: 0;
	width: 48px;
	height: 28px;
	padding: 2px;
	border: var(--bav-border-width) solid var(--bav-border);
	border-radius: 14px; /* pill shape for toggle only */
	background-color: var(--bav-bg-surface);
	cursor: pointer;
	transition: background-color var(--bav-transition-fast),
	            border-color var(--bav-transition-fast);
}

.bav-consent__toggle:focus-visible {
	outline: none;
	box-shadow: var(--bav-focus-ring);
}

.bav-consent__toggle-knob {
	display: block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background-color: var(--bav-primary);
	transition: transform var(--bav-transition-fast);
}

/* ON state */
.bav-consent__toggle--on {
	background-color: var(--bav-accent);
	border-color: var(--bav-accent);
}

.bav-consent__toggle--on .bav-consent__toggle-knob {
	transform: translateX(20px);
	background-color: var(--bav-primary);
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

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

	.bav-consent__btn-accept,
	.bav-consent__link-customize,
	.bav-consent__link-reject,
	.bav-consent__btn--save {
		transition: none;
	}

	.bav-consent__toggle,
	.bav-consent__toggle-knob {
		transition: none;
	}
}
