/* KCOD cookie consent — style bannera, modala i bluru strony (v2: 2 wybory) */

/* Blur całej strony dopóki użytkownik nie podejmie decyzji.
   Wyjątek: sam baner i modal nie są rozmyte. */
html:not(.kcod-consent-ok) body > *:not(#kcod-cookie-banner):not(#kcod-cookie-modal) {
  filter: blur(8px);
  transition: filter .25s ease;
  pointer-events: none;
  user-select: none;
}
html:not(.kcod-consent-ok) body {
  overflow: hidden;
}

#kcod-cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 3px solid #5170ff;
  box-shadow: 0 -8px 32px rgba(46,29,91,.18);
  padding: 20px 24px; z-index: 999999;
  display: none; font-family: 'Rubik', sans-serif;
  animation: kcbSlideUp .35s ease;
}
#kcod-cookie-banner.show { display: block; }
@keyframes kcbSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

#kcod-cookie-banner .kcb-inner {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: center;
}
#kcod-cookie-banner h4 { margin: 0 0 6px; font-size: .98rem; font-weight: 700; color: #2e1d5b; }
#kcod-cookie-banner p { margin: 0; font-size: .82rem; color: #545454; line-height: 1.55; }
#kcod-cookie-banner p a { color: #5170ff; text-decoration: underline; font-weight: 500; }
#kcod-cookie-banner .kcb-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#kcod-cookie-banner .kcb-btn {
  border: none; border-radius: 8px; padding: 11px 20px;
  font-family: 'Rubik', sans-serif; font-size: .84rem; font-weight: 600;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
#kcod-cookie-banner .kcb-accept { background: #2e1d5b; color: #fff; }
#kcod-cookie-banner .kcb-accept:hover { background: #5170ff; transform: translateY(-1px); }
#kcod-cookie-banner .kcb-custom { background: #fff; color: #2e1d5b; border: 1.5px solid #dddaf0; }
#kcod-cookie-banner .kcb-custom:hover { border-color: #5170ff; color: #5170ff; }

#kcod-cookie-modal {
  position: fixed; inset: 0; background: rgba(46,29,91,.72);
  z-index: 1000000; display: none; align-items: center; justify-content: center;
  padding: 20px; animation: kcmFadeIn .25s ease;
}
#kcod-cookie-modal.show { display: flex; }
@keyframes kcmFadeIn { from { opacity: 0; } to { opacity: 1; } }
#kcod-cookie-modal .kcm-card {
  background: #fff; border-radius: 16px; max-width: 580px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 28px; font-family: 'Rubik', sans-serif;
}
#kcod-cookie-modal h3 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; color: #2e1d5b; }
#kcod-cookie-modal .kcm-intro { font-size: .85rem; color: #545454; line-height: 1.65; margin: 0 0 20px; }
#kcod-cookie-modal .kcm-cat { background: #f8f9ff; border: 1px solid #e8e4ff; border-radius: 11px; padding: 14px 16px; margin-bottom: 10px; }
#kcod-cookie-modal .kcm-cat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
#kcod-cookie-modal .kcm-cat-title { font-size: .92rem; font-weight: 700; color: #2e1d5b; }
#kcod-cookie-modal .kcm-cat-desc { font-size: .76rem; color: #545454; line-height: 1.55; margin: 0; }
#kcod-cookie-modal .kcm-required { font-size: .68rem; color: #0d9e6b; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
#kcod-cookie-modal .kcm-toggle {
  position: relative; width: 40px; height: 22px; background: #ccc;
  border-radius: 100px; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
#kcod-cookie-modal .kcm-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
#kcod-cookie-modal .kcm-toggle.on { background: #5170ff; }
#kcod-cookie-modal .kcm-toggle.on::after { transform: translateX(18px); }
#kcod-cookie-modal .kcm-toggle.disabled { background: #0d9e6b; cursor: not-allowed; }
#kcod-cookie-modal .kcm-toggle.disabled::after { transform: translateX(18px); }
#kcod-cookie-modal .kcm-btns { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
#kcod-cookie-modal .kcm-btn {
  flex: 1; border: none; border-radius: 9px; padding: 12px 18px;
  font-family: 'Rubik', sans-serif; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: all .2s; min-width: 130px;
}
#kcod-cookie-modal .kcm-save { background: #2e1d5b; color: #fff; }
#kcod-cookie-modal .kcm-save:hover { background: #5170ff; }
#kcod-cookie-modal .kcm-accept-all { background: #0d9e6b; color: #fff; }
#kcod-cookie-modal .kcm-accept-all:hover { background: #0a7d54; }

@media (max-width: 768px) {
  #kcod-cookie-banner .kcb-inner { grid-template-columns: 1fr; gap: 14px; }
  #kcod-cookie-banner .kcb-btns { width: 100%; }
  #kcod-cookie-banner .kcb-btn { flex: 1; min-width: 100px; }
  #kcod-cookie-banner { padding: 16px; }
  #kcod-cookie-modal .kcm-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #kcod-cookie-banner, #kcod-cookie-modal, html:not(.kcod-consent-ok) body > * { animation: none !important; transition: none !important; }
}
