/* ANKERHELD Cookie Consent – Frontend */
:root {
	--ahc-primary: #1f4e79;
	--ahc-primary-text: #fff;
	--ahc-bg: #fff;
	--ahc-text: #1f2933;
	--ahc-muted: #5f6b7a;
	--ahc-radius: 10px;
	--ahc-font-size: 15px;
	--ahc-line: rgba(127, 127, 127, .22);
	--ahc-soft: rgba(127, 127, 127, .08);
}

/* ---------- Grundgerüst ---------- */
#ahc-root[hidden], #ahc-root [hidden], .ahc-widget[hidden] { display: none !important; }

#ahc-root {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	pointer-events: none;
	font-size: var(--ahc-font-size);
	line-height: 1.55;
	color: var(--ahc-text);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
html.ahc-open body { overflow: hidden; }
html.ahc-open:has(#ahc-root:not(.ahc--backdrop)) body { overflow: auto; }

#ahc-root *, #ahc-root *::before, #ahc-root *::after { box-sizing: border-box; }
#ahc-root p { margin: 0 0 .75em; padding: 0; font-size: 1em; line-height: inherit; color: inherit; }
#ahc-root a { color: var(--ahc-primary); text-decoration: underline; text-underline-offset: 2px; }
#ahc-root ul { margin: 0; padding: 0; list-style: none; }
#ahc-root code { font-size: .9em; background: var(--ahc-soft); padding: 1px 5px; border-radius: 4px; color: inherit; }

.ahc-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 16, 24, .55);
	backdrop-filter: blur(2px);
	pointer-events: auto;
	display: none;
}
.ahc--backdrop .ahc-backdrop { display: block; }

.ahc-dialog {
	position: relative;
	pointer-events: auto;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--ahc-bg);
	color: var(--ahc-text);
	border-radius: var(--ahc-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25), 0 2px 8px rgba(0, 0, 0, .08);
	padding: 28px 30px 22px;
	font-family: inherit;
	animation: ahc-in .25s ease-out;
}
.ahc-dialog:focus { outline: none; }
.ahc--details .ahc-dialog { max-width: 760px; }

@keyframes ahc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ahc-dialog { animation: none; } }

/* Layouts */
#ahc-root.ahc--box-left { justify-content: flex-start; align-items: flex-end; }
#ahc-root.ahc--box-right { justify-content: flex-end; align-items: flex-end; }
.ahc--box-left .ahc-dialog, .ahc--box-right .ahc-dialog { max-width: 440px; padding: 22px 22px 16px; }
.ahc--box-left.ahc--details .ahc-dialog, .ahc--box-right.ahc--details .ahc-dialog { max-width: 640px; }
#ahc-root.ahc--bar { align-items: flex-end; padding: 0; }
.ahc--bar .ahc-dialog { max-width: none; border-radius: var(--ahc-radius) var(--ahc-radius) 0 0; max-height: 85vh; }
.ahc--bar .ahc-layer--main { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; column-gap: 40px; align-items: start; align-content: center; }
.ahc--bar .ahc-layer--main > * { grid-column: 1; }
.ahc--bar .ahc-layer--main > .ahc-buttons { grid-column: 2; grid-row: 1 / span 6; flex-direction: column; align-self: center; min-width: 250px; margin: 0; }
.ahc--bar .ahc-layer--main > .ahc-buttons .ahc-btn { flex: 0 0 auto; }
.ahc--bar.ahc--details .ahc-dialog { max-width: 760px; margin: 0 auto; border-radius: var(--ahc-radius) var(--ahc-radius) 0 0; }

/* ---------- Inhalte ---------- */
.ahc-logo { display: block; height: 40px; width: auto; max-width: 180px; margin: 0 0 14px; }
#ahc-root .ahc-title { font-size: 1.35em; font-weight: 700; line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
#ahc-root .ahc-small { font-size: .88em; color: var(--ahc-muted); }
#ahc-root .ahc-body p:last-child { margin-bottom: .5em; }

.ahc-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 4px !important; }
.ahc-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .95em; margin: 0; }
.ahc-check input {
	appearance: none; -webkit-appearance: none;
	width: 20px; height: 20px; margin: 0; flex: 0 0 20px;
	border: 2px solid var(--ahc-muted); border-radius: 5px; background: var(--ahc-bg);
	display: inline-grid; place-content: center; cursor: pointer; position: static;
}
.ahc-check input::before {
	content: ""; width: 10px; height: 6px; border: solid var(--ahc-primary-text); border-width: 0 0 2.5px 2.5px;
	transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .12s;
}
.ahc-check input:checked { background: var(--ahc-primary); border-color: var(--ahc-primary); }
.ahc-check input:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.ahc-check input:indeterminate { background: var(--ahc-primary); border-color: var(--ahc-primary); }
.ahc-check input:indeterminate::before { border-width: 0 0 2.5px 0; transform: none; height: 0; }
.ahc-check input:disabled { opacity: .55; cursor: not-allowed; }
.ahc-check input:focus-visible { outline: 3px solid var(--ahc-primary); outline-offset: 2px; }

/* Buttons */
.ahc-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 10px; }
.ahc-buttons .ahc-btn { flex: 1 1 160px; }
#ahc-root .ahc-btn, .ahc-blocker .ahc-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 46px; padding: 10px 18px; margin: 0;
	font: inherit; font-size: .97em; font-weight: 600; line-height: 1.2; letter-spacing: normal; text-transform: none; text-align: center;
	border-radius: calc(var(--ahc-radius) * .7); border: 2px solid var(--ahc-primary);
	background: var(--ahc-primary); color: var(--ahc-primary-text);
	cursor: pointer; box-shadow: none; text-decoration: none; transition: filter .15s, background .15s;
	width: auto; height: auto;
}
#ahc-root .ahc-btn:hover, .ahc-blocker .ahc-btn:hover { filter: brightness(1.1); }
#ahc-root .ahc-btn:focus-visible, .ahc-blocker .ahc-btn:focus-visible { outline: 3px solid var(--ahc-primary); outline-offset: 2px; }
#ahc-root .ahc-btn--outline { background: transparent; color: var(--ahc-primary); }
#ahc-root .ahc-btn--outline:hover { background: var(--ahc-soft); filter: none; }
#ahc-root .ahc-btn--ghost { background: var(--ahc-soft); border-color: transparent; color: var(--ahc-text); }

/* Links-Zeile */
#ahc-root .ahc-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 4px 0 0; font-size: .88em; }
#ahc-root .ahc-links a { color: var(--ahc-muted); }
#ahc-root .ahc-linkbtn {
	background: none; border: 0; padding: 0; margin: 0; box-shadow: none; min-height: 0;
	font: inherit; font-weight: 600; color: var(--ahc-primary); text-decoration: underline; text-underline-offset: 2px;
	cursor: pointer; text-transform: none; letter-spacing: normal; width: auto; height: auto;
}

/* ---------- Ebene 2 ---------- */
.ahc-details-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
#ahc-root .ahc-details-head .ahc-title { margin: 0; }
#ahc-root .ahc-back {
	display: inline-grid; place-content: center; width: 36px; height: 36px; flex: 0 0 36px; padding: 0; margin: 0;
	border-radius: 50%; border: 1px solid var(--ahc-line); background: transparent; color: var(--ahc-text); cursor: pointer; box-shadow: none; min-height: 0;
}
#ahc-root .ahc-back:hover { background: var(--ahc-soft); }

.ahc-group { border: 1px solid var(--ahc-line); border-radius: calc(var(--ahc-radius) * .8); padding: 14px 16px 12px; margin: 0 0 12px; }
.ahc-group__head, .ahc-service__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#ahc-root .ahc-group__title { font-weight: 700; font-size: 1.05em; margin: 0; }
#ahc-root .ahc-service__title { font-weight: 600; margin: 0; }
.ahc-count { color: var(--ahc-muted); font-weight: 400; }
#ahc-root .ahc-group__desc { color: var(--ahc-muted); font-size: .92em; margin: 6px 0 6px; }
#ahc-root .ahc-toggle { font-size: .88em; }
.ahc-services { margin-top: 10px; }
.ahc-service { background: var(--ahc-soft); border-radius: calc(var(--ahc-radius) * .6); padding: 12px 14px; margin-top: 8px; }

/* Schalter */
.ahc-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; margin: 0; }
.ahc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ahc-switch__ui {
	width: 44px; height: 24px; border-radius: 24px; background: #b8c0cc; position: relative; transition: background .15s;
}
.ahc-switch__ui::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
	background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s;
}
.ahc-switch input:checked + .ahc-switch__ui { background: var(--ahc-primary); }
.ahc-switch input:checked + .ahc-switch__ui::after { transform: translateX(20px); }
.ahc-switch input:indeterminate + .ahc-switch__ui { background: color-mix(in srgb, var(--ahc-primary) 45%, #b8c0cc); }
.ahc-switch input:indeterminate + .ahc-switch__ui::after { transform: translateX(10px); }
.ahc-switch input:disabled + .ahc-switch__ui { opacity: .55; cursor: not-allowed; }
.ahc-switch input:focus-visible + .ahc-switch__ui { outline: 3px solid var(--ahc-primary); outline-offset: 2px; }
.ahc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tabellen (Banner + Shortcode) */
.ahc-table { width: 100%; border-collapse: collapse; margin: 8px 0 0; font-size: .88em; border: 0; }
.ahc-table th, .ahc-table td { text-align: left; vertical-align: top; padding: 6px 8px 6px 0; border: 0; border-top: 1px solid var(--ahc-line); background: none; }
.ahc-table th { width: 32%; font-weight: 600; color: var(--ahc-muted); }
.ahc-table td { word-break: break-word; }
.ahc-cookie-list { margin: 0; padding: 0; list-style: none; }
.ahc-cookie-list li { margin: 0 0 4px; }
.ahc-muted { color: var(--ahc-muted); }
#ahc-root .ahc-uid { font-size: .82em; color: var(--ahc-muted); margin-top: 6px; }
.ahc-cookie-overview__service { margin-bottom: 1.4em; }
.ahc-history__table th { width: auto; }

/* ---------- Widget ---------- */
.ahc-widget {
	position: fixed; bottom: 16px; z-index: 2147482999;
	width: 48px; height: 48px; padding: 0; margin: 0; border-radius: 50%;
	display: grid; place-content: center;
	background: var(--ahc-primary); color: var(--ahc-primary-text);
	border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer;
	transition: transform .15s; min-height: 0;
}
.ahc-widget:hover { transform: scale(1.06); }
.ahc-widget:focus-visible { outline: 3px solid var(--ahc-primary); outline-offset: 3px; }
.ahc-widget--left { left: 16px; }
.ahc-widget--right { right: 16px; }

/* ---------- Content-Blocker ---------- */
.ahc-blocker {
	position: relative; display: flex; align-items: center; justify-content: center;
	width: 100%; min-height: 220px; overflow: hidden;
	background: #1d2733; color: #fff; border-radius: 6px;
	font-size: 15px; line-height: 1.5; text-align: center; margin: 0 auto;
}
.ahc-blocker__bg {
	position: absolute; inset: 0; background-size: cover; background-position: center;
	filter: blur(3px) brightness(.45); transform: scale(1.05);
}
.ahc-blocker__box { position: relative; max-width: 520px; padding: 22px; }
.ahc-blocker p { margin: 0 0 .7em; color: #fff; }
.ahc-blocker .ahc-blocker__title { font-weight: 700; font-size: 1.12em; }
.ahc-blocker .ahc-blocker__text { font-size: .9em; opacity: .92; }
.ahc-blocker a { color: #fff; text-decoration: underline; }
.ahc-blocker .ahc-btn { border-color: var(--ahc-primary); }
.ahc-blocker__always { display: flex; justify-content: center; margin-top: 12px; font-weight: 400; font-size: .85em; color: #fff; }
.ahc-blocker .ahc-check input { border-color: #fff; background: transparent; }
.ahc-blocker .ahc-check input:checked { background: var(--ahc-primary); border-color: var(--ahc-primary); }
/* Gutenberg-Embeds mit festem Seitenverhältnis */
.wp-has-aspect-ratio .wp-block-embed__wrapper > .ahc-blocker { position: absolute; inset: 0; max-width: none !important; aspect-ratio: auto !important; min-height: 0; }

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
	#ahc-root, #ahc-root.ahc--box-left, #ahc-root.ahc--box-right { padding: 0; align-items: flex-end; justify-content: center; }
	.ahc-dialog, .ahc--box-left .ahc-dialog, .ahc--box-right .ahc-dialog {
		max-width: none !important; border-radius: var(--ahc-radius) var(--ahc-radius) 0 0;
		padding: 20px 18px 14px; max-height: 92vh; max-height: 92dvh;
	}
	.ahc--bar .ahc-layer--main { display: block; }
	.ahc-buttons { flex-direction: column; }
	.ahc-buttons .ahc-btn { flex: 1 1 auto; width: 100%; }
	.ahc-table th { width: 38%; }
	.ahc-blocker { min-height: 260px; }
}

/* Buttons in der Detail-Ansicht immer sichtbar */
.ahc-layer--details > .ahc-buttons {
	position: sticky; bottom: -22px; z-index: 2;
	margin: 14px -30px 0; padding: 14px 30px 22px;
	background: var(--ahc-bg);
	box-shadow: 0 -8px 16px -10px rgba(0, 0, 0, .18);
}
.ahc--box-left .ahc-layer--details > .ahc-buttons, .ahc--box-right .ahc-layer--details > .ahc-buttons { bottom: -16px; margin: 14px -22px 0; padding: 12px 22px 16px; }
.ahc-layer--details > .ahc-links { margin-top: 0; }
@media (max-width: 600px) {
	#ahc-root { font-size: calc(var(--ahc-font-size) - 1px); }
	.ahc-layer--details > .ahc-buttons { bottom: -14px; margin: 12px -18px 0; padding: 12px 18px 14px; gap: 8px; }
	.ahc-layer--details > .ahc-buttons .ahc-btn { min-height: 42px; }
}
