/* ambitive Consent – Frontend · https://ambitive.de */

.ac {
	--ac-bg: #fff;
	--ac-text: #14120c;
	--ac-accent: #4a7300;
	--ac-radius: 12px;
	--ac-font-size: 15px;
	--ac-accept-bg: #14120c;
	--ac-accept-text: #fff;
	--ac-reject-bg: #14120c;
	--ac-reject-text: #fff;
	--ac-custom-bg: #fff;
	--ac-custom-text: #14120c;
	--ac-overlay: #000;
	--ac-overlay-opacity: .4;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	font-size: var(--ac-font-size);
	line-height: 1.55;
	font-family: inherit;
}
.ac[hidden], .ac [hidden], .ac-fab[hidden] { display: none !important; }
.ac *, .ac *::before, .ac *::after { box-sizing: border-box; }

/* Blocked iframes stay invisible until consent – the placeholder sits in front of them. */
iframe[data-ambitive-category], iframe[data-ambitive-service] { display: none !important; }

/* ── Overlay ── */
.ac-overlay {
	position: absolute; inset: 0;
	background: var(--ac-overlay);
	opacity: 0;
	transition: opacity .3s ease;
	pointer-events: auto;
}
.ac--visible .ac-overlay { opacity: var(--ac-overlay-opacity); }
/* Page is not usable until a choice is made */
html.ac-locked, html.ac-locked body { overflow: hidden !important; }

/* ── Dialog ── */
.ac-dialog {
	position: absolute;
	pointer-events: auto;
	background: var(--ac-bg);
	color: var(--ac-text);
	box-shadow: 0 -4px 32px rgba(20, 18, 12, .14), 0 0 0 1px rgba(20, 18, 12, .06);
	max-height: 90vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	opacity: 0;
	transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s ease;
	outline: none;
}
.ac--visible .ac-dialog { opacity: 1; }
.ac-inner { max-width: 1200px; margin: 0 auto; padding: 22px 28px; }

.ac--bar-bottom .ac-dialog { left: 0; right: 0; bottom: 0; border-radius: var(--ac-radius) var(--ac-radius) 0 0; transform: translateY(100%); }
.ac--bar-top .ac-dialog    { left: 0; right: 0; top: 0; border-radius: 0 0 var(--ac-radius) var(--ac-radius); transform: translateY(-100%); }
.ac--bar-bottom.ac--visible .ac-dialog, .ac--bar-top.ac--visible .ac-dialog { transform: none; }

.ac--box-left .ac-dialog, .ac--box-right .ac-dialog {
	bottom: 24px; width: min(420px, calc(100vw - 48px));
	border-radius: var(--ac-radius); transform: translateY(20px);
}
.ac--box-left .ac-dialog  { left: 24px; }
.ac--box-right .ac-dialog { right: 24px; }
.ac--box-left.ac--visible .ac-dialog, .ac--box-right.ac--visible .ac-dialog { transform: none; }

.ac--modal .ac-dialog {
	top: 50%; left: 50%; width: min(640px, 94vw); max-height: 86vh;
	border-radius: var(--ac-radius); transform: translate(-50%, -46%);
}
.ac--modal.ac--visible .ac-dialog { transform: translate(-50%, -50%); }
.ac--modal .ac-inner { padding: 32px; }

/* Main view: text left, buttons right in bars; stacked in boxes/modal */
.ac-view--main { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.ac--box-left .ac-view--main, .ac--box-right .ac-view--main, .ac--modal .ac-view--main { grid-template-columns: 1fr; gap: 18px; }

/* ── Content ── */
.ac .ac-title { font-size: calc(var(--ac-font-size) + 3px); font-weight: 700; line-height: 1.3; margin: 0 0 8px; color: inherit; letter-spacing: -.01em; }
.ac-text { margin: 0 0 12px; opacity: .85; }
.ac-text a, .ac-links a, .ac-back, .ac-branding { color: var(--ac-accent); }
.ac-links { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.ac-links a { text-decoration: underline; text-underline-offset: 2px; }

/* ── Buttons ── */
.ac-actions { display: flex; flex-direction: column; gap: 8px; min-width: 210px; }
.ac-actions--detail { flex-direction: row; flex-wrap: wrap; margin: 20px 0 16px; min-width: 0; }
.ac-actions--detail .ac-btn { flex: 1 1 180px; }
.ac .ac-btn {
	font: inherit; font-weight: 600; line-height: 1.2;
	padding: 12px 20px; margin: 0;
	border: 1px solid transparent; border-radius: max(0px, calc(var(--ac-radius) - 4px));
	cursor: pointer; text-align: center; white-space: nowrap;
	transition: opacity .15s, transform .1s;
}
.ac .ac-btn:hover { opacity: .88; }
.ac .ac-btn:active { transform: translateY(1px); }
.ac .ac-btn:focus-visible, .ac-back:focus-visible, .ac-fab:focus-visible, .ac a:focus-visible,
.ac-toggle input:focus-visible + .ac-slider { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
.ac .ac-btn--accept { background: var(--ac-accept-bg); color: var(--ac-accept-text); }
.ac .ac-btn--reject { background: var(--ac-reject-bg); color: var(--ac-reject-text); }
.ac .ac-btn--custom { background: var(--ac-custom-bg); color: var(--ac-custom-text); border-color: rgba(20, 18, 12, .2); }

/* ── Detail ── */
.ac-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.ac-detail-head .ac-title { margin: 0; }
.ac .ac-back { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }

.ac-categories { display: flex; flex-direction: column; gap: 10px; }
.ac-category {
	padding: 14px 16px; border: 1px solid rgba(20, 18, 12, .1);
	border-radius: max(0px, calc(var(--ac-radius) - 4px)); background: rgba(20, 18, 12, .02);
}
.ac-category-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

/* ── Services ── */
.ac details > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--ac-accent); }
.ac details > summary::-webkit-details-marker { display: none; }
.ac details > summary::before { content: '▸'; display: inline-block; width: 1em; transition: transform .15s; }
.ac details[open] > summary::before { transform: rotate(90deg); }
.ac details > summary:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
.ac-services { margin-top: 10px; }
.ac-service { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--ac-bg); border: 1px solid rgba(20, 18, 12, .08); }
.ac-service-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ac-service-name { font-weight: 600; font-size: 14px; cursor: pointer; }
.ac-service-provider { display: block; font-weight: 400; font-size: 12px; opacity: .65; }
.ac-service-info { margin-top: 6px; }
.ac-service-info > summary { font-size: 12px; }
.ac-service-info dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 12px; line-height: 1.45; }
.ac-service-info dt { font-weight: 600; opacity: .8; }
.ac-service-info dd { margin: 0; overflow-wrap: anywhere; }
.ac-cookies { margin: 0; padding: 0; list-style: none; }
.ac-cookies code { font-size: 11px; background: rgba(20, 18, 12, .06); padding: 0 4px; border-radius: 3px; color: inherit; }
.ac-toggle input:indeterminate + .ac-slider { background: var(--ac-accent); opacity: .55; }
.ac-toggle input:indeterminate + .ac-slider::after { transform: translateX(10px); }
.ac-category-info { flex: 1; min-width: 0; }
.ac-category-name { display: block; font-weight: 700; margin-bottom: 4px; cursor: pointer; }
.ac-category-desc { margin: 0; font-size: 13px; opacity: .72; line-height: 1.5; }

/* ── Toggle ── */
.ac-toggle { position: relative; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ac-toggle input { position: absolute; inset: 0; width: 44px; height: 24px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.ac-slider { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #c9c6bd; transition: background .2s; flex-shrink: 0; }
.ac-slider::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, .2); transition: transform .2s;
}
.ac-toggle input:checked + .ac-slider { background: var(--ac-accent); }
.ac-toggle input:checked + .ac-slider::after { transform: translateX(20px); }
.ac-toggle--locked { opacity: .75; }
.ac-toggle--locked input { cursor: not-allowed; }
.ac-always { font-size: 11px; font-weight: 600; color: var(--ac-accent); white-space: nowrap; }

/* ── Footer ── */
.ac-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; font-size: 12px; }
.ac-consent-id { margin: 0; opacity: .7; }
.ac-consent-id code { font-size: 11px; background: none; padding: 0; color: inherit; }
.ac .ac-branding { font-size: 11px; opacity: .6; text-decoration: none; }
.ac .ac-branding:hover { opacity: 1; }

/* ── Floating button ── */
.ac-fab {
	position: fixed; bottom: 20px; z-index: 2147482999;
	display: flex; align-items: center; justify-content: center;
	width: 46px; height: 46px; padding: 0; margin: 0;
	border-radius: 50%; border: 1.5px solid rgba(20, 18, 12, .12);
	background: var(--ac-bg, #fff); color: var(--ac-accent, #4a7300);
	box-shadow: 0 2px 12px rgba(20, 18, 12, .15);
	cursor: pointer; transition: transform .15s, box-shadow .2s;
	-webkit-appearance: none; appearance: none;
}
.ac-fab--left { left: 20px; }
.ac-fab--right { right: 20px; }
.ac-fab:hover { transform: scale(1.08); box-shadow: 0 4px 20px rgba(20, 18, 12, .2); }

/* ── iFrame placeholder ── */
.ac-placeholder {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
	box-sizing: border-box; width: 100%; max-width: 100%; min-height: 200px; padding: 28px 24px;
	background: #f4f3ef; color: #14120c; border: 1px dashed #c9c6bd; border-radius: 10px;
	text-align: center; font-size: 14px; line-height: 1.5;
}
.ac-placeholder p { margin: 0; max-width: 520px; }
.ac-placeholder-btn {
	font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
	padding: 10px 20px; border: 0; border-radius: 8px;
	background: var(--ac-accent, #4a7300); color: #fff;
}
.ac-placeholder a { font-size: 12px; color: inherit; opacity: .7; }

/* ── Mobile ── */
@media (max-width: 767px) {
	.ac-inner, .ac--modal .ac-inner { padding: 18px; }
	.ac-view--main { grid-template-columns: 1fr; gap: 16px; }
	.ac-actions, .ac-actions--detail { flex-direction: column; min-width: 0; }
	.ac-actions--detail .ac-btn { flex: none; }
	.ac .ac-btn { width: 100%; white-space: normal; }
	.ac--box-left .ac-dialog, .ac--box-right .ac-dialog { left: 12px; right: 12px; bottom: 12px; width: auto; }
	.ac-detail-head { flex-wrap: wrap; }
	.ac-service-info dl { grid-template-columns: 1fr; }
	.ac-service-info dt { margin-top: 4px; }
	.ac-fab { bottom: 16px; width: 42px; height: 42px; }
	.ac-fab--left { left: 16px; }
	.ac-fab--right { right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.ac-dialog, .ac-overlay, .ac-fab, .ac-slider, .ac-slider::after { transition: none !important; }
}
