/* GDPR cookie consent banner + Turnstile (PR #367 follow-on). */
.meerath-cookie-banner,
.meerath-cookie-prefs {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 1rem;
	background: rgba(15, 23, 42, 0.45);
}

.meerath-cookie-banner[hidden],
.meerath-cookie-prefs[hidden] {
	display: none !important;
}

.meerath-cookie-banner__panel,
.meerath-cookie-prefs__panel {
	width: min(100%, 640px);
	max-height: min(90vh, 720px);
	overflow: auto;
	padding: 1.25rem 1.35rem;
	border-radius: 1rem;
	background: #ffffff;
	color: #1e293b;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
	border: 1px solid rgba(209, 213, 219, 0.8);
}

html.dark-mode .meerath-cookie-banner__panel,
html.dark-mode .meerath-cookie-prefs__panel {
	background: #1a2537;
	color: #f8fafc;
	border-color: #334155;
}

.meerath-cookie-banner__title {
	margin: 0 0 0.65rem;
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.35;
}

.meerath-cookie-banner__body {
	margin: 0 0 1rem;
	font-size: 0.95rem;
	line-height: 1.55;
	color: #475569;
}

html.dark-mode .meerath-cookie-banner__body {
	color: #b2bdcc;
}

.meerath-cookie-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.meerath-cookie-banner__form {
	margin: 0;
}

.meerath-cookie-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.5rem;
	padding: 0.55rem 1rem;
	border-radius: 0.5rem;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	border: 1px solid transparent;
}

.meerath-cookie-btn--primary {
	background: #bb8c3f;
	color: #ffffff;
	border-color: #bb8c3f;
}

.meerath-cookie-btn--secondary {
	background: transparent;
	color: #1e293b;
	border-color: #cbd5e1;
}

html.dark-mode .meerath-cookie-btn--secondary {
	color: #f8fafc;
	border-color: #475569;
}

.meerath-cookie-btn--ghost {
	background: transparent;
	color: #475569;
	border-color: transparent;
	text-decoration: underline;
}

html.dark-mode .meerath-cookie-btn--ghost {
	color: #b2bdcc;
}

.meerath-cookie-prefs__group {
	margin: 0 0 0.85rem;
	padding: 0.75rem 0.85rem;
	border: 1px solid rgba(209, 213, 219, 0.7);
	border-radius: 0.65rem;
}

html.dark-mode .meerath-cookie-prefs__group {
	border-color: #334155;
}

.meerath-cookie-prefs__group legend {
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.meerath-cookie-prefs__group p {
	margin: 0.25rem 0 0;
	font-size: 0.88rem;
	line-height: 1.45;
	color: #64748b;
}

html.dark-mode .meerath-cookie-prefs__group p {
	color: #94a3b8;
}

.meerath-cookie-reopen {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 999990;
	padding: 0.45rem 0.75rem;
	border-radius: 999px;
	border: 1px solid #cbd5e1;
	background: #ffffff;
	color: #334155;
	font-size: 0.78rem;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.meerath-cookie-reopen[hidden] {
	display: none !important;
}

.meerath-cookie-footer-link {
	padding: 0.45rem 0.75rem;
	border-radius: 999px;
	border: 1px solid #cbd5e1;
	background: #ffffff;
	color: #334155;
	font-size: 0.78rem;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

html.dark-mode .meerath-cookie-reopen,
html.dark-mode .meerath-cookie-footer-link {
	background: #1a2537;
	color: #f8fafc;
	border-color: #475569;
}

html[dir="rtl"] .meerath-cookie-reopen {
	left: auto;
	right: 1rem;
}

.meerath-cookie-footer-link-wrap {
	text-align: center;
	padding: 0.5rem 0 1rem;
}

/*
 * Batch 8V-11 / batch8h mobile polish (extended shadow-wide):
 * When the floating reopen control is visible, hide the footer CMP pill so
 * consented visitors see one Cookie Preferences control — not reopen + footer.
 * Matches production mobile (max-width 921px) and removes the dual-pill look
 * Jawad flagged at the shadow footer end on wider viewports.
 * Scoped under .b8v-home-shadow only (via this sheet being shadow-only).
 */
body:has(#meerath-cookie-reopen:not([hidden])) .meerath-cookie-footer-link-wrap {
	display: none !important;
}

.meerath-turnstile-mount {
	margin: 0.75rem 0 1rem;
	min-height: 65px;
}

@media (max-width: 544px) {
	.meerath-cookie-banner,
	.meerath-cookie-prefs {
		padding: 0.75rem;
		align-items: flex-end;
	}

	.meerath-cookie-banner__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.meerath-cookie-btn {
		width: 100%;
	}
}

/* Batch 8V-11: shadow uses b8v-theme-dark instead of (or in addition to) html.dark-mode */
html.b8v-theme-dark .meerath-cookie-banner__panel,
body.b8v-theme-dark .meerath-cookie-banner__panel,
html.b8v-theme-dark .meerath-cookie-prefs__panel,
body.b8v-theme-dark .meerath-cookie-prefs__panel {
	background: #1a2537;
	color: #f8fafc;
	border-color: #334155;
}
html.b8v-theme-dark .meerath-cookie-banner__body,
body.b8v-theme-dark .meerath-cookie-banner__body,
html.b8v-theme-dark .meerath-cookie-prefs__group p,
body.b8v-theme-dark .meerath-cookie-prefs__group p {
	color: #b2bdcc;
}
html.b8v-theme-dark .meerath-cookie-btn--secondary,
body.b8v-theme-dark .meerath-cookie-btn--secondary {
	color: #f8fafc;
	border-color: #475569;
}
html.b8v-theme-dark .meerath-cookie-btn--ghost,
body.b8v-theme-dark .meerath-cookie-btn--ghost {
	color: #b2bdcc;
}
html.b8v-theme-dark .meerath-cookie-prefs__group,
body.b8v-theme-dark .meerath-cookie-prefs__group {
	border-color: #334155;
}
html.b8v-theme-dark .meerath-cookie-reopen,
body.b8v-theme-dark .meerath-cookie-reopen,
html.b8v-theme-dark .meerath-cookie-footer-link,
body.b8v-theme-dark .meerath-cookie-footer-link {
	background: #1a2537;
	color: #f8fafc;
	border-color: #475569;
}
