/**
 * NS Consent – style banera i okna zgód.
 *
 * Kluczowa zasada: klasa .nsc-btn jest JEDYNĄ klasą przycisków decyzyjnych.
 * Wszystkie trzy przyciski (odmowa / dostosuj / akceptacja) mają identyczne
 * tło, obramowanie, rozmiar, krój i kontrast – żaden nie jest wyróżniony.
 * Nie dodawaj wariantów typu .nsc-btn--primary; to byłby dark pattern.
 */

.ns-consent-root {
  --nsc-bg: #ffffff;
  --nsc-text: #1d2327;
  --nsc-btn-bg: #f2f4f5;
  --nsc-btn-text: #1d2327;
  --nsc-accent: #4b7f52;
  --nsc-radius: 8px;
  --nsc-border: rgba(29, 35, 39, .25);
  font-size: 15px;
  line-height: 1.5;
  color: var(--nsc-text);
}

.ns-consent-root *,
.ns-consent-root *::before,
.ns-consent-root *::after {
  box-sizing: border-box;
}

.nsc-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ baner */

.nsc-banner {
  position: fixed;
  z-index: 2147483000;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--nsc-bg);
  color: var(--nsc-text);
  box-shadow: 0 -2px 24px rgba(0, 0, 0, .18);
  border-top: 1px solid var(--nsc-border);
  padding: 20px 16px;
  animation: nsc-slide-up .25s ease-out;
}

.nsc-banner--center {
  top: 50%;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  max-width: 680px;
  width: calc(100% - 32px);
  border: 1px solid var(--nsc-border);
  border-radius: var(--nsc-radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .25);
  animation: none;
}

.nsc-banner__inner {
  max-width: 1140px;
  margin: 0 auto;
}

.nsc-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--nsc-text);
}

.nsc-text {
  margin: 0 0 16px;
  font-size: 14px;
}

.nsc-text p {
  margin: 0 0 8px;
}

.nsc-link,
.nsc-link:visited {
  color: var(--nsc-accent);
  text-decoration: underline;
}

.nsc-links {
  display: inline-block;
  font-size: 13px;
}

/* --------------------------------------------------------------- przyciski */

.nsc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nsc-btn {
  flex: 1 1 200px;
  min-height: 46px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  text-align: center;
  color: var(--nsc-btn-text);
  background: var(--nsc-btn-bg);
  border: 1px solid var(--nsc-border);
  border-radius: var(--nsc-radius);
  cursor: pointer;
  transition: filter .15s ease;
}

.nsc-btn:hover {
  filter: brightness(.95);
}

.nsc-btn:focus-visible,
.nsc-close:focus-visible,
.nsc-details-toggle:focus-visible,
.nsc-floating:focus-visible,
.nsc-switch input:focus-visible + .nsc-switch__track {
  outline: 3px solid var(--nsc-accent);
  outline-offset: 2px;
}

.nsc-link-btn {
  margin-top: 12px;
  padding: 0;
  font-size: 14px;
  color: var(--nsc-accent);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* ------------------------------------------------------------ okno modalne */

.nsc-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.nsc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

/* Przyciemnienie pod banerem (opcja). Leży POD banerem, nad resztą strony.
   Kliknięcie w nie nic nie robi – brak decyzji nie jest ani zgodą, ani odmową.
   Wyjście zapewniają trzy równorzędne przyciski, więc odmowa kosztuje
   dokładnie tyle samo kliknięć co akceptacja. */
.nsc-backdrop--banner {
  z-index: 2147482998;
  background: rgba(0, 0, 0, .45);
}

.nsc-backdrop--banner[hidden] {
  display: none;
}

.nsc-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 32px);
  background: var(--nsc-bg);
  color: var(--nsc-text);
  border-radius: var(--nsc-radius);
  box-shadow: 0 10px 50px rgba(0, 0, 0, .35);
}

.nsc-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--nsc-border);
}

.nsc-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px;
}

.nsc-modal__intro {
  margin: 0 0 12px;
  font-size: 14px;
}

.nsc-modal__foot {
  padding: 16px 20px;
  border-top: 1px solid var(--nsc-border);
}

.nsc-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: var(--nsc-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--nsc-radius);
  cursor: pointer;
}

.nsc-close:hover {
  border-color: var(--nsc-border);
}

/* --------------------------------------------------------- kategorie zgód */

.nsc-purpose {
  padding: 16px 0;
  border-top: 1px solid var(--nsc-border);
}

.nsc-purpose__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.nsc-purpose__name {
  display: block;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.nsc-purpose__desc {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: .9;
}

.nsc-details-toggle {
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--nsc-btn-text);
  background: var(--nsc-btn-bg);
  border: 1px solid var(--nsc-border);
  border-radius: var(--nsc-radius);
  cursor: pointer;
}

.nsc-details-toggle[aria-expanded="true"]::after {
  content: " ▲";
}

.nsc-details-toggle[aria-expanded="false"]::after {
  content: " ▼";
}

.nsc-purpose__details {
  margin-top: 12px;
}

.nsc-service {
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, .03);
  border-radius: var(--nsc-radius);
}

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

.nsc-service__name {
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.nsc-service__desc {
  margin: 6px 0 0;
  font-size: 13px;
}

.nsc-service__meta {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: .85;
}

.nsc-always {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid var(--nsc-border);
  border-radius: 999px;
  white-space: nowrap;
}

/* ------------------------------------------------------------ przełączniki */

.nsc-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 52px;
  height: 30px;
  cursor: pointer;
}

.nsc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.nsc-switch__track {
  position: absolute;
  inset: 0;
  background: #cfd4d7;
  border: 1px solid var(--nsc-border);
  border-radius: 999px;
  transition: background .15s ease;
  pointer-events: none;
}

.nsc-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}

.nsc-switch input:checked + .nsc-switch__track {
  background: var(--nsc-accent);
}

.nsc-switch input:checked + .nsc-switch__track::after {
  transform: translateX(22px);
}

.nsc-switch input:indeterminate + .nsc-switch__track {
  background: #9aa5ab;
}

/* ------------------------------------------------------------ tabela cookies */

.nsc-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.nsc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.nsc-table th,
.nsc-table td {
  padding: 6px 8px;
  text-align: left;
  border: 1px solid var(--nsc-border);
  vertical-align: top;
}

.nsc-table th {
  background: rgba(0, 0, 0, .05);
  font-weight: 600;
}

.nsc-status {
  margin-top: 16px;
  font-size: 12px;
  opacity: .8;
  word-break: break-all;
}

/* --------------------------------------------- zastępnik zablokowanej treści */

.nsc-placeholder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 20px;
  background: #f2f4f5;
  border: 1px dashed rgba(29, 35, 39, .35);
  border-radius: 8px;
  color: #1d2327;
  font-size: 14px;
}

.nsc-placeholder__title {
  font-weight: 600;
}

.nsc-placeholder__text {
  margin: 0;
  font-size: 13px;
}

.nsc-placeholder .nsc-btn {
  flex: 0 0 auto;
  min-width: 220px;
}

/* --------------------------------------------------------- przycisk pływający */

.nsc-floating {
  position: fixed;
  bottom: 16px;
  z-index: 2147482999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--nsc-btn-text);
  background: var(--nsc-btn-bg);
  border: 1px solid var(--nsc-border);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  cursor: pointer;
}

.nsc-floating--left {
  left: 16px;
}

.nsc-floating--right {
  right: 16px;
}

.nsc-floating__icon {
  font-size: 16px;
  line-height: 1;
}

/* Baner otwarty – przycisk pływający chowamy, by się nie nakładały. */
.nsc-banner-open .nsc-floating {
  display: none;
}

.nsc-modal-open {
  overflow: hidden;
}

/* ------------------------------------------------------------- stopka sklepu */

.ns-consent-footer-link {
  margin: 8px 0;
  font-size: 13px;
}

.ns-consent-footer-link a {
  text-decoration: underline;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  .nsc-banner {
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px 14px;
  }

  .nsc-actions {
    flex-direction: column;
  }

  .nsc-btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .nsc-floating__label {
    display: none;
  }
}

@keyframes nsc-slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {

  .nsc-banner,
  .nsc-btn,
  .nsc-switch__track,
  .nsc-switch__track::after {
    animation: none !important;
    transition: none !important;
  }
}
