/**
 * Magen Consent - banner styling.
 *
 * Fixed-position throughout, so nothing here can shift the page layout.
 * Fonts follow the site: Poppins on EN/FR, Rubik on HE, with a system stack
 * behind them in case the banner paints before the webfont lands.
 */

#magen-consent {
	--mgc-ink: #16304d;
	--mgc-muted: #51657c;
	--mgc-line: #e3e8ee;
	--mgc-accent: #5cc1d6;
	--mgc-accent-ink: #0b3c49;
	--mgc-surface: #ffffff;
	position: fixed;
	z-index: 2147483000;
	inset: 0 auto auto 0;
	width: 0;
	height: 0;
	font-family: Poppins, "Helvetica Neue", Arial, sans-serif;
	color: var(--mgc-ink);
	line-height: 1.55;
}

#magen-consent[data-lang="he"] {
	font-family: Rubik, "Helvetica Neue", Arial, sans-serif;
}

#magen-consent[hidden] {
	display: none;
}

/* ------------------------------------------------------------- the notice */

.mgc-notice {
	position: fixed;
	bottom: 20px;
	inset-inline-start: 20px;
	width: min(420px, calc(100vw - 32px));
	box-sizing: border-box;
	background: var(--mgc-surface);
	border: 1px solid var(--mgc-line);
	border-radius: 14px;
	box-shadow: 0 18px 44px rgba(12, 32, 56, 0.18);
	padding: 22px 22px 18px;
}

.mgc-notice[hidden] {
	display: none;
}

#magen-consent .mgc-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--mgc-ink);
}

#magen-consent .mgc-desc {
	margin: 0 0 14px;
	font-size: 14px;
	/* The theme sets a heavier weight on <p>; without this the banner copy
	   renders semi-bold and reads louder than the heading. */
	font-weight: 400;
	color: var(--mgc-muted);
}

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

.mgc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

#magen-consent .mgc-btn {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	padding: 11px 18px;
	border-radius: 999px;
	border: 1px solid var(--mgc-accent);
	background: transparent;
	color: var(--mgc-accent-ink);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

#magen-consent .mgc-btn:hover,
#magen-consent .mgc-btn:focus-visible {
	background: rgba(92, 193, 214, 0.14);
}

#magen-consent .mgc-btn-primary {
	background: var(--mgc-accent);
	color: #ffffff;
}

#magen-consent .mgc-btn-primary:hover,
#magen-consent .mgc-btn-primary:focus-visible {
	background: #49b2c8;
	color: #ffffff;
}

#magen-consent .mgc-btn-link {
	border-color: transparent;
	padding-inline: 10px;
	text-decoration: underline;
}

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

.mgc-prefs {
	position: fixed;
	inset: 0;
	background: rgba(10, 26, 44, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.mgc-prefs[hidden] {
	display: none;
}

.mgc-prefs-inner {
	position: relative;
	background: var(--mgc-surface);
	border-radius: 16px;
	width: min(620px, 100%);
	max-height: min(82vh, 760px);
	overflow-y: auto;
	padding: 28px 28px 22px;
	box-sizing: border-box;
	box-shadow: 0 24px 60px rgba(12, 32, 56, 0.3);
}

#magen-consent .mgc-close {
	position: absolute;
	top: 12px;
	inset-inline-end: 14px;
	border: 0;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	color: var(--mgc-muted);
	cursor: pointer;
	padding: 4px 8px;
}

#magen-consent .mgc-cats {
	list-style: none;
	margin: 18px 0;
	padding: 0;
	border-top: 1px solid var(--mgc-line);
}

#magen-consent .mgc-cat {
	border-bottom: 1px solid var(--mgc-line);
	padding: 14px 0;
	margin: 0;
}

.mgc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

#magen-consent .mgc-cat-name {
	font-size: 15px;
	font-weight: 600;
}

#magen-consent .mgc-cat-desc {
	margin: 6px 0 0;
	font-size: 13px;
	font-weight: 400;
	color: var(--mgc-muted);
}

#magen-consent .mgc-always {
	font-size: 13px;
	font-weight: 500;
	color: #2e8b57;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ toggle */

.mgc-switch {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	cursor: pointer;
}

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

.mgc-slider {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #ccd4dd;
	transition: background-color 0.15s ease;
	pointer-events: none;
}

.mgc-slider::before {
	content: "";
	position: absolute;
	top: 3px;
	inset-inline-start: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	transition: transform 0.15s ease;
}

.mgc-switch input:checked + .mgc-slider {
	background: var(--mgc-accent);
}

.mgc-switch input:checked + .mgc-slider::before {
	transform: translateX(20px);
}

#magen-consent[dir="rtl"] .mgc-switch input:checked + .mgc-slider::before {
	transform: translateX(-20px);
}

.mgc-switch input:focus-visible + .mgc-slider {
	outline: 2px solid var(--mgc-accent-ink);
	outline-offset: 2px;
}

/* --------------------------------------------------------- revisit control */

.mgc-revisit {
	position: fixed;
	bottom: 16px;
	inset-inline-start: 16px;
	z-index: 2147482000;
	font-family: Poppins, "Helvetica Neue", Arial, sans-serif;
	font-size: 13px;
	line-height: 1;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px solid var(--mgc-line, #e3e8ee);
	background: #ffffff;
	color: #16304d;
	box-shadow: 0 8px 20px rgba(12, 32, 56, 0.16);
	cursor: pointer;
}

.mgc-revisit[dir="rtl"] {
	font-family: Rubik, "Helvetica Neue", Arial, sans-serif;
}

.mgc-revisit[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 600px) {
	.mgc-notice {
		inset-inline: 12px;
		bottom: 12px;
		width: auto;
		padding: 18px 18px 16px;
	}

	#magen-consent .mgc-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	.mgc-prefs-inner {
		padding: 24px 18px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#magen-consent .mgc-btn,
	.mgc-slider,
	.mgc-slider::before {
		transition: none;
	}
}
