/**
 * BKM Consent
 *
 * Brand palette lifted from the theme: #384148 slate, #565e63 muted, white.
 * Lora for headings, Montserrat for body, matching bkm_base.
 *
 * "Accept all" and "Reject all" are deliberately identical in size, colour and
 * weight — a reject that is harder to find than an accept is not a free choice,
 * so please keep them visually equal if you restyle this.
 */

.bkm-consent,
.bkm-consent-modal {
	--bkm-slate: #384148;
	--bkm-muted: #565e63;
	--bkm-light: #f4f4f2;
	box-sizing: border-box;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.bkm-consent *,
.bkm-consent-modal * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ banner */

.bkm-consent {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 999999;
	background: var(--bkm-slate);
	color: #fff;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
	transform: translateY(100%);
	transition: transform 0.35s ease;
}

.bkm-consent.is-visible {
	transform: translateY(0);
}

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

.bkm-consent__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.5rem;
	display: flex;
	gap: 2rem;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.bkm-consent__copy {
	flex: 1 1 28rem;
	min-width: 0;
}

.bkm-consent__title {
	font-family: 'Lora', Georgia, serif;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 0.5rem;
	color: #fff;
}

.bkm-consent__text {
	font-size: 0.875rem;
	line-height: 1.6;
	margin: 0;
	color: rgba(255, 255, 255, 0.88);
}

.bkm-consent__text a {
	color: #fff;
	text-decoration: underline;
}

.bkm-consent__actions {
	flex: 0 0 auto;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
}

/* ----------------------------------------------------------------- buttons */

.bkm-consent__btn {
	appearance: none;
	display: inline-block;
	min-width: 10rem;
	padding: 0.75rem 1.5rem;
	border: 2px solid #fff;
	border-radius: 2px;
	background: #fff;
	color: var(--bkm-slate);
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bkm-consent__btn:hover,
.bkm-consent__btn:focus-visible {
	background: transparent;
	color: #fff;
}

.bkm-consent__link {
	appearance: none;
	padding: 0.75rem 0.5rem;
	border: 0;
	background: none;
	color: #fff;
	font-family: inherit;
	font-size: 0.8125rem;
	text-decoration: underline;
	cursor: pointer;
}

.bkm-consent :focus-visible,
.bkm-consent-modal :focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* ------------------------------------------------------------------- modal */

.bkm-consent-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.bkm-consent-modal.is-visible {
	opacity: 1;
}

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

.bkm-consent-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.bkm-consent-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 34rem;
	max-height: 85vh;
	overflow-y: auto;
	padding: 2rem;
	background: #fff;
	color: var(--bkm-slate);
	border-radius: 3px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.bkm-consent-modal__title {
	font-family: 'Lora', Georgia, serif;
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	color: var(--bkm-slate);
}

.bkm-consent-modal__intro {
	font-size: 0.875rem;
	line-height: 1.6;
	margin: 0 0 1.5rem;
	color: var(--bkm-muted);
}

.bkm-consent-modal__actions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 1.75rem;
}

.bkm-consent-modal .bkm-consent__btn {
	flex: 1 1 auto;
	min-width: 8.5rem;
	border-color: var(--bkm-slate);
	background: var(--bkm-slate);
	color: #fff;
}

.bkm-consent-modal .bkm-consent__btn:hover,
.bkm-consent-modal .bkm-consent__btn:focus-visible {
	background: transparent;
	color: var(--bkm-slate);
}

.bkm-consent-modal :focus-visible {
	outline-color: var(--bkm-slate);
}

/* -------------------------------------------------------------- categories */

.bkm-consent-cat {
	padding: 1.125rem 0;
	border-top: 1px solid #e2e2df;
}

.bkm-consent-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.375rem;
}

.bkm-consent-cat__name {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--bkm-slate);
	cursor: pointer;
}

.bkm-consent-cat__always {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bkm-muted);
}

.bkm-consent-cat__desc {
	font-size: 0.8125rem;
	line-height: 1.6;
	margin: 0;
	color: var(--bkm-muted);
}

/* ------------------------------------------------------------------ switch */

.bkm-consent-switch {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	cursor: pointer;
}

.bkm-consent-switch input {
	position: absolute;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.bkm-consent-switch__track {
	display: block;
	width: 3rem;
	height: 1.625rem;
	border-radius: 1rem;
	background: #c4c4c0;
	transition: background-color 0.2s ease;
}

.bkm-consent-switch__track::after {
	content: '';
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.1875rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.bkm-consent-switch input:checked + .bkm-consent-switch__track {
	background: var(--bkm-slate);
}

.bkm-consent-switch input:checked + .bkm-consent-switch__track::after {
	transform: translateX(1.375rem);
}

.bkm-consent-switch input:focus-visible + .bkm-consent-switch__track {
	outline: 3px solid var(--bkm-slate);
	outline-offset: 2px;
}

/* ------------------------------------------------------ footer reopen link */

.bkm-consent-footer {
	padding: 0 1.5rem 1.5rem;
	background: #384148;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.8125rem;
	text-align: center;
}

.bkm-consent-footer .bkm-consent-open {
	color: rgba(255, 255, 255, 0.75);
}

.bkm-consent-footer .bkm-consent-open:hover,
.bkm-consent-footer .bkm-consent-open:focus-visible {
	color: #fff;
}

.bkm-consent-open {
	appearance: none;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ------------------------------------------------------------- small print */

@media (max-width: 782px) {
	.bkm-consent__inner {
		padding: 1.25rem;
		gap: 1.25rem;
	}

	.bkm-consent__actions {
		width: 100%;
	}

	.bkm-consent__btn {
		flex: 1 1 100%;
		min-width: 0;
	}

	.bkm-consent__link {
		width: 100%;
		text-align: center;
	}

	.bkm-consent-modal__dialog {
		padding: 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bkm-consent,
	.bkm-consent-modal,
	.bkm-consent__btn,
	.bkm-consent-switch__track,
	.bkm-consent-switch__track::after {
		transition: none;
	}
}
