/**
 * MM Cookie Consent — styles. Scoped under #mmcc-root / .mmcc-* to avoid theme clashes.
 * Colours use CSS variables so each project can rebrand with a single override.
 */
#mmcc-root,
#mmcc-reopen {
	--mmcc-accent: #057a3b;
	--mmcc-accent-ink: #ffffff;
	--mmcc-ink: #1d2327;
	--mmcc-muted: #5b6770;
	--mmcc-bg: #ffffff;
	--mmcc-line: #e4e7ea;
	--mmcc-radius: 14px;
	--mmcc-shadow: 0 12px 40px rgba(0, 0, 0, .18);
	font-family: inherit;
	box-sizing: border-box;
}
#mmcc-root *,
#mmcc-root *::before,
#mmcc-root *::after { box-sizing: border-box; }

.mmcc-hidden { display: none !important; }

/* ---------- banner ---------- */
.mmcc-banner {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 2147483000;
	width: min(420px, calc(100vw - 40px));
	background: var(--mmcc-bg);
	color: var(--mmcc-ink);
	border: 1px solid var(--mmcc-line);
	border-radius: var(--mmcc-radius);
	box-shadow: var(--mmcc-shadow);
	padding: 20px;
	animation: mmcc-in .25s ease;
}
@keyframes mmcc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- banner position variants (Settings → Cookie Consent) ---------- */
.mmcc-banner--right { left: auto; right: 20px; }
.mmcc-banner--bar {
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: none;
	border-radius: var(--mmcc-radius) var(--mmcc-radius) 0 0;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 16px 24px;
}
.mmcc-banner--bar .mmcc-banner__body { flex: 1 1 auto; }
.mmcc-banner--bar .mmcc-banner__actions { margin-top: 0; flex: none; flex-wrap: nowrap; }
.mmcc-reopen--right { left: auto; right: 16px; }
@media (max-width: 720px) {
	.mmcc-banner--bar { flex-direction: column; align-items: stretch; gap: 12px; }
	.mmcc-banner--bar .mmcc-banner__actions { flex-wrap: wrap; }
}

.mmcc-banner__title { font-size: 16px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.mmcc-banner__text { font-size: 13.5px; line-height: 1.55; color: var(--mmcc-muted); margin: 0; }
.mmcc-link { color: var(--mmcc-accent); text-decoration: underline; font-weight: 600; }
.mmcc-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- buttons ---------- */
.mmcc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 9px;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	line-height: 1;
	transition: background .15s, border-color .15s, color .15s;
}
.mmcc-btn--primary { background: var(--mmcc-accent); color: var(--mmcc-accent-ink); flex: 1 1 auto; }
.mmcc-btn--primary:hover { filter: brightness(.94); }
.mmcc-btn--ghost { background: transparent; color: var(--mmcc-ink); border-color: var(--mmcc-line); }
.mmcc-btn--ghost:hover { border-color: var(--mmcc-accent); color: var(--mmcc-accent); }

/* ---------- preferences modal ---------- */
.mmcc-prefs {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 2147483000;
	width: min(560px, calc(100vw - 32px));
	max-height: min(80vh, 640px);
	overflow: auto;
	background: var(--mmcc-bg);
	color: var(--mmcc-ink);
	border-radius: var(--mmcc-radius);
	box-shadow: var(--mmcc-shadow);
}
#mmcc-root:has(.mmcc-prefs:not([hidden]))::before,
.mmcc-prefs:not([hidden]) { }
.mmcc-prefs__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 20px; border-bottom: 1px solid var(--mmcc-line);
	position: sticky; top: 0; background: var(--mmcc-bg);
}
.mmcc-prefs__title { font-size: 16px; font-weight: 700; margin: 0; }
.mmcc-prefs__close {
	background: none; border: none; font-size: 26px; line-height: 1;
	cursor: pointer; color: var(--mmcc-muted); padding: 0 4px;
}
.mmcc-prefs__list { padding: 8px 20px 4px; }
.mmcc-prefs__actions {
	display: flex; gap: 10px; padding: 16px 20px 20px;
	position: sticky; bottom: 0; background: var(--mmcc-bg); border-top: 1px solid var(--mmcc-line);
}
.mmcc-prefs__actions .mmcc-btn { flex: 1 1 auto; }

/* ---------- category rows ---------- */
.mmcc-cat { padding: 14px 0; border-bottom: 1px solid var(--mmcc-line); }
.mmcc-cat:last-child { border-bottom: none; }
.mmcc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mmcc-cat__name { font-size: 14px; font-weight: 700; }
.mmcc-cat__always { font-size: 12px; font-weight: 600; color: var(--mmcc-accent); }
.mmcc-cat__desc { font-size: 12.5px; line-height: 1.5; color: var(--mmcc-muted); margin: 6px 0 0; }

/* ---------- switch ---------- */
.mmcc-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.mmcc-switch input { opacity: 0; width: 0; height: 0; }
.mmcc-switch__slider {
	position: absolute; inset: 0; cursor: pointer;
	background: #c7ccd1; border-radius: 999px; transition: background .2s;
}
.mmcc-switch__slider::before {
	content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
	background: #fff; border-radius: 50%; transition: transform .2s;
}
.mmcc-switch input:checked + .mmcc-switch__slider { background: var(--mmcc-accent); }
.mmcc-switch input:checked + .mmcc-switch__slider::before { transform: translateX(18px); }
.mmcc-switch input:focus-visible + .mmcc-switch__slider { outline: 2px solid var(--mmcc-accent); outline-offset: 2px; }

/* ---------- reopen floating button ---------- */
.mmcc-reopen {
	position: fixed; left: 16px; bottom: 16px; z-index: 2147482000;
	width: 42px; height: 42px; border-radius: 50%;
	background: var(--mmcc-bg); color: var(--mmcc-accent);
	border: 1px solid var(--mmcc-line); box-shadow: 0 4px 14px rgba(0,0,0,.14);
	cursor: pointer; display: flex; align-items: center; justify-content: center;
	transition: transform .15s;
}
.mmcc-reopen:hover { transform: scale(1.06); }

@media (max-width: 480px) {
	.mmcc-banner { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 16px; }
	.mmcc-banner__actions .mmcc-btn { flex: 1 1 100%; }
}
