/* =========================
   COOKIE WALL (wymuszona decyzja)
   Nowoczesny wygląd + dostępność
   ========================= */

.cookie-wall{
  position:fixed;
  inset:0;
  display:none;                 /* domyślnie ukryte */
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:2147483000;           /* wysoki, ale niższy niż modal polityki */
  pointer-events:auto;

  /* nowocześniejsze tło */
  background:rgba(2,6,23,.55);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.cookie-wall.is-open{ display:flex; }

/* jeśli JS ustawi hidden, wall ma zniknąć zawsze (nawet gdy .is-open zostanie) */
.cookie-wall[hidden],
.cookie-wall[hidden].is-open{
  display:none !important;
  pointer-events:none !important;
}

.cookie-card{
  width:min(620px, 94vw);
  background:rgba(255,255,255,.96);
  border:1px solid rgba(148,163,184,.35);
  border-radius:22px;
  padding:18px 18px 16px;
  box-shadow:0 28px 90px rgba(0,0,0,.35);
  transform:translateY(8px);
  opacity:0;
}

.cookie-wall.is-open .cookie-card{
  opacity:1;
  transform:translateY(0);
  transition:opacity .22s ease, transform .22s ease;
}

/* Nagłówek */
.cookie-card h3{
  margin:0;
  font-size:20px;
  letter-spacing:.2px;
  color:#0b0b0b;
  display:flex;
  align-items:center;
  gap:10px;
}
.cookie-card h3::before{
  content:"🍪";
  font-size:20px;
  line-height:1;
}

.cookie-text{
  margin:10px 0 14px;
  line-height:1.55;
  color:rgba(15,23,42,.78);
}

.cookie-text a{
  font-weight:900;
  text-decoration:none;
  border-bottom:2px solid rgba(20,138,59,.35);
}
.cookie-text a:hover{ border-bottom-color:rgba(20,138,59,.75); }
.cookie-text a:focus{ outline:3px solid rgba(20,138,59,.35); outline-offset:2px; border-radius:6px; }

/* Przyciski */
.cookie-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

.cookie-wall .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border-radius:999px;
  padding:12px 16px;
  font-weight:900;
  cursor:pointer;
  border:1px solid rgba(148,163,184,.45);
  background:#fff;
  color:#0b0b0b;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.cookie-wall .btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(2,6,23,.10);
  border-color:rgba(148,163,184,.7);
}
.cookie-wall .btn:active{ transform:translateY(0); box-shadow:none; }
.cookie-wall .btn:focus{ outline:3px solid rgba(20,138,59,.35); outline-offset:2px; }

/* mapowanie istniejących klas z HTML (btn primary / btn ghost) */
.cookie-wall .btn.primary{
  background:#148a3b;
  border-color:#148a3b;
  color:#fff;
}
.cookie-wall .btn.primary:hover{ box-shadow:0 14px 30px rgba(20,138,59,.22); }

.cookie-wall .btn.ghost{
  background:transparent;
  border-color:rgba(148,163,184,.65);
}
.cookie-wall .btn.ghost:hover{ background:rgba(148,163,184,.12); }

/* Sekcja dostosowania */
.cookie-custom{ margin-top:12px; }

.cookie-row{
  padding:12px 12px;
  border-top:1px solid rgba(148,163,184,.35);
  background:rgba(148,163,184,.10);
  border-radius:14px;
  margin:10px 0;
}

.cookie-switch{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}

.cookie-switch span{ color:rgba(15,23,42,.85); font-weight:800; }

/* Nowoczesny przełącznik */
.cookie-switch input{
  appearance:none;
  -webkit-appearance:none;
  width:46px;
  height:26px;
  border-radius:999px;
  background:rgba(148,163,184,.55);
  position:relative;
  border:1px solid rgba(148,163,184,.55);
  outline:none;
  cursor:pointer;
  flex:0 0 auto;
}
.cookie-switch input:disabled{ opacity:.6; cursor:not-allowed; }
.cookie-switch input::after{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 6px 14px rgba(2,6,23,.18);
  transition:transform .16s ease;
}
.cookie-switch input:checked{
  background:rgba(20,138,59,.95);
  border-color:rgba(20,138,59,.95);
}
.cookie-switch input:checked::after{ transform:translateX(20px); }
.cookie-switch input:focus{ outline:3px solid rgba(20,138,59,.35); outline-offset:2px; }

/* blokuj scroll, gdy wall otwarty */
body.cookie-locked{ overflow:hidden; }

/* =========================
   MOBILE (bottom-sheet)
   ========================= */
@media (max-width:520px){
  .cookie-wall{
    align-items:flex-end;
    padding:12px;
    padding-bottom:calc(12px + env(safe-area-inset-bottom));
  }

  .cookie-card{
    width:100%;
    max-width:none;
    border-radius:22px 22px 0 0;
    padding:16px 14px 14px;
  }

  .cookie-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }

  .cookie-wall .btn{ width:100%; }
}

/* =========================
   Polityka cookies – NAD wall
   (policy-modal.js otwiera #cookiePolicyModal)
   ========================= */

#cookiePolicyModal{
  position:fixed !important;
  inset:0 !important;
  z-index:2147483647 !important;
}

#cookiePolicyModal[hidden]{ display:none !important; }

#cookiePolicyModal .cookie-policy-bg{
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.55);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

#cookiePolicyModal .cookie-policy-card{
  position:relative;
  width:min(920px, 94vw);
  margin:6vh auto 0;
  background:rgba(255,255,255,.97);
  border:1px solid rgba(148,163,184,.35);
  border-radius:18px;
  padding:14px;
  max-height:88vh;
  overflow:auto;
  box-shadow:0 28px 90px rgba(0,0,0,.35);
}
