/* Cookie consent banner — inc/mg-analytics.php, assets/js/consent.js. */

.mg-consent {
	position: fixed;
	z-index: 900; /* above the mobile dock (850), below dialogs */
	inset-inline: 16px;
	inset-block-end: max(16px, env(safe-area-inset-bottom));
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 22px;
	width: min(760px, calc(100% - 32px));
	margin-inline: auto;
	padding: 18px 20px;
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: 16px;
	background: #0b1b29;
	box-shadow: 0 24px 60px -24px rgba(4, 16, 26, .7);
	color: #e8f0f6;
	font-size: 14px;
	line-height: 1.85;
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .3s ease, transform .35s cubic-bezier(.16, 1, .3, 1);
}
.mg-consent.is-in { opacity: 1; transform: none; }

.mg-consent__body { flex: 1 1 360px; min-width: 0; }
.mg-consent__t { margin: 0 0 2px; color: #fff; font-size: 15px; font-weight: 800; }
.mg-consent__p { margin: 0; color: #cfdce6; }
.mg-consent__p a { color: #8fd0ff; text-decoration: underline; text-underline-offset: 3px; }
.mg-consent__p a:hover { color: #fff; }

.mg-consent__acts { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 10px; }
.mg-consent__btn {
	min-height: 44px;
	padding: 10px 20px;
	border: 1px solid #fff;
	border-radius: 10px;
	background: #fff;
	color: #0b1b29;
	cursor: pointer;
	font: inherit;
	font-weight: 800;
	transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
/* «فقط ضروری» carries the same size and weight as «پذیرش همه»: a refusal that
   is harder to see than the acceptance is not a free choice. */
.mg-consent__btn--alt { background: transparent; color: #fff; }
.mg-consent__btn:hover { background: #d9ecfb; border-color: #d9ecfb; color: #0b1b29; }
.mg-consent__btn:active { transform: translateY(1px); }
.mg-consent__btn:focus-visible { outline: 3px solid var(--mg-focus, #ffbf47); outline-offset: 2px; }

.mg-consent--notice .mg-consent__body { flex-basis: 420px; }

/* Keep clear of the fixed mobile conversion dock and the app bottom bar. */
@media (max-width: 720px) {
	.mg-consent {
		inset-block-end: calc(84px + env(safe-area-inset-bottom));
		padding: 16px;
	}
	.mg-consent__acts { width: 100%; }
	.mg-consent__btn { flex: 1 1 0; }
}
html.mg-app .mg-consent { inset-block-end: calc(78px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
	.mg-consent { transition: none; transform: none; }
}

/* Footer «تنظیمات کوکی» sits among the legal links and must look like one. */
.mg-footer__consent {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	text-decoration: none;
}
.mg-footer__consent:hover { text-decoration: underline; }
.mg-footer__consent:focus-visible { outline: 2px solid var(--mg-focus, #ffbf47); outline-offset: 2px; }

@media print { .mg-consent { display: none !important; } }
