/* ──────────────────────────────────────────────────────────────
   Manuarte Core — baner zgód

   Korzysta z tokenów motywu Manuarte, ale każdy ma fallback:
   wtyczka jest niezależna od motywu i musi wyglądać poprawnie
   także wtedy, gdy motyw się zmieni.
   ────────────────────────────────────────────────────────────── */

.manuarte-consent {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: var(--font, 'Montserrat', sans-serif);
  /* Kontener rozciąga się na cały ekran, żeby wyśrodkować okno ustawień,
     ale sam nie może przechwytywać kliknięć — inaczej baner blokuje całą
     stronę. Klikalne są tylko backdrop (po rozwinięciu ustawień) i dialog. */
  pointer-events: none;
}

.manuarte-consent[hidden] { display: none; }

.manuarte-consent__backdrop {
  position: absolute;
  inset: 0;
  background: var(--clr-overlay, rgba(14, 15, 18, 0.8));
  opacity: 0;
  transition: opacity var(--transition, 0.25s ease);
  pointer-events: none;
}

/* Tło przyciemniamy dopiero po rozwinięciu ustawień — sam baner
   nie powinien blokować przeglądania strony. */
.manuarte-consent--prefs-open .manuarte-consent__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.manuarte-consent__dialog {
  position: relative;
  pointer-events: auto;
  margin: 24px;
  padding: 28px;
  width: calc(100% - 48px);
  max-width: 64rem;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--clr-bg, #0e0f12);
  border: 1px solid var(--clr-white-20, rgba(255, 255, 255, 0.2));
  border-radius: var(--radius-sm, 8px);
  color: var(--clr-white, #ffffff);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

/* ── Widoki (główny / ustawienia) ── */

.manuarte-consent__view[hidden] { display: none; }

/* Kontener widoku dostaje focus programowo (tabindex="-1"), żeby na starcie
   nie podświetlać żadnego przycisku — sam obrys jest tu zbędny.
   Chrome traktuje ten programowy focus jak :focus-visible, więc globalny
   pierścień motywu ([tabindex]:focus-visible) obrysowywał cały baner na
   wejściu. Podbita specyficzność (.manuarte-consent …) wygrywa z motywem
   niezależnie od kolejności ładowania arkuszy. */
.manuarte-consent .manuarte-consent__view:focus,
.manuarte-consent .manuarte-consent__view:focus-visible {
  outline: none;
  box-shadow: none;
}

.manuarte-consent__view--main {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.manuarte-consent__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.manuarte-consent__view--main .manuarte-consent__title,
.manuarte-consent__view--main .manuarte-consent__text {
  margin: 0;
}

.manuarte-consent__view--main .manuarte-consent__actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.manuarte-consent__view--prefs {
  display: flex;
  flex-direction: column;
}

.manuarte-consent__title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--clr-white, #ffffff);
}

.manuarte-consent__text {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--clr-white-80, rgba(255, 255, 255, 0.8));
}

.manuarte-consent__policy {
  color: var(--clr-accent, #f68620);
  text-decoration: underline;
}

.manuarte-consent__policy:hover,
.manuarte-consent__policy:focus-visible {
  color: var(--clr-accent-2, #fe4341);
}

/* ── Ustawienia kategorii ── */

.manuarte-consent__prefs {
  margin: 0 0 20px;
  border-top: 1px solid var(--clr-white-20, rgba(255, 255, 255, 0.2));
}

.manuarte-consent__cat {
  padding: 16px 0;
  border-bottom: 1px solid var(--clr-white-20, rgba(255, 255, 255, 0.2));
}

.manuarte-consent__cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.manuarte-consent__toggle {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--clr-accent, #f68620);
  cursor: pointer;
}

.manuarte-consent__toggle:disabled { cursor: default; }

.manuarte-consent__cat-label {
  font-size: 14px;
  font-weight: 600;
}

.manuarte-consent__badge {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: var(--radius-sm, 8px);
  background: var(--clr-white-20, rgba(255, 255, 255, 0.2));
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clr-white-80, rgba(255, 255, 255, 0.8));
}

.manuarte-consent__cat-desc {
  margin: 8px 0 0 28px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--clr-white-80, rgba(255, 255, 255, 0.8));
}

/* ── Akcje ── */

.manuarte-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.manuarte-consent__btn {
  position: relative;
  flex: 1 1 auto;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: color var(--transition, 0.25s ease),
              background-color var(--transition, 0.25s ease),
              border-color var(--transition, 0.25s ease);
}

.manuarte-consent__btn:focus-visible {
  outline: 2px solid var(--clr-accent, #f68620);
  outline-offset: 2px;
}

.manuarte-consent__btn-label {
  position: relative;
  z-index: 1;
}

/*
 * Hover przycisku „primary” działa tak samo jak .btn--gradient w motywie:
 * gradientu nie da się animować do koloru, więc białe tło hoveru leży na
 * ::before i zmienia się tylko jego opacity, a napis odsłania gradient
 * przez background-clip (znika biały text-fill).
 */
.manuarte-consent__btn--primary {
  background: var(--grad-primary, linear-gradient(246.87deg, #f68620 28.84%, #fe4341 175.96%));
  color: var(--clr-white, #ffffff);
}

.manuarte-consent__btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--clr-white, #ffffff);
  opacity: 0;
  transition: opacity var(--transition, 0.25s ease);
}

.manuarte-consent__btn--primary:hover::before { opacity: 1; }

.manuarte-consent__btn--primary .manuarte-consent__btn-label {
  background: var(--grad-text, linear-gradient(258.6deg, #f68620 28.84%, #fe4341 175.96%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: var(--clr-white, #ffffff);
  color: var(--clr-white, #ffffff);
  transition: -webkit-text-fill-color var(--transition, 0.25s ease),
              color var(--transition, 0.25s ease);
}

.manuarte-consent__btn--primary:hover .manuarte-consent__btn-label {
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.manuarte-consent__btn--ghost {
  background: transparent;
  border-color: var(--clr-white-20, rgba(255, 255, 255, 0.2));
  color: var(--clr-white, #ffffff);
}

.manuarte-consent__btn--ghost:hover {
  border-color: var(--clr-accent, #f68620);
  color: var(--clr-accent, #f68620);
}

/* ── Mobile ── */

@media (max-width: 767px) {
  .manuarte-consent__dialog {
    margin: 12px;
    padding: 20px;
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
  }

  .manuarte-consent__view--main { flex-direction: column; align-items: stretch; gap: 16px; }
  .manuarte-consent__actions { flex-direction: column; }
  .manuarte-consent__btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .manuarte-consent__backdrop,
  .manuarte-consent__btn { transition: none; }
}
