:root {
  --cc-bg: #202b38;
  --cc-text: #f4f4f4;
  --cc-muted: #b6c0cb;
  --cc-accent: #0d6efd;
  --cc-accent-hover: #0b5ed7;
  --cc-radius: 10px;
  --cc-font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --cc-font-serif: "IBM Plex Serif", Georgia, serif;
}

/* ---------- Banner ---------- */

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1080;
  background: var(--cc-bg);
  color: var(--cc-text);
  padding: 1rem 1.25rem;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  font-family: var(--cc-font);
  box-sizing: border-box;
}

.cc-banner * {
  box-sizing: border-box;
}

.cc-banner.is-visible {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner {
    transition: none;
  }
}

.cc-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.cc-banner__text {
  flex: 1 1 320px;
  font-family: var(--cc-font);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--cc-muted);
  margin: 0;
}

.cc-banner__text strong {
  color: var(--cc-text);
}

.cc-banner__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@media (max-width: 575.98px) {
  .cc-banner {
    padding: 0.85rem 1rem;
  }
  .cc-banner__inner {
    display: block;
  }
  .cc-banner__text {
    display: block;
    font-size: 0.86rem;
    margin-bottom: 0.65rem;
  }
  .cc-banner__actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }
  .cc-banner__actions .cc-btn {
    flex: 1 1 auto;
    padding: 0.5rem 0.75rem;
  }
}

/* ---------- Buttons (self-contained; do not rely on Bootstrap's .btn) ---------- */

.cc-btn {
  font-family: var(--cc-font);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.55rem 1.15rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cc-btn-primary {
  background: var(--cc-accent);
  border-color: var(--cc-accent);
  color: #fff;
}
.cc-btn-primary:hover {
  background: var(--cc-accent-hover);
  border-color: var(--cc-accent-hover);
}

.cc-btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--cc-text);
}
.cc-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cc-btn-link {
  background: none;
  border: none;
  padding: 0.55rem 0.25rem;
  color: var(--cc-muted);
  text-decoration: underline;
  font-family: var(--cc-font);
  font-size: 0.88rem;
  cursor: pointer;
}
.cc-btn-link:hover,
.cc-btn-link:focus-visible {
  color: var(--cc-text);
}

.cc-banner button:focus-visible,
.cc-banner a:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

/* ---------- "Cookie Preferences" footer trigger ---------- */

.cookie-preferences-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.cookie-preferences-toggle:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

/* ---------- Preferences Modal (fully custom — no Bootstrap .modal classes) ---------- */

.cc-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 22, 0.55);
  z-index: 1090;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.cc-modal-overlay.is-open {
  display: flex;
}

.cc-modal-box {
  background: #fff;
  color: #2b2b2b;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--cc-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: var(--cc-font);
  box-sizing: border-box;
}

.cc-modal-box * {
  box-sizing: border-box;
}

.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #eee;
}

.cc-modal-title {
  font-family: var(--cc-font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0;
  color: #202b38;
}

.cc-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem;
  min-width: 44px;
  min-height: 44px;
}
.cc-modal-close:hover {
  color: #202b38;
}
.cc-modal-close:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.cc-modal-body {
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.cc-modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
}

.cc-category {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid #eee;
}
.cc-category:last-of-type {
  border-bottom: none;
}

.cc-category__label {
  font-weight: 600;
  margin-bottom: 0.15rem;
  font-size: 0.94rem;
}

.cc-category__desc {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 0;
}

/* ---------- Mobile tuning (narrow phones, ~480px and below) ---------- */
@media (max-width: 480px) {
  .cc-modal-overlay {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .cc-modal-box {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--cc-radius) var(--cc-radius) 0 0;
  }

  .cc-modal-header,
  .cc-modal-body,
  .cc-modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .cc-modal-title {
    font-size: 1.08rem;
  }

  .cc-category {
    gap: 0.75rem;
  }

  .cc-category__desc {
    font-size: 0.82rem;
  }

  .cc-modal-footer .cc-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

.cc-status-note {
  font-size: 0.82rem;
  color: #6c757d;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ---------- Custom toggle switch (replaces Bootstrap's form-switch) ---------- */

.cc-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cc-switch__track {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 999px;
  transition: background-color 0.15s ease;
  pointer-events: none;
}

.cc-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.cc-switch input:checked + .cc-switch__track {
  background: var(--cc-accent);
}
.cc-switch input:checked + .cc-switch__track .cc-switch__thumb {
  transform: translateX(18px);
}
.cc-switch input:disabled + .cc-switch__track {
  opacity: 0.55;
}
.cc-switch input:disabled {
  cursor: default;
}
.cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}