/* ===========================================================
   ZGODY I COOKIES — style
   ===========================================================
   Używa tokenów z :root w style.css (--c1, --c2, --accent,
   --gradient, --gray, --text, --font-display, --font-body,
   --transition). Nic nowego nie definiuje, więc panel nie
   rozjedzie się kolorystycznie ze stroną.

   Ten plik musi być wczytany PO style.css.
   =========================================================== */

/* ---------- Pływający przycisk (bliźniak #backToTop) ---------- */

#mmCookieBtn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;   /* lewy dolny róg — strzałka "do góry" siedzi po prawej */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c2);
  border: 1px solid rgba(123, 47, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  box-shadow: 0 0 20px rgba(102, 0, 255, 0.18);
  transition: all 0.3s ease;
  z-index: 500;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Celowo BEZ .visible i bez opacity:0 — w odróżnieniu od
   #backToTop ten przycisk jest widoczny od razu i cały czas.
   Wycofanie zgody musi być tak samo dostępne jak jej wyrażenie,
   więc nie może zależeć od tego, czy ktoś przewinął stronę. */

#mmCookieBtn:hover,
#mmCookieBtn:focus-visible {
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(102, 0, 255, 0.5);
  transform: translateY(-3px);
}

/* ---------- Baner pierwszej wizyty ---------- */

.mm-cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  background: rgba(10, 0, 21, 0.97);
  border-top: 1px solid rgba(123, 47, 255, 0.35);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.mm-cc-banner.visible { transform: translateY(0); }

.mm-cc-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.mm-cc-banner-text { flex: 1 1 420px; }
.mm-cc-banner-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Panel ustawień ---------- */

.mm-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}
.mm-cc-modal.visible { display: flex; }

.mm-cc-panel {
  background: var(--c1);
  border: 1px solid rgba(123, 47, 255, 0.35);
  border-radius: 6px;
  max-width: 560px;
  width: 100%;
  padding: 2rem;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 0 60px rgba(102, 0, 255, 0.25);
}

.mm-cc-group {
  padding: 1.1rem 0;
  border-top: 1px solid rgba(123, 47, 255, 0.18);
}
.mm-cc-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.mm-cc-group-head h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin: 0;
}
.mm-cc-always {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
  opacity: 0.75;
  white-space: nowrap;
}

.mm-cc-foot {
  padding-top: 1.1rem;
  border-top: 1px solid rgba(123, 47, 255, 0.18);
}
.mm-cc-panel-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

/* ---------- Typografia wspólna ---------- */

.mm-cc-h {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
  margin: 0 0 0.5rem;
}
.mm-cc-banner p,
.mm-cc-panel p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}
.mm-cc-small { font-size: 12px !important; color: var(--gray) !important; margin-bottom: 0.4rem !important; }
.mm-cc-panel a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.mm-cc-panel a:hover { color: var(--c6); }

/* ---------- Przyciski ---------- */

.mm-cc-btn {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* "Akceptuję wszystkie" i "Tylko niezbędne" dzielą tę samą
   klasę i wyglądają identycznie. To nie jest przeoczenie —
   odmowa nie może być wizualnie słabsza od zgody, bo wtedy
   zgoda przestaje być dobrowolna. */
.mm-cc-btn-primary {
  background: var(--gradient);
  border: none;
  color: var(--white);
  box-shadow: 0 0 18px rgba(102, 0, 255, 0.3);
}
.mm-cc-btn-primary:hover,
.mm-cc-btn-primary:focus-visible {
  box-shadow: 0 0 28px rgba(102, 0, 255, 0.6);
  transform: translateY(-2px);
}

.mm-cc-btn-ghost {
  background: none;
  border: 1px solid rgba(123, 47, 255, 0.45);
  color: var(--gray);
}
.mm-cc-btn-ghost:hover,
.mm-cc-btn-ghost:focus-visible {
  color: var(--white);
  border-color: var(--accent);
}

/* ---------- Przełącznik ---------- */

.mm-cc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.mm-cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.mm-cc-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(123, 47, 255, 0.4);
  border-radius: 26px;
  transition: all var(--transition);
  pointer-events: none;
}
.mm-cc-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray);
  border-radius: 50%;
  transition: all var(--transition);
}
.mm-cc-switch input:checked + .mm-cc-slider {
  background: var(--gradient);
  border-color: transparent;
}
.mm-cc-switch input:checked + .mm-cc-slider::before {
  transform: translate(20px, -50%);
  background: var(--white);
}
.mm-cc-switch input:focus-visible + .mm-cc-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Tylko dla czytników ekranu ---------- */

.mm-cc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Telefon ---------- */

@media (max-width: 600px) {
  #mmCookieBtn {
    bottom: 1.25rem;
    left: 1.25rem;
    width: 44px;
    height: 44px;
  }
  .mm-cc-banner { padding: 1.1rem; }
  .mm-cc-banner-actions { width: 100%; }
  .mm-cc-banner-actions .mm-cc-btn { flex: 1 1 100%; text-align: center; }
  .mm-cc-panel { padding: 1.4rem; }
  .mm-cc-panel-actions .mm-cc-btn { flex: 1 1 100%; text-align: center; }
}

/* Użytkownik prosił system o ograniczenie animacji — szanujemy to. */
@media (prefers-reduced-motion: reduce) {
  .mm-cc-banner,
  .mm-cc-slider,
  .mm-cc-slider::before,
  #mmCookieBtn,
  .mm-cc-btn { transition: none; }
  #mmCookieBtn:hover,
  .mm-cc-btn-primary:hover { transform: none; }
}
