/* Erkensten Cookie Consent – kompakt, tillgänglig, ljus/mörk, responsiv. */

#ecc-root { position: relative; z-index: 2147483000; }
#ecc-root[hidden], .ecc-banner[hidden], .ecc-modal[hidden] { display: none !important; }

/* ---- Banner (bottenbar) ---- */
.ecc-banner {
	position: fixed;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	max-width: 720px;
	margin: 0 auto;
	background: #ffffff;
	color: #1a1a1a;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.18 );
	padding: 1rem 1.25rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	align-items: center;
	justify-content: space-between;
	font-size: 0.9rem;
	line-height: 1.45;
}
.ecc-banner__text { flex: 1 1 320px; min-width: 240px; }
.ecc-banner__text strong { display: block; font-size: 1rem; margin-bottom: 0.15rem; }
.ecc-banner__text p { margin: 0; }
.ecc-banner__text a { color: inherit; text-decoration: underline; }
.ecc-banner__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ---- Knappar: lika tydlighet på Acceptera/Neka (IMY-krav) ---- */
.ecc-btn {
	font: inherit;
	cursor: pointer;
	border-radius: 8px;
	padding: 0.55rem 1.1rem;
	border: 1px solid transparent;
	line-height: 1.2;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.ecc-btn--primary { background: #1a5fb4; color: #fff; }
.ecc-btn--primary:hover { background: #14488a; }
/* Neka har samma vikt/storlek som Acceptera – bara annan färg. */
.ecc-btn--secondary { background: #eef1f5; color: #1a1a1a; border-color: #d7dde5; }
.ecc-btn--secondary:hover { background: #e2e7ee; }
.ecc-btn--ghost { background: transparent; color: inherit; border-color: transparent; text-decoration: underline; padding-left: 0.6rem; padding-right: 0.6rem; }
.ecc-btn:focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }

/* ---- Modal ---- */
.ecc-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.ecc-modal__overlay { position: absolute; inset: 0; background: rgba( 0, 0, 0, 0.5 ); }
.ecc-modal__box {
	position: relative;
	background: #fff;
	color: #1a1a1a;
	border-radius: 14px;
	max-width: 560px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	padding: 1.5rem;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
}
.ecc-modal__box h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.ecc-modal__intro { margin: 0 0 1rem; font-size: 0.9rem; }
.ecc-cats { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.ecc-cat { display: block; border: 1px solid #e2e2e2; border-radius: 10px; padding: 0.75rem 0.9rem; }
.ecc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ecc-cat__name { font-weight: 600; }
.ecc-cat__always { font-size: 0.8rem; color: #666; }
.ecc-cat__desc { display: block; margin-top: 0.35rem; font-size: 0.85rem; color: #444; }
.ecc-cat input[ type="checkbox" ] { width: 1.15rem; height: 1.15rem; }
.ecc-modal__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.ecc-modal__policy { margin: 0.9rem 0 0; font-size: 0.85rem; }
.ecc-modal__policy a { color: inherit; }

/* ---- Flytande återkalla-knapp ---- */
.ecc-float {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: #1a5fb4;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 0.5rem 0.9rem;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.25 );
	z-index: 2147482000;
}
.ecc-float:hover { background: #14488a; }
.ecc-float:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---- Transparens-tabell ([cookie-policy]) ---- */
.ecc-policy__table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.5rem; font-size: 0.9rem; }
.ecc-policy__table th, .ecc-policy__table td { border: 1px solid #e2e2e2; padding: 0.5rem 0.6rem; text-align: left; vertical-align: top; }
.ecc-policy__table code { font-size: 0.85em; }

/* ---- Mörkt läge ---- */
@media ( prefers-color-scheme: dark ) {
	.ecc-banner, .ecc-modal__box { background: #1e2126; color: #f2f2f2; border-color: #333a42; }
	.ecc-banner__text a { color: #9ec1ff; }
	.ecc-btn--secondary { background: #2b3038; color: #f2f2f2; border-color: #3a424c; }
	.ecc-btn--secondary:hover { background: #333a44; }
	.ecc-cat { border-color: #333a42; }
	.ecc-cat__always { color: #a5adb8; }
	.ecc-cat__desc { color: #c4ccd6; }
	.ecc-policy__table th, .ecc-policy__table td { border-color: #333a42; }
}

/* ---- Små skärmar: knappar på egen rad, full bredd ---- */
@media ( max-width: 560px ) {
	.ecc-banner { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; padding: 1rem; }
	.ecc-banner__actions { width: 100%; }
	.ecc-banner__actions .ecc-btn { flex: 1 1 auto; text-align: center; }
	.ecc-float .ecc-float__label { display: none; }
}
