/* ─── Cookie Consent — Themeable via CSS variables ──────────────────────────── */

:root {
  --cc-primary: #1a1a1a;
  --cc-bg: #ffffff;
  --cc-text: #333333;
  --cc-muted: #666666;
  --cc-border: #e0e0e0;
  --cc-btn-text: #ffffff;
  --cc-radius: 8px;
  --cc-font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cc-z: 99999;
}

/* ─── Banner ─────────────────────────────────────────────────────────────────── */

#cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--cc-z);
  background: var(--cc-bg);
  border-top: 1px solid var(--cc-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  font-family: var(--cc-font);
  font-size: 14px;
  color: var(--cc-text);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

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

.cc-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

.cc-banner-text {
  flex: 1;
  min-width: 260px;
}

.cc-banner-text strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--cc-primary);
}

.cc-banner-text p {
  margin: 0;
  line-height: 1.5;
  color: var(--cc-muted);
}

.cc-banner-text a {
  color: var(--cc-primary);
}

.cc-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */

.cc-btn {
  padding: 9px 18px;
  border-radius: var(--cc-radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  font-family: var(--cc-font);
  white-space: nowrap;
}

.cc-btn:hover {
  opacity: 0.85;
}

.cc-btn-primary {
  background: var(--cc-primary);
  color: var(--cc-btn-text);
}

.cc-btn-outline {
  background: transparent;
  color: var(--cc-primary);
  border: 1.5px solid var(--cc-primary);
}

/* ─── Language toggle ────────────────────────────────────────────────────────── */

.cc-lang-toggle {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--cc-muted);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--cc-font);
  padding: 0;
}

/* ─── Modal overlay ──────────────────────────────────────────────────────────── */

#cc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--cc-z) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#cc-modal-overlay.cc-visible {
  opacity: 1;
}

#cc-modal {
  background: var(--cc-bg);
  border-radius: var(--cc-radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  font-family: var(--cc-font);
  color: var(--cc-text);
}

.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--cc-border);
}

.cc-modal-header strong {
  font-size: 16px;
  color: var(--cc-primary);
}

#cc-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--cc-muted);
  line-height: 1;
  padding: 0 4px;
}

.cc-modal-body {
  padding: 8px 24px;
}

.cc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--cc-border);
}

/* ─── Category rows ──────────────────────────────────────────────────────────── */

.cc-category {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--cc-border);
}

.cc-category:last-child {
  border-bottom: none;
}

.cc-category-info {
  flex: 1;
}

.cc-category-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--cc-primary);
  margin-bottom: 4px;
}

.cc-category-desc {
  margin: 0;
  font-size: 13px;
  color: var(--cc-muted);
  line-height: 1.5;
}

.cc-category-control {
  flex-shrink: 0;
}

.cc-always-on {
  font-size: 12px;
  color: var(--cc-muted);
  font-style: italic;
}

/* ─── Toggle switch ──────────────────────────────────────────────────────────── */

.cc-toggle {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cc-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--cc-border);
  border-radius: 24px;
  transition: background 0.2s;
}

.cc-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cc-toggle input:checked + .cc-toggle-slider {
  background: var(--cc-primary);
}

.cc-toggle input:checked + .cc-toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Manage link (persistent) ───────────────────────────────────────────────── */

#cc-manage-link {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: var(--cc-z);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cc-bg);
  color: var(--cc-muted);
  border: 1px solid var(--cc-border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.15s;
  opacity: 0.6;
}

#cc-manage-link:hover {
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: scale(1.08);
}

/* ─── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .cc-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .cc-banner-actions {
    width: 100%;
  }

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

  .cc-lang-toggle {
    position: static;
    margin-top: 4px;
  }
}
