/* Banner cookies — kompaktowa karta + modal */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 280;
  display: flex;
  justify-content: flex-start;
  padding: 0 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-banner.is-visible {
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
}

.cookie-banner.is-visible .cookie-banner__shell {
  pointer-events: auto;
}

.cookie-banner__shell {
  width: 100%;
  max-width: 340px;
  padding: 1.1rem 1.15rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(43, 62, 80, 0.08);
  background: #fff;
  box-shadow: 0 12px 40px rgba(26, 46, 74, 0.16);
  color: #2b3e50;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cookie-banner__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #2b3e50;
}

.cookie-banner__text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #2b3e50;
}

.cookie-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cookie-banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.cookie-banner__btn--primary {
  background: #2b3e50;
  color: #fff;
}

.cookie-banner__btn--primary:hover {
  opacity: 0.92;
}

.cookie-banner__btn--secondary {
  background: #e8edf1;
  color: #2b3e50;
}

.cookie-banner__btn--secondary:hover {
  background: #dde4ea;
}

/* Modal ustawień */

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.cookie-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 46, 74, 0.45);
}

.cookie-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(88vh, 520px);
  margin: 0 auto;
  padding: 1rem 1.1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-radius: 16px 16px 0 0;
  background: #fff;
  color: #2b3e50;
  box-shadow: 0 -8px 32px rgba(26, 46, 74, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transform: translateY(16px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: auto;
}

.cookie-modal.is-open .cookie-modal__panel {
  transform: translateY(0);
}

.cookie-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cookie-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cookie-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -0.2rem -0.35rem -0.2rem 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #2b3e50;
  cursor: pointer;
}

.cookie-modal__close:hover {
  background: #f0f3f6;
}

.cookie-modal__close .icon {
  font-size: 22px;
}

.cookie-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cookie-modal__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: #f6f8fa;
  cursor: pointer;
}

.cookie-modal__row--locked {
  cursor: default;
}

.cookie-modal__row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.cookie-modal__row-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: #2b3e50;
}

.cookie-modal__row-text span {
  font-size: 0.76rem;
  line-height: 1.35;
  color: #5a6472;
}

.cookie-modal__badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5a6472;
  background: #e8edf1;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.cookie-modal__switch {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
}

.cookie-modal__switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.cookie-modal__switch-ui {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(43, 62, 80, 0.18);
  transition: background 0.2s ease;
}

.cookie-modal__switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(26, 46, 74, 0.2);
  transition: transform 0.2s ease;
}

.cookie-modal__switch input:checked + .cookie-modal__switch-ui {
  background: #2b3e50;
}

.cookie-modal__switch input:checked + .cookie-modal__switch-ui::after {
  transform: translateX(18px);
}

.cookie-modal__foot {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.cookie-modal__link {
  border: 0;
  background: transparent;
  color: #5a6472;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0.35rem;
}

.cookie-modal__link:hover {
  color: #2b3e50;
}

.cookie-modal__policy {
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: #5a6472;
}

.cookie-modal__policy a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 761px) {
  .cookie-modal {
    align-items: center;
    padding: 1.5rem;
  }

  .cookie-modal__panel {
    border-radius: 14px;
    padding: 1.15rem 1.2rem 1.15rem;
    max-height: min(80vh, 480px);
    transform: translateY(8px) scale(0.98);
  }

  .cookie-modal.is-open .cookie-modal__panel {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .cookie-banner {
    justify-content: stretch;
    padding-bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }

  .cookie-banner__shell {
    max-width: none;
  }

  .cookie-modal {
    padding-bottom: 0;
  }
}
