/* ═══════════════════════════════════════════════
   Cookies Banner — Frontend Styles v1.2.0
   ═══════════════════════════════════════════════ */

:root {
  --cb-brand:      #C8174B;
  --cb-bg:         #ffffff;
  --cb-text:       #1a1a1a;
  --cb-overlay:    rgba(0, 0, 0, 0.5);
  --cb-radius:     20px;
  --cb-shadow:     0 12px 60px rgba(0, 0, 0, 0.22);
  --cb-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cb-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Overlay ──────────────────────────────────── */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: var(--cb-overlay);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--cb-transition);
}
.cb-overlay.cb-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Banner shell ─────────────────────────────── */
.cb-banner {
  position: fixed;
  z-index: 99999;
  background: var(--cb-bg);
  color: var(--cb-text);
  font-family: var(--cb-font);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  width: 680px;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--cb-transition), transform var(--cb-transition);
  pointer-events: none;
}
.cb-banner.cb-banner--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ── Positions ───────────────────────────────── */
.cb-banner[data-position="bottom-center"] {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
}
.cb-banner[data-position="bottom-center"].cb-banner--visible {
  transform: translateX(-50%) translateY(0);
}
.cb-banner[data-position="bottom-left"] {
  bottom: 24px;
  left: 24px;
}
.cb-banner[data-position="bottom-right"] {
  bottom: 24px;
  right: 24px;
}
.cb-banner[data-position="center"] {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
}
.cb-banner[data-position="center"].cb-banner--visible {
  transform: translate(-50%, -50%) scale(1);
}

/* ── Panels ──────────────────────────────────── */
.cb-panel {
  display: none;
  padding: 40px 44px 36px;
}
.cb-panel.cb-panel--active {
  display: block;
}
.cb-panel--slide-out {
  animation: cbSlideOut 0.22s ease forwards;
}
.cb-panel--slide-in {
  animation: cbSlideIn 0.22s ease forwards;
}
@keyframes cbSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-20px); }
}
@keyframes cbSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Two-line Heading ────────────────────────── */
.cb-heading {
  margin: 0 0 20px;
  line-height: 1.15;
  font-style: italic;
  text-transform: uppercase;
}

/* Line 1 — lighter color (e.g. sky blue), thinner weight */
.cb-heading__line1 {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--cb-heading-line1, #4fa3e0);
  letter-spacing: 0.01em;
}

/* Line 2 — dark navy, heavier weight */
.cb-heading__line2 {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: var(--cb-heading-line2, #00377d);
  letter-spacing: 0.01em;
}

/* Fallback: single heading (prefs panel uses same heading) */
.cb-heading--single {
  font-size: 22px;
  font-weight: 800;
  color: var(--cb-brand);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Body text ───────────────────────────────── */
.cb-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--cb-text);
  margin: 0 0 28px;
  opacity: 0.9;
}

/* ── Actions row (main panel) ────────────────── */
.cb-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ── Prefs actions row ───────────────────────── */
.cb-prefs-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

/* ── Buttons ─────────────────────────────────── */
.cb-btn {
  font-family: var(--cb-font);
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  border-radius: 50px !important;        /* pill shape */
  padding: 14px 34px !important;
  transition: background var(--cb-transition), color var(--cb-transition), opacity 0.15s, transform 0.12s;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.cb-btn:hover {
  transform: translateY(-1px);
}
.cb-btn:active {
  transform: translateY(0);
}
.cb-btn:focus-visible {
  outline: 0 !important;
  outline-offset: 0 !important;
}

/* Primary — navy background, yellow text */
.cb-btn--primary {
  background: #00377d;
  color: #ffd100;
}
.cb-btn--primary:hover {
  background: #002d68;
  opacity: 1;
}

/* Full-width variant */
.cb-btn--full {
  flex: 1;
  text-align: center;
}

/* Secondary — light blue background, white text */
.cb-btn--secondary {
  background: #5f99d2;
  color: #ffffff;
}
.cb-btn--secondary:hover {
  background: #4d8ac4;
  opacity: 1;
}

/* Text link — navy underlined */
.cb-btn--text {
  background: none;
  color: #00377d;
  padding: 14px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  border-radius: 4px;
  font-size: 15px;
}
.cb-btn--text:hover {
  color: #002d68;
  background: none;
  text-decoration: underline;
}

/* ── Groups list ─────────────────────────────── */
.cb-groups {
  border-top: 1px solid #ebebeb;
  padding-top: 4px;
}
.cb-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #f2f2f2;
  gap: 12px;
}
.cb-group:last-child { border-bottom: none; }

.cb-group__info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.cb-group__number {
  font-size: 13px;
  font-weight: 700;
  color: #00377d;
  min-width: 24px;
  padding-top: 1px;
  letter-spacing: 0.02em;
}
.cb-group__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cb-group__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-text);
}
.cb-group__desc {
  font-size: 12px;
  color: #888;
}
.cb-group__control { flex-shrink: 0; }

/* ── "ALWAYS ACTIVE" badge ───────────────────── */
.cb-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #888;
  border: 1.5px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   Toggle Switch
   ══════════════════════════════════════════════ */
.cb-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cb-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}
.cb-toggle__track {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  background: #d0d0d0;
  border-radius: 13px;
  transition: background var(--cb-transition);
  flex-shrink: 0;
}
.cb-toggle__input:checked + .cb-toggle__track {
  background: #00377d;
}
.cb-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  transition: transform var(--cb-transition), box-shadow var(--cb-transition);
}
.cb-toggle__input:checked ~ .cb-toggle__track .cb-toggle__thumb,
.cb-toggle__input:checked + .cb-toggle__track .cb-toggle__thumb {
  transform: translateX(22px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}
.cb-toggle__input:focus-visible + .cb-toggle__track {
  outline: 3px solid #4fa3e0;
  outline-offset: 2px;
}

/* ── Hidden state ────────────────────────────── */
.cb-banner--hidden,
.cb-overlay--hidden {
  display: none !important;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 720px) {
  .cb-banner {
    width: calc(100vw - 24px);
    border-radius: 16px;
  }
  .cb-banner[data-position="bottom-center"],
  .cb-banner[data-position="bottom-left"],
  .cb-banner[data-position="bottom-right"] {
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
  }
  .cb-banner[data-position="bottom-center"] {
    transform: translateY(24px);
  }
  .cb-banner[data-position="bottom-center"].cb-banner--visible {
    transform: translateY(0);
  }
  .cb-panel { padding: 28px 22px 22px; }
  .cb-heading__line1 { font-size: 22px; }
  .cb-heading__line2 { font-size: 24px; }
  .cb-body { font-size: 14px; }
  .cb-actions { flex-direction: column; align-items: stretch; }
  .cb-btn { width: 100%; text-align: center; padding: 14px 20px; }
  .cb-btn--text { width: auto; text-align: center; }
  .cb-prefs-actions { flex-direction: column; align-items: stretch; }
  .cb-btn--full { width: 100%; }
}

/* ── Reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cb-banner, .cb-overlay, .cb-toggle__track, .cb-toggle__thumb, .cb-btn {
    transition: none !important;
    animation: none !important;
  }
}
