/* Pasek zgód cookies – SM "Projektant" */
#cookie-banner,
#cookie-preferences {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  position: fixed;
  z-index: 9999;
  left: 0; right: 0;
  color: #1a1a1a;
}

#cookie-banner {
  bottom: 0;
  background: #ffffff;
  border-top: 3px solid #1a2a4f;
  box-shadow: 0 -6px 24px rgba(0,0,0,.12);
}

.cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.cookie-text {
  font-size: .95rem;
  line-height: 1.4;
}
.cookie-text a { color: #1a2a4f; text-decoration: underline; }

.cookie-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

.cookie-btn {
  border: 1px solid #1a2a4f;
  background: #fff;
  color: #1a2a4f;
  padding: .6rem .9rem;
  border-radius: .6rem;
  cursor: pointer;
  font-weight: 600;
}
.cookie-btn.primary { background: #1a2a4f; color: #fff; }
.cookie-btn.destructive { border-color: #9e9e9e; color: #444; }

@media (max-width: 768px) {
  .cookie-inner { grid-template-columns: 1fr; }
}

/* Modal preferencji */
#cookie-preferences {
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
}
#cookie-preferences.show { display: block; }
.cookie-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 720px;
  margin: 5vh auto;
  padding: 1rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.cookie-modal header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 1rem 0 1rem;
}
.cookie-modal h3 { margin: .5rem 0; color: #1a2a4f; }
.cookie-modal .body { padding: 0 1rem 1rem 1rem; }
.cookie-group { border: 1px solid #e2e6ec; border-radius: 10px; padding: .75rem 1rem; margin-bottom: .75rem; }
.cookie-group h4 { margin: 0 0 .25rem 0; }
.cookie-group p { margin: 0; color: #555; font-size: .9rem; }
.cookie-footer { display:flex; gap:.5rem; justify-content:flex-end; padding: 0 1rem 1rem 1rem; }
.badge-required { font-size: .7rem; background:#f4f6fa; color:#1a2a4f; padding:.1rem .4rem; border-radius:6px; margin-left:.5rem; }


/* RESET + kompakt dla przycisku w stopce (przebija wszystkie globalsy) */
.footer .footer-right .manage-cookies{
  all: unset;                           /* wyczyść dziedziczenie i UA-styles */
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  /* nasz docelowy wygląd */
  background: rgba(255,255,255,.88) !important;
  color: #1a2a4f !important;
  font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Arial, sans-serif !important;
  padding: 2px 8px !important;          /* super kompakt */
  border: 1px solid rgba(0,0,0,.18) !important;
  border-radius: 3px !important;
  text-decoration: none !important;
  vertical-align: baseline;
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 1px 2px rgba(0,0,0,.12) !important;
}
.footer .footer-right .manage-cookies:hover,
.footer .footer-right .manage-cookies:focus-visible{
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(0,0,0,.25) !important;
  outline: 0 !important;
}

/* ---- Wariant linku w treści (np. Polityka cookies) ---- */
.content a.manage-cookies {
  color: #1a2a4f;
  text-decoration: underline;
  font-weight: 600;
}
.content a.manage-cookies:hover,
.content a.manage-cookies:focus { color: #4b94ff; }

/* ================== COOKIE PREFS / MODAL ================== */

/* Overlay – zawsze nad headerem i wycentrowany */
#cookie-preferences.cookie-dialog{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(17,24,39,.55);
  backdrop-filter: blur(2px);
  z-index: 2147483647;
}
#cookie-preferences[hidden]{ display: none !important; }

/* Panel – przewijalny, sticky header/footer */
#cookie-preferences .cookie-modal{
  width: min(720px, 92vw);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: #fff;
  color: #111827;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 1.25rem;
}
#cookie-preferences .cookie-modal > header{
  position: sticky; top: 0; z-index: 1;
  background:#fff; border-bottom:1px solid #e5e7eb;
  margin:-1.25rem -1.25rem .75rem; padding:1rem 1.25rem .75rem;
}
#cookie-preferences .cookie-footer{
  position: sticky; bottom: 0; z-index: 1;
  background:#fff; border-top:1px solid #e5e7eb;
  margin:.75rem -1.25rem -1.25rem; padding:.75rem 1.25rem 1rem;
}

/* Blokada scrolla dokumentu, gdy modal otwarty (dodawana w JS) */
.cookies-open { overflow: hidden; }
