/* ═══════════════════════════════════════════════════
   PackBuddy – Cookie-Consent-Banner
   DSGVO / TTDSG compliant: equal-weight buttons,
   granular categories, no dark patterns
════════════════════════════════════════════════════ */

/* ── Overlay (only in detail mode on mobile) ── */
#pb-consent-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 99999;
  background: #161e23;
  border-top: 2px solid #95c11f;
  box-shadow: 0 -6px 40px rgba(0, 0, 0, .55);
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-size: .875rem;
  color: #fff;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
#pb-consent-banner.pb-cb--in  { transform: translateY(0); }
#pb-consent-banner.pb-cb--out { transform: translateY(110%); }

.pb-cb-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 28px 16px;
}

/* ── Simple view ── */
#pb-cb-simple {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}

.pb-cb-text { flex: 1; min-width: 260px; }

.pb-cb-title {
  font-size: 1rem;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
  color: #fff;
}
.pb-cb-body {
  color: rgba(255, 255, 255, .72);
  line-height: 1.6;
  margin: 0 0 6px;
}
.pb-cb-more {
  color: #95c11f;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
}
.pb-cb-more:hover { text-decoration: underline; }

/* ── Buttons (DSGVO: equal visual weight) ── */
.pb-cb-btns {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

.pb-cb-btn {
  padding: 10px 22px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: inherit;
  white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s;
  min-width: 140px;
  text-align: center;
}

/* Accept — green primary */
.pb-cb-btn--primary {
  background: #95c11f;
  color: #161e23;
  border-color: #95c11f;
}
.pb-cb-btn--primary:hover {
  background: #a8d422;
  border-color: #a8d422;
}

/* Decline — equal-weight outlined (DSGVO requirement: no visual disadvantage) */
.pb-cb-btn--secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .45);
}
.pb-cb-btn--secondary:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, .06);
}

/* Ghost (back button in detail view) */
.pb-cb-btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, .55);
  border-color: transparent;
  padding-left: 4px;
  min-width: 0;
}
.pb-cb-btn--ghost:hover { color: #fff; }

/* ── Detail / settings view ── */
#pb-cb-detail { }

.pb-cb-cats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 18px;
}

.pb-cb-cat {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 14px 16px;
}

.pb-cb-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.pb-cb-cat-name {
  font-weight: 600;
  font-size: .9rem;
}

.pb-cb-cat-desc {
  color: rgba(255, 255, 255, .6);
  font-size: .78rem;
  line-height: 1.55;
  margin: 0;
}

.pb-cb-always {
  font-size: .72rem;
  font-weight: 600;
  color: #95c11f;
  background: rgba(149, 193, 31, .12);
  border: 1px solid rgba(149, 193, 31, .3);
  border-radius: 20px;
  padding: 2px 10px;
  flex-shrink: 0;
}

/* ── Toggle switch ── */
.pb-cb-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.pb-cb-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.pb-cb-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .2);
  border-radius: 24px;
  cursor: pointer;
  transition: background .25s;
}
.pb-cb-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
}
.pb-cb-toggle input:checked + .pb-cb-slider { background: #95c11f; }
.pb-cb-toggle input:checked + .pb-cb-slider::before { transform: translateX(20px); }
.pb-cb-toggle input:focus-visible + .pb-cb-slider { outline: 2px solid #95c11f; outline-offset: 2px; }

/* Detail action row */
.pb-cb-btns--detail {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ── Legal footer strip ── */
.pb-cb-legal {
  font-size: .72rem;
  color: rgba(255, 255, 255, .38);
  margin: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
  padding-top: 10px;
}
.pb-cb-legal a {
  color: rgba(255, 255, 255, .45);
  text-decoration: none;
}
.pb-cb-legal a:hover { color: #95c11f; text-decoration: underline; }

/* ── Persistent cookie settings link in page footer/bar ── */
.pb-legal-bar {
  text-align: center;
  padding: 8px 16px;
  font-size: .72rem;
  color: rgba(255, 255, 255, .35);
  background: #161e23;
}
.pb-legal-bar a {
  color: rgba(255, 255, 255, .4);
  text-decoration: none;
  margin: 0 6px;
}
.pb-legal-bar a:hover { color: #95c11f; }

/* ── RTL ── */
[dir="rtl"] .pb-cb-btns             { flex-direction: row-reverse; }
[dir="rtl"] .pb-cb-btns--detail     { justify-content: flex-start; flex-direction: row-reverse; }
[dir="rtl"] .pb-cb-btn--ghost       { padding-left: 22px; padding-right: 4px; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .pb-cb-inner { padding: 16px 16px 12px; }

  #pb-cb-simple { flex-direction: column; gap: 14px; align-items: stretch; }

  .pb-cb-btns { flex-direction: column; width: 100%; }
  .pb-cb-btn  { min-width: 0; width: 100%; }

  .pb-cb-btns--detail { flex-direction: row; }
}
