/* ConsentPilot — baner. Wszystko scoped .cp- ; kolory ze zmiennych (inline z designera). */

#cp-root { --cp-fg: var(--cp-text); --cp-panel: var(--cp-bg); }
#cp-root[hidden] { display: none; }

#cp-root {
	position: fixed;
	z-index: 999999;
	color: var(--cp-fg);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
}
#cp-root *, #cp-root *::before, #cp-root *::after { box-sizing: border-box; }

/* Motyw ciemny */
@media (prefers-color-scheme: dark) {
	#cp-root.cp-theme-auto { --cp-panel: var(--cp-bg-dark); --cp-fg: var(--cp-text-dark); }
}
#cp-root.cp-theme-dark { --cp-panel: var(--cp-bg-dark); --cp-fg: var(--cp-text-dark); }

/* Pozycje / układy */
.cp-layout-bar#cp-root { left: 0; right: 0; }
.cp-layout-bar.cp-pos-bottom#cp-root { bottom: 0; }
.cp-layout-bar.cp-pos-top#cp-root { top: 0; }

.cp-layout-box#cp-root { max-width: 420px; }
.cp-layout-box.cp-pos-bottom-right#cp-root { right: 20px; bottom: 20px; }
.cp-layout-box.cp-pos-bottom-left#cp-root { left: 20px; bottom: 20px; }
.cp-layout-box.cp-pos-bottom#cp-root { left: 50%; transform: translateX(-50%); bottom: 20px; }

.cp-layout-modal#cp-root { inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); }
.cp-layout-modal .cp-card { max-width: 520px; }

/* Karta */
.cp-card {
	background: var(--cp-panel);
	color: var(--cp-fg);
	border-radius: var(--cp-radius);
	box-shadow: 0 8px 40px rgba(0,0,0,.18);
	padding: 20px 22px;
	margin: 16px;
	max-height: 85vh;
	overflow-y: auto;
}
.cp-layout-bar .cp-card { margin: 0; border-radius: 0; box-shadow: 0 -4px 24px rgba(0,0,0,.12); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 16px 24px; max-width: 1400px; margin-inline: auto; }
.cp-layout-bar .cp-main { flex: 1; min-width: 280px; }

.cp-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.cp-body { margin: 0 0 10px; opacity: .9; }
.cp-links { font-size: 12px; opacity: .8; margin-bottom: 10px; }
.cp-links a { color: var(--cp-accent); text-decoration: underline; }

/* Przyciski */
.cp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cp-btn {
	font: inherit; cursor: pointer; border: 1px solid transparent;
	padding: 9px 16px; border-radius: calc(var(--cp-radius) * .6);
	transition: opacity .15s, transform .05s;
}
.cp-btn:active { transform: translateY(1px); }
.cp-btn-accept { background: var(--cp-accent); color: #fff; }
.cp-btn-accept:hover { opacity: .9; }
.cp-btn-ghost { background: transparent; color: var(--cp-fg); border-color: currentColor; opacity: .85; }
.cp-btn-ghost:hover { opacity: 1; }
.cp-btn:focus-visible { outline: 3px solid var(--cp-accent); outline-offset: 2px; }

/* Warstwa 2 */
.cp-layer2 { display: none; width: 100%; margin-top: 16px; border-top: 1px solid rgba(128,128,128,.25); padding-top: 14px; }
.cp-layer2.cp-open { display: block; }
.cp-cat { padding: 10px 0; border-bottom: 1px solid rgba(128,128,128,.15); }
.cp-cat-head { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.cp-cat-desc { margin: 4px 0 0 24px; font-size: 13px; opacity: .8; }
.cp-cookies { margin: 6px 0 0 24px; font-size: 12px; }
.cp-cookies summary { cursor: pointer; opacity: .8; }
.cp-cookies table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.cp-cookies th, .cp-cookies td { text-align: left; padding: 4px 8px; border: 1px solid rgba(128,128,128,.2); }
.cp-save { margin-top: 14px; }

/* Pływająca ikona */
.cp-badge {
	position: fixed; left: 16px; bottom: 16px; z-index: 999998;
	width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
	background: var(--cp-accent, #2563eb); color: #fff; font-size: 20px;
	box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.cp-badge:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Placeholder osadzeń */
.cp-embed-placeholder {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 10px; min-height: 200px; padding: 20px; text-align: center;
	background: rgba(128,128,128,.08); border: 1px dashed rgba(128,128,128,.4); border-radius: 8px;
}
/* Placeholder z rezerwacją proporcji: aspect-ratio rządzi wysokością, a niski
   floor min-height chroni przed zapadnięciem się do zera w kontenerach builderów
   (Divi et_pb_video_box), gdzie szerokość nie jest definitywna. */
.cp-embed-placeholder[data-cp-ar] { min-height: 80px; }

.cp-embed-load { background: var(--cp-accent, #2563eb); color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font: inherit; }

@media (prefers-reduced-motion: no-preference) {
	.cp-visible .cp-card { animation: cp-in .2s ease-out; }
	@keyframes cp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 600px) {
	.cp-layout-box#cp-root { left: 0; right: 0; max-width: none; transform: none; bottom: 0; }
	.cp-card { margin: 0; border-radius: var(--cp-radius) var(--cp-radius) 0 0; }
	.cp-actions { flex-direction: column; }
	.cp-actions .cp-btn { width: 100%; }
}
