/**
 * Cookie consent — replaces cookie-law-info (CookieYes).
 *
 * Namespaced under .eha-cc so nothing can collide with the theme's Tailwind
 * utilities or its existing .popup styles. Buttons deliberately reuse the
 * theme's own .btn / .btn--primary / .btn--outline classes, so the banner
 * inherits site styling rather than inventing its own.
 */

.eha-cc__banner {
	position: fixed;
	z-index: 9998;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	max-width: 64rem;
	margin-inline: auto;
	padding: 1.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	align-items: center;
	justify-content: space-between;
	background: #fff;
	color: #101330;
	border-radius: 0.5rem;
	box-shadow: 0 10px 40px rgba(16, 19, 48, 0.18);
}

.eha-cc__banner-text { flex: 1 1 22rem; }

.eha-cc__title {
	margin: 0 0 0.5rem;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
}

.eha-cc__desc {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.eha-cc__policy-link {
	font-size: 0.875rem;
	text-decoration: underline;
}

.eha-cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	flex: 0 0 auto;
}

/* Touch target floor, independent of whatever .btn sizing applies. */
.eha-cc__btn {
	min-height: 44px;
	padding-inline: 1.125rem;
	font-size: 0.875rem;
	white-space: nowrap;
}

/* ------------------------------------------------------- preference centre */

.eha-cc__modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(16, 19, 48, 0.6);
}

.eha-cc__modal-inner {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 42rem;
	max-height: 85vh;
	background: #fff;
	color: #101330;
	border-radius: 0.5rem;
	overflow: hidden;
}

.eha-cc__modal-head,
.eha-cc__modal-foot {
	flex: 0 0 auto;
	padding: 1.25rem 1.5rem;
}

.eha-cc__modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 1px solid #e6e8ef;
}

.eha-cc__modal-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 1.25rem 1.5rem;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.eha-cc__modal-body > p { margin: 0 0 0.75rem; }

.eha-cc__modal-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	justify-content: flex-end;
	border-top: 1px solid #e6e8ef;
}

.eha-cc__close {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	font-size: 1.75rem;
	line-height: 1;
	background: none;
	border: 0;
	cursor: pointer;
	color: inherit;
}

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

.eha-cc__categories {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}

.eha-cc__category { border-top: 1px solid #e6e8ef; }

.eha-cc__category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 0;
}

.eha-cc__category-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	color: inherit;
	min-height: 44px;
}

.eha-cc__chevron {
	width: 0;
	height: 0;
	border-left: 5px solid currentColor;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform 0.15s ease;
}

.eha-cc__category-toggle[aria-expanded="true"] .eha-cc__chevron {
	transform: rotate(90deg);
}

.eha-cc__category-desc {
	padding: 0 0 0.875rem 0.875rem;
	font-size: 0.875rem;
	color: #4d4d4d;
}

.eha-cc__always {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #00b755;
}

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

.eha-cc__switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	cursor: pointer;
}

.eha-cc__switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.eha-cc__slider {
	position: absolute;
	inset: 0;
	background: #dcdee2;
	border-radius: 999px;
	transition: background 0.15s ease;
	pointer-events: none;
}

.eha-cc__slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.eha-cc__switch input:checked + .eha-cc__slider { background: #0090fc; }
.eha-cc__switch input:checked + .eha-cc__slider::before { transform: translateX(20px); }

/* Keyboard focus must stay visible on the custom control. */
.eha-cc__switch input:focus-visible + .eha-cc__slider {
	outline: 2px solid #0090fc;
	outline-offset: 2px;
}

@media (max-width: 640px) {
	.eha-cc__banner { padding: 1.25rem; }
	.eha-cc__actions { width: 100%; }
	.eha-cc__actions .eha-cc__btn { flex: 1 1 auto; }
	.eha-cc__modal-foot { justify-content: stretch; }
	.eha-cc__modal-foot .eha-cc__btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
	.eha-cc__chevron,
	.eha-cc__slider,
	.eha-cc__slider::before { transition: none; }
}
