/**
 * Consento banner.css — banner, modal, placeholders, revoke button.
 * All colors/geometry come from CSS custom properties set on #cnst-root (PHP/JS),
 * so themes and the customizer can restyle without touching this file.
 * Budget: ≤ 6 KB gzipped. No fonts, no layout shift (fixed positioning only).
 */

#cnst-root {
	--cnst-bg: #fff;
	--cnst-text: #1e2430;
	--cnst-link: #0b5fff;
	--cnst-btn1-bg: #0b5fff;
	--cnst-btn1-text: #fff;
	--cnst-btn2-bg: #fff;
	--cnst-btn2-text: #1e2430;
	--cnst-btn2-border: #c9d2e0;
	--cnst-toggle-on: #0b5fff;
	--cnst-overlay: rgba(10, 14, 24, 0.55);
	--cnst-border: #e3e8f0;
	--cnst-radius: 12px;
	--cnst-font-size: 16px;
	--cnst-title-weight: 700;
	--cnst-z: 999999;
	--cnst-maxw: 720px;
	--cnst-shadow: 0 8px 30px rgba(10, 14, 24, 0.16);
	--cnst-pad: 16px;
	--cnst-safe-b: env(safe-area-inset-bottom, 0px);
	--cnst-safe-t: env(safe-area-inset-top, 0px);
	font-family: inherit;
	font-size: var(--cnst-font-size);
	line-height: 1.5;
	color: var(--cnst-text);
	z-index: var(--cnst-z);
}

#cnst-root *,
#cnst-root *::before,
#cnst-root *::after { box-sizing: border-box; }

#cnst-root[hidden] { display: none !important; }
#cnst-root .cnst-visually-hidden {
	position: absolute; width: 1px; height: 1px; margin: -1px;
	clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ------------------------------------------------------------- overlay */

.cnst-overlay {
	position: fixed; inset: 0;
	background: var(--cnst-overlay);
	backdrop-filter: blur(2px);
	z-index: calc(var(--cnst-z) - 2);
}
#cnst-root[data-block="1"] body > *:not(#cnst-root) { pointer-events: none; }

/* -------------------------------------------------------------- banner */

.cnst-banner {
	position: fixed;
	left: 0; right: 0;
	background: var(--cnst-bg);
	color: var(--cnst-text);
	border: 1px solid var(--cnst-border);
	padding: var(--cnst-pad);
	z-index: calc(var(--cnst-z) - 1);
	box-shadow: var(--cnst-shadow);
	border-radius: 0;
}
.cnst-lay-bottombar { bottom: 0; bottom: var(--cnst-safe-b); border-left: 0; border-right: 0; border-bottom: 0; }
.cnst-lay-topbar { top: 0; top: var(--cnst-safe-t); border-left: 0; border-right: 0; border-top: 0; }

.cnst-lay-float-bl, .cnst-lay-float-br, .cnst-lay-float-tl, .cnst-lay-float-tr {
	max-width: var(--cnst-maxw); margin: 16px; border-radius: var(--cnst-radius);
}
.cnst-lay-float-bl { bottom: 16px; left: 16px; bottom: calc(16px + var(--cnst-safe-b)); }
.cnst-lay-float-br { bottom: 16px; right: 16px; bottom: calc(16px + var(--cnst-safe-b)); }
.cnst-lay-float-tl { top: 16px; left: 16px; top: calc(16px + var(--cnst-safe-t)); }
.cnst-lay-float-tr { top: 16px; right: 16px; top: calc(16px + var(--cnst-safe-t)); }

.cnst-lay-modal {
	position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
	max-width: var(--cnst-maxw); width: calc(100% - 32px);
	border-radius: var(--cnst-radius); margin: 0;
}
.cnst-lay-pill {
	position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
	bottom: calc(16px + var(--cnst-safe-b));
	border-radius: 999px; padding: 10px 18px; max-width: min(92vw, var(--cnst-maxw));
}
.cnst-lay-pill .cnst-title { display: none; }
.cnst-lay-inline { position: static; box-shadow: none; }

.cnst-banner-inner { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cnst-lay-bottombar .cnst-banner-inner,
.cnst-lay-topbar .cnst-banner-inner { max-width: var(--cnst-maxw); margin: 0 auto; }
.cnst-banner-brand { display: flex; gap: 8px; align-items: center; color: var(--cnst-btn1-bg); }
.cnst-logo { border-radius: 6px; object-fit: contain; }
.cnst-banner-body { flex: 1 1 320px; min-width: 0; }
.cnst-title { margin: 0 0 4px; font-weight: var(--cnst-title-weight); font-size: 1.1em; }
.cnst-text { margin: 0 0 6px; }
.cnst-links { display: flex; gap: 14px; flex-wrap: wrap; }
.cnst-link { color: var(--cnst-link); text-decoration: underline; }
.cnst-link:hover { opacity: 0.85; }

.cnst-buttons { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cnst-lay-bottombar .cnst-buttons,
.cnst-lay-topbar .cnst-buttons { flex: 0 0 auto; }
#cnst-root[data-eq="1"] .cnst-buttons .cnst-btn { flex: 1 1 auto; justify-content: center; }

/* -------------------------------------------------------------- buttons */

.cnst-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font: inherit; font-weight: 600;
	font-size: 0.95em;
	padding: 10px 20px;
	min-height: 44px;
	border-radius: calc(var(--cnst-radius) / 2);
	border: 1px solid transparent;
	cursor: pointer;
	text-align: center;
	min-width: 110px;
	text-decoration: none;
	transition: filter 0.15s ease;
}
.cnst-btn:hover { filter: brightness(0.94); }
.cnst-btn:focus-visible { outline: 3px solid var(--cnst-link); outline-offset: 2px; }
.cnst-btn-accept { background: var(--cnst-btn1-bg); color: var(--cnst-btn1-text); border-color: var(--cnst-btn1-bg); }
.cnst-btn-reject {
	background: var(--cnst-btn2-bg); color: var(--cnst-btn2-text); border-color: var(--cnst-btn2-border);
}
/* Equal prominence: accept and reject are identical in size/shape by design. */
.cnst-btn-settings, .cnst-btn-save { background: transparent; color: var(--cnst-link); border-color: transparent; text-decoration: underline; min-width: 0; }

/* --------------------------------------------------------------- modal */

.cnst-modal {
	position: fixed; inset: 0;
	display: flex; align-items: center; justify-content: center;
	padding: 16px;
	z-index: calc(var(--cnst-z) - 1);
}
.cnst-modal[hidden] { display: none; }
.cnst-modal-box {
	background: var(--cnst-bg); color: var(--cnst-text);
	border: 1px solid var(--cnst-border); border-radius: var(--cnst-radius);
	box-shadow: var(--cnst-shadow);
	max-width: 640px; width: 100%; max-height: 85vh; overflow: auto;
	padding: 20px;
}
.cnst-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cnst-modal-title { margin: 0; font-size: 1.15em; font-weight: var(--cnst-title-weight); }
.cnst-close {
	background: transparent; border: 0; font-size: 1.6em; line-height: 1;
	cursor: pointer; color: inherit; padding: 4px 8px; border-radius: 8px;
}
.cnst-close:focus-visible { outline: 3px solid var(--cnst-link); }
.cnst-modal-intro { font-size: 0.95em; }

.cnst-cats { list-style: none; margin: 12px 0; padding: 0; }
.cnst-cat { border: 1px solid var(--cnst-border); border-radius: calc(var(--cnst-radius) / 1.5); padding: 12px; margin-bottom: 10px; }
.cnst-cat-head { display: flex; align-items: center; gap: 10px; }
.cnst-cat-name { font-weight: 600; }
.cnst-always { font-size: 0.8em; opacity: 0.75; margin-left: auto; }
.cnst-cat-desc { margin: 6px 0 0; font-size: 0.9em; opacity: 0.9; }

/* Toggle switch (pure CSS) */
.cnst-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.cnst-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cnst-switch input:focus-visible + .cnst-slider { outline: 3px solid var(--cnst-link); outline-offset: 2px; }
.cnst-slider {
	position: absolute; inset: 0; pointer-events: none;
	background: #c4cddc; border-radius: 999px; transition: background 0.15s ease;
}
.cnst-slider::before {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 16px; height: 16px; background: #fff; border-radius: 50%;
	transition: transform 0.15s ease;
}
.cnst-switch input:checked + .cnst-slider { background: var(--cnst-toggle-on); }
.cnst-switch input:checked + .cnst-slider::before { transform: translateX(18px); }
.cnst-switch input:disabled { cursor: not-allowed; }
.cnst-switch input:disabled + .cnst-slider { opacity: 0.55; }

.cnst-details { margin: 8px 0; }
.cnst-details summary { cursor: pointer; color: var(--cnst-link); text-decoration: underline; }
.cnst-svc-list, .cnst-services { list-style: none; margin: 8px 0 0; padding: 8px 0 0 0; border-top: 1px dashed var(--cnst-border); }
.cnst-svc { padding: 8px 0; font-size: 0.88em; }
.cnst-svc-prov { opacity: 0.75; }
.cnst-svc-cookies { margin: 4px 0 2px; opacity: 0.8; font-size: 0.92em; }

.cnst-consent-id { font-size: 0.75em; opacity: 0.7; margin: 6px 0; word-break: break-all; }
.cnst-modal-buttons { margin-top: 14px; justify-content: flex-end; }
.cnst-powered { font-size: 0.72em; opacity: 0.6; align-self: center; }

/* -------------------------------------------------------------- revoke */

.cnst-revoke {
	position: fixed;
	z-index: calc(var(--cnst-z) - 3);
	width: var(--cnst-revoke-size, 44px); height: var(--cnst-revoke-size, 44px);
	display: flex; align-items: center; justify-content: center;
	background: var(--cnst-bg); color: var(--cnst-btn1-bg);
	border: 1px solid var(--cnst-border); border-radius: 50%;
	box-shadow: var(--cnst-shadow); cursor: pointer; padding: 8px;
}
.cnst-revoke-bottom-left { bottom: calc(12px + var(--cnst-safe-b)); left: 12px; }
.cnst-revoke-bottom-right { bottom: calc(12px + var(--cnst-safe-b)); right: 12px; }
.cnst-revoke-top-left { top: calc(12px + var(--cnst-safe-t)); left: 12px; }
.cnst-revoke-top-right { top: calc(12px + var(--cnst-safe-t)); right: 12px; }
.cnst-revoke svg { width: 100%; height: 100%; }

/* --------------------------------------------------------- placeholders */

.cnst-ph {
	display: flex; align-items: center; justify-content: center;
	background: linear-gradient(180deg, #f4f6fa, #e9edf4);
	border: 1px solid var(--cnst-border); border-radius: var(--cnst-radius);
	color: #333c4e; font-family: inherit; font-size: 15px; min-height: 180px; padding: 16px;
	width: 100%; margin: 8px 0;
}
.cnst-ph-inner { display: flex; gap: 16px; align-items: center; max-width: 560px; }
.cnst-ph-thumb { width: 168px; border-radius: 8px; display: none; }
@media (min-width: 520px) { .cnst-ph-thumb { display: block; } }
.cnst-ph-text { margin: 0 0 10px; font-size: 0.95em; }
.cnst-ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cnst-ph-actions .cnst-btn { min-width: 0; padding: 8px 14px; }

/* -------------------------------------------------------------- motion */

#cnst-root .cnst-anim { animation: cnst-slide-up calc(var(--cnst-motion, 300) * 1ms) ease both; }
#cnst-root[data-motion="fade"] .cnst-anim { animation-name: cnst-fade; }
@keyframes cnst-slide-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes cnst-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	#cnst-root *, #cnst-root *::before, #cnst-root *::after {
		animation-duration: 0.01ms !important; transition-duration: 0.01ms !important;
	}
}

/* ----------------------------------------------------------------- dark */

#cnst-root[data-dark="1"] {
	--cnst-bg: #14181f;
	--cnst-text: #e8ecf3;
	--cnst-btn2-bg: #14181f;
	--cnst-btn2-text: #e8ecf3;
	--cnst-btn2-border: #3a4356;
	--cnst-border: #2a3242;
}
@media (prefers-color-scheme: dark) {
	#cnst-root[data-dark="auto"] {
		--cnst-bg: #14181f;
		--cnst-text: #e8ecf3;
		--cnst-btn2-bg: #14181f;
		--cnst-btn2-text: #e8ecf3;
		--cnst-btn2-border: #3a4356;
		--cnst-border: #2a3242;
	}
}

/* ----------------------------------------------------------------- rtl */

#cnst-root .cnst-rtl, #cnst-root.cnst-rtl { text-align: right; }

/* ------------------------------------------------------------ cookie table */

.cnst-cookie-table-wrap { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cnst-cookie-table-wrap:focus-visible { outline: 3px solid var(--cnst-link); outline-offset: 2px; }
.cnst-cookie-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 0.9em; }
.cnst-cookie-table th, .cnst-cookie-table td { border: 1px solid #d7dde8; padding: 8px 10px; text-align: left; vertical-align: top; }
.cnst-cookie-table .cnst-ct-cat th { background: #f0f3f8; font-weight: 700; }

@media (max-width: 600px) {
	.cnst-banner { padding: 12px; }
	.cnst-btn { width: 100%; }
	.cnst-buttons { width: 100%; }
}
