/* MT Privacy & Consent – Frontend banner & preferences */

/* Layer roots: moved to document.body via JS to escape theme stacking contexts */
.mtpc-banner-root,
.mtpc-preferences-root {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box !important;
	position: relative;
	z-index: 2147483647 !important;
	isolation: isolate;
	transform: none !important;
	filter: none !important;
	perspective: none !important;
	contain: none;
	pointer-events: none;
	width: auto !important;
	max-width: 100% !important;
	min-width: 0 !important;
	overflow: visible !important;
}

.mtpc-banner-root .mtpc-banner,
.mtpc-banner-root .mtpc-btn,
.mtpc-preferences-root .mtpc-prefs-overlay,
.mtpc-preferences-root .mtpc-prefs,
.mtpc-preferences-root .mtpc-btn,
.mtpc-preferences-root .mtpc-toggle,
.mtpc-preferences-root button {
	pointer-events: auto;
}

.mtpc-banner-root *,
.mtpc-preferences-root * {
	box-sizing: border-box !important;
}

/* Banner */
#mtpc-banner-root .mtpc-banner,
.mtpc-banner-root .mtpc-banner,
.mtpc-banner {
	position: fixed !important;
	left: 0 !important;
	right: 0 !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	z-index: 2147483647 !important;
	padding: 1rem 1.25rem !important;
	margin: 0 !important;
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 0.75rem 1rem !important;
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
	animation: mtpc-slide-up 0.35s ease;
	transform: none !important;
	filter: none !important;
	perspective: none !important;
	isolation: isolate;
	pointer-events: auto;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	max-height: 90vh !important;
}

#mtpc-banner-root .mtpc-banner--bottom,
.mtpc-banner--bottom {
	bottom: 0 !important;
	top: auto !important;
}

#mtpc-banner-root .mtpc-banner--top,
.mtpc-banner--top {
	top: 0 !important;
	bottom: auto !important;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
	animation: mtpc-slide-down 0.35s ease;
}

#mtpc-banner-root .mtpc-banner--bottom-left,
.mtpc-banner--bottom-left {
	bottom: 1rem !important;
	left: 1rem !important;
	right: auto !important;
	width: auto !important;
	max-width: min(400px, calc(100% - 2rem)) !important;
	border-radius: 8px;
	flex-direction: column !important;
	align-items: stretch !important;
}

#mtpc-banner-root .mtpc-banner--bottom-right,
.mtpc-banner--bottom-right {
	bottom: 1rem !important;
	right: 1rem !important;
	left: auto !important;
	width: auto !important;
	max-width: min(400px, calc(100% - 2rem)) !important;
	border-radius: 8px;
	flex-direction: column !important;
	align-items: stretch !important;
}

.mtpc-banner--box,
.mtpc-banner--cloud {
	border-radius: 10px;
}

#mtpc-banner-root .mtpc-banner__content,
.mtpc-banner__content {
	flex: 1 1 220px !important;
	min-width: 0 !important;
	max-width: 100% !important;
	width: auto !important;
	overflow-wrap: anywhere !important;
	word-wrap: break-word !important;
	word-break: break-word !important;
	white-space: normal !important;
}

#mtpc-banner-root .mtpc-banner__title,
.mtpc-banner__title {
	margin: 0 0 0.35em !important;
	font-size: 1.1em !important;
	font-weight: 600 !important;
	max-width: 100% !important;
	min-width: 0 !important;
	overflow-wrap: anywhere !important;
	word-wrap: break-word !important;
	word-break: break-word !important;
	white-space: normal !important;
}

#mtpc-banner-root .mtpc-banner__text,
.mtpc-banner__text {
	margin: 0 !important;
	opacity: 0.92;
	max-width: 100% !important;
	min-width: 0 !important;
	overflow-wrap: anywhere !important;
	word-wrap: break-word !important;
	word-break: break-word !important;
	white-space: normal !important;
}

#mtpc-banner-root .mtpc-banner__actions,
.mtpc-banner__actions {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 0.5rem !important;
	flex: 0 1 auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	width: auto !important;
}

#mtpc-banner-root .mtpc-banner .mtpc-btn,
#mtpc-banner-root .mtpc-banner__actions .mtpc-btn,
.mtpc-banner .mtpc-btn,
.mtpc-banner__actions .mtpc-btn {
	appearance: none !important;
	border: none !important;
	border-radius: 6px !important;
	padding: 0.55em 1.1em !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	color: #fff !important;
	transition: opacity 0.15s, transform 0.1s;
	white-space: normal !important;
	text-align: center !important;
	max-width: 100% !important;
	min-width: 0 !important;
	width: auto !important;
	box-sizing: border-box !important;
	line-height: 1.3 !important;
	flex: 0 1 auto !important;
}

.mtpc-btn:hover {
	opacity: 0.9;
}

.mtpc-btn:active {
	transform: scale(0.98);
}

.mtpc-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Tablet: compact column + 2+1 button grid */
@media screen and (max-width: 768px) {
	#mtpc-banner-root .mtpc-banner,
	.mtpc-banner-root .mtpc-banner,
	.mtpc-banner {
		flex-direction: column !important;
		align-items: stretch !important;
		justify-content: flex-start !important;
		padding: 0.75rem 0.9rem !important;
		gap: 0.5rem !important;
		left: 0 !important;
		right: 0 !important;
		width: auto !important;
		z-index: 2147483647 !important;
	}

	#mtpc-banner-root .mtpc-banner__content,
	.mtpc-banner__content {
		flex: 0 0 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		overflow-wrap: anywhere !important;
		word-break: normal !important;
		white-space: normal !important;
	}

	#mtpc-banner-root .mtpc-banner__title,
	.mtpc-banner__title {
		font-size: 14px !important;
		line-height: 1.25 !important;
		margin: 0 0 0.25em !important;
	}

	#mtpc-banner-root .mtpc-banner__text,
	.mtpc-banner__text {
		font-size: 11px !important;
		line-height: 1.4 !important;
	}

	#mtpc-banner-root .mtpc-banner__actions,
	.mtpc-banner__actions {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
		gap: 6px !important;
		width: 100% !important;
		max-width: 100% !important;
		flex: 0 0 auto !important;
		flex-direction: unset !important;
		align-items: stretch !important;
	}

	#mtpc-banner-root .mtpc-banner__actions .mtpc-btn,
	.mtpc-banner__actions .mtpc-btn {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		min-height: 38px !important;
		height: auto !important;
		flex: unset !important;
		padding: 8px 10px !important;
		font-size: 12px !important;
		line-height: 1.2 !important;
		white-space: normal !important;
	}

	#mtpc-banner-root .mtpc-banner__actions .mtpc-btn-manage,
	.mtpc-banner__actions .mtpc-btn-manage {
		grid-column: 1 / -1 !important;
	}

	#mtpc-banner-root .mtpc-banner--bottom-left,
	#mtpc-banner-root .mtpc-banner--bottom-right,
	.mtpc-banner--bottom-left,
	.mtpc-banner--bottom-right {
		left: 0.75rem !important;
		right: 0.75rem !important;
		width: auto !important;
		max-width: none !important;
	}
}

/* Mobile phones — compact banner */
@media screen and (max-width: 600px) {
	#mtpc-banner-root .mtpc-banner,
	.mtpc-banner-root .mtpc-banner,
	.mtpc-banner {
		flex-direction: column !important;
		align-items: stretch !important;
		padding: 0.65rem 0.75rem !important;
		gap: 0.45rem !important;
		left: 0 !important;
		right: 0 !important;
		z-index: 2147483647 !important;
	}

	#mtpc-banner-root .mtpc-banner__title,
	.mtpc-banner__title {
		font-size: 14px !important;
		line-height: 1.25 !important;
		margin: 0 0 0.2em !important;
	}

	#mtpc-banner-root .mtpc-banner__text,
	.mtpc-banner__text {
		font-size: 11px !important;
		line-height: 1.4 !important;
	}

	#mtpc-banner-root .mtpc-banner__actions,
	.mtpc-banner__actions {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
		gap: 6px !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	#mtpc-banner-root .mtpc-banner__actions .mtpc-btn,
	.mtpc-banner__actions .mtpc-btn {
		min-height: 38px !important;
		padding: 8px 10px !important;
		font-size: 12px !important;
		line-height: 1.2 !important;
	}

	#mtpc-banner-root .mtpc-banner__actions .mtpc-btn-manage,
	.mtpc-banner__actions .mtpc-btn-manage {
		grid-column: 1 / -1 !important;
	}

	#mtpc-banner-root .mtpc-banner--bottom-left,
	#mtpc-banner-root .mtpc-banner--bottom-right,
	.mtpc-banner--bottom-left,
	.mtpc-banner--bottom-right {
		left: 0.5rem !important;
		right: 0.5rem !important;
		bottom: 0.5rem !important;
		max-width: none !important;
	}
}

@media screen and (max-width: 480px) {
	#mtpc-reopen-btn.mtpc-reopen-floating,
	.mtpc-reopen-floating {
		left: 0.75rem !important;
		bottom: 0.75rem !important;
		right: auto !important;
		width: 40px !important;
		height: 40px !important;
		min-width: 40px !important;
		min-height: 40px !important;
		max-width: 40px !important;
	}

	#mtpc-reopen-btn.mtpc-reopen-floating .mtpc-reopen-icon,
	.mtpc-reopen-floating .mtpc-reopen-icon {
		width: 18px !important;
		height: 18px !important;
	}
}

/* Very small phones — still 2+1, slightly tighter */
@media screen and (max-width: 360px) {
	#mtpc-banner-root .mtpc-banner,
	.mtpc-banner {
		padding: 0.55rem 0.6rem !important;
		gap: 0.4rem !important;
	}

	#mtpc-banner-root .mtpc-banner__title,
	.mtpc-banner__title {
		font-size: 13px !important;
		line-height: 1.25 !important;
	}

	#mtpc-banner-root .mtpc-banner__text,
	.mtpc-banner__text {
		font-size: 10.5px !important;
		line-height: 1.4 !important;
	}

	#mtpc-banner-root .mtpc-banner__actions,
	.mtpc-banner__actions {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
		gap: 5px !important;
	}

	#mtpc-banner-root .mtpc-banner__actions .mtpc-btn,
	.mtpc-banner__actions .mtpc-btn {
		min-height: 36px !important;
		padding: 6px 6px !important;
		font-size: 11px !important;
		line-height: 1.2 !important;
	}

	#mtpc-banner-root .mtpc-banner__actions .mtpc-btn-manage,
	.mtpc-banner__actions .mtpc-btn-manage {
		grid-column: 1 / -1 !important;
	}
}

/* Shared buttons (preferences modal) */
.mtpc-btn {
	appearance: none;
	border: none;
	border-radius: 6px;
	padding: 0.55em 1.1em;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	color: #fff;
	transition: opacity 0.15s, transform 0.1s;
	box-sizing: border-box !important;
	max-width: 100%;
	min-width: 0;
}

/* Preferences modal — same top layer as banner */
.mtpc-prefs-overlay {
	position: fixed !important;
	inset: 0 !important;
	left: 0 !important;
	right: 0 !important;
	top: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	z-index: 2147483647 !important;
	animation: mtpc-fade-in 0.2s ease;
	transform: none !important;
	filter: none !important;
	perspective: none !important;
	isolation: isolate;
	pointer-events: auto;
}

.mtpc-prefs {
	background: #fff;
	color: #1e293b;
	border-radius: 10px;
	max-width: 520px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
	padding: 1.5rem;
}

.mtpc-prefs__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.mtpc-prefs__header h2 {
	margin: 0;
	font-size: 1.25em;
}

.mtpc-prefs__close {
	background: transparent;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #64748b;
	padding: 0.2em;
}

.mtpc-prefs__cat {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 0.85rem 1rem;
	margin-bottom: 0.65rem;
}

.mtpc-prefs__cat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.mtpc-prefs__cat-label {
	font-weight: 600;
	margin: 0;
}

.mtpc-prefs__cat-desc {
	margin: 0.35em 0 0;
	font-size: 13px;
	color: #64748b;
}

.mtpc-prefs__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
	justify-content: flex-end;
}

.mtpc-prefs .mtpc-btn {
	color: #fff;
}

.mtpc-prefs .mtpc-btn--secondary {
	background: #64748b;
}

/* Toggle in preferences */
.mtpc-toggle {
	position: relative;
	width: 42px;
	height: 24px;
	flex-shrink: 0;
}

.mtpc-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.mtpc-toggle__slider {
	position: absolute;
	inset: 0;
	background: #cbd5e1;
	border-radius: 24px;
	cursor: pointer;
	transition: 0.2s;
}

.mtpc-toggle__slider:before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: 0.2s;
}

.mtpc-toggle input:checked + .mtpc-toggle__slider {
	background: #22c55e;
}

.mtpc-toggle input:checked + .mtpc-toggle__slider:before {
	transform: translateX(18px);
}

.mtpc-toggle input:disabled + .mtpc-toggle__slider {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Floating reopen button — circular gear icon */
#mtpc-reopen-btn.mtpc-reopen-floating,
.mtpc-reopen-floating {
	position: fixed !important;
	bottom: 1rem !important;
	left: 1rem !important;
	right: auto !important;
	z-index: 2147483646 !important;
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	min-height: 42px !important;
	max-width: 42px !important;
	padding: 0 !important;
	margin: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #1e293b !important;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.12) !important;
	border-radius: 50% !important;
	font-size: 0 !important;
	line-height: 0 !important;
	cursor: pointer !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
	opacity: 0.92;
	transition: background-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease !important;
	transform: none !important;
	filter: none !important;
	pointer-events: auto;
	box-sizing: border-box !important;
	overflow: visible !important;
	white-space: nowrap !important;
	text-indent: 0 !important;
}

#mtpc-reopen-btn.mtpc-reopen-floating .mtpc-reopen-icon,
.mtpc-reopen-floating .mtpc-reopen-icon {
	display: block !important;
	width: 20px !important;
	height: 20px !important;
	pointer-events: none;
	flex-shrink: 0;
}

#mtpc-reopen-btn.mtpc-reopen-floating:hover,
.mtpc-reopen-floating:hover {
	opacity: 1;
	background: #334155 !important;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3) !important;
}

#mtpc-reopen-btn.mtpc-reopen-floating:focus-visible,
.mtpc-reopen-floating:focus-visible {
	outline: 2px solid #93c5fd !important;
	outline-offset: 3px !important;
}

/* Desktop tooltip via CSS (no layout shift) */
@media (hover: hover) and (pointer: fine) {
	#mtpc-reopen-btn.mtpc-reopen-floating[data-mtpc-tooltip]::after,
	.mtpc-reopen-floating[data-mtpc-tooltip]::after {
		content: attr(data-mtpc-tooltip);
		position: absolute;
		left: calc(100% + 10px);
		top: 50%;
		transform: translateY(-50%);
		background: #0f172a;
		color: #fff;
		font-size: 12px;
		font-weight: 500;
		line-height: 1.2;
		padding: 0.35em 0.65em;
		border-radius: 4px;
		white-space: nowrap;
		pointer-events: none;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.15s ease, visibility 0.15s ease;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
		z-index: 1;
	}

	#mtpc-reopen-btn.mtpc-reopen-floating[data-mtpc-tooltip]:hover::after,
	#mtpc-reopen-btn.mtpc-reopen-floating[data-mtpc-tooltip]:focus-visible::after,
	.mtpc-reopen-floating[data-mtpc-tooltip]:hover::after,
	.mtpc-reopen-floating[data-mtpc-tooltip]:focus-visible::after {
		opacity: 1;
		visibility: visible;
	}
}

#mtpc-reopen-btn.is-hidden,
#mtpc-reopen-btn[hidden],
.mtpc-reopen-floating.is-hidden,
.mtpc-reopen-floating[hidden],
body.mtpc-banner-open #mtpc-reopen-btn,
body.mtpc-banner-open .mtpc-reopen-floating,
body.mtpc-prefs-open #mtpc-reopen-btn,
body.mtpc-prefs-open .mtpc-reopen-floating {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
	opacity: 0 !important;
}

/* Preferences layer must cover page + Privacy Settings button */
body.mtpc-prefs-open .mtpc-preferences-root {
	z-index: 2147483647 !important;
	pointer-events: auto;
}


.mtpc-footer-links {
	text-align: center;
	padding: 0.75rem;
	font-size: 13px;
}

.mtpc-footer-links a {
	margin: 0 0.25em;
}

@keyframes mtpc-slide-up {
	from { transform: translateY(100%); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@keyframes mtpc-slide-down {
	from { transform: translateY(-100%); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@keyframes mtpc-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}




/* Blocked embed placeholders */
.mtpc-blocked-embed {
	background: #f1f5f9;
	border: 1px dashed #94a3b8;
	border-radius: 8px;
	padding: 1.5rem;
	text-align: center;
	margin: 1rem 0;
	color: #334155;
}
.mtpc-blocked-embed__title {
	margin: 0 0 0.35em;
	font-weight: 600;
}
.mtpc-blocked-embed__msg {
	margin: 0 0 0.75em;
	font-size: 0.95em;
	color: #64748b;
}
.mtpc-blocked-embed__btn {
	appearance: none;
	border: none;
	background: #3b82f6;
	color: #fff;
	border-radius: 6px;
	padding: 0.5em 1em;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.mtpc-blocked-embed__btn:hover {
	opacity: 0.9;
}
