/* Cookie-consent banner (GDPR/ePrivacy).
   Self-contained styles — the banner is included on standalone brand templates
   AND on base.html legal pages, whose host stylesheets differ, so we do NOT rely
   on any page-level CSS variables here. Layout/behaviour is identical for every
   brand; each `.cc--<brand>` block only recolours the surface + accent to fit the
   brand's palette (see the per-brand CSS under app/static/brands/). */

/* Non-blocking, pinned to the bottom of the viewport. It never covers the whole
   page and never traps focus (role="region", not a modal). Hidden until consent.js
   decides the visitor still has to choose — this avoids a flash for people who
   already picked. No-JS visitors simply never get the optional marketing scripts. */
/* Positioned above brand nav drawers / lightboxes; below nothing else. */
#cookie-consent.cc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483000;
  display: none;
  box-sizing: border-box;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#cookie-consent.cc.cc--visible { display: block; }
#cookie-consent.cc * { box-sizing: border-box; }

.cc__panel {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 20px) clamp(16px, 3vw, 28px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  border: 1px solid var(--cc-line);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  background: var(--cc-surface);
  color: var(--cc-ink);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .16);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.cc__text {
  flex: 1 1 340px;
  min-width: 0;
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
}
.cc__text a {
  color: var(--cc-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc__text a:hover { text-decoration: none; }

.cc__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cc__btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
  padding: 12px 18px;
  border-radius: var(--cc-radius, 12px);
  border: 1px solid transparent;
  transition: transform .12s ease, filter .15s ease, background-color .15s ease;
}
.cc__btn:active { transform: translateY(1px); }
.cc__btn:focus-visible {
  outline: 3px solid var(--cc-focus);
  outline-offset: 2px;
}

/* "Tylko niezbędne" — quiet, outlined secondary action. */
.cc__btn--essential {
  background: transparent;
  color: var(--cc-ink);
  border-color: var(--cc-line-strong);
}
.cc__btn--essential:hover { background: var(--cc-ghost-hover); }

/* "Akceptuj" — the brand accent, primary action. */
.cc__btn--accept {
  background: var(--cc-accent);
  color: var(--cc-accent-on);
}
.cc__btn--accept:hover { filter: brightness(1.05); }

/* ---------- Per-brand palettes ---------- */

/* fotowrzutka — warm paper / gold ("Fotowrzutka" light marketing theme). */
.cc--fotowrzutka {
  --cc-surface: #FFFDF8;
  --cc-ink: #221F17;
  --cc-line: #E7DECE;
  --cc-line-strong: rgba(34, 31, 23, .28);
  --cc-ghost-hover: rgba(34, 31, 23, .05);
  --cc-link: #8F6317;
  --cc-accent: #E0A63C;
  --cc-accent-on: #1B1A12;
  --cc-focus: #B07A24;
  --cc-radius: 12px;
}

/* kadrygosci — Papeteria: cream paper, navy ink, gold hairlines. */
.cc--kadrygosci {
  --cc-surface: #FCF8EF;
  --cc-ink: #1B2440;
  --cc-line: #DFD3B8;
  --cc-line-strong: rgba(27, 36, 64, .32);
  --cc-ghost-hover: rgba(27, 36, 64, .06);
  --cc-link: #7C5F1E;
  --cc-accent: #1B2440;
  --cc-accent-on: #F8F2E4;
  --cc-focus: #B48A3C;
  --cc-radius: 6px;
}

/* cykfotke — Impreza: dark night-party purple, amber->coral accent. */
.cc--cykfotke {
  --cc-surface: #221636;
  --cc-ink: #F8F0EA;
  --cc-line: rgba(248, 240, 250, .16);
  --cc-line-strong: rgba(248, 240, 250, .38);
  --cc-ghost-hover: rgba(248, 240, 250, .08);
  --cc-link: #FFD98A;
  --cc-accent: #FF7A45;
  --cc-accent-on: #1E0F1B;
  --cc-focus: #FFB23A;
  --cc-radius: 10px;
}
.cc--cykfotke .cc__btn--accept {
  /* Match the brand's signature amber->coral gradient CTA. */
  background: linear-gradient(100deg, #FFB23A 0%, #FF7A45 46%, #FF5A76 100%);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  #cookie-consent.cc .cc__panel {
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
  }
  #cookie-consent.cc.cc--visible .cc__panel { transform: translateY(0); }
}

@media (max-width: 560px) {
  .cc__panel { gap: 12px; }
  .cc__actions { width: 100%; }
  .cc__btn { flex: 1 1 auto; text-align: center; }
}
