/* ==========================================================================
   AdBilling — баннер согласия на cookie
   Светлая и тёмная тема. Переменные можно переопределить под сайт.
   ========================================================================== */

.cc-root {
  --cc-bg: #ffffff;
  --cc-fg: #14171f;
  --cc-muted: #5b6272;
  --cc-border: #e3e6ec;
  --cc-accent: #2f6bff;
  --cc-accent-fg: #ffffff;
  --cc-surface: #f5f7fa;
  --cc-shadow: 0 12px 40px rgba(16, 22, 38, .18);
  --cc-radius: 14px;

  position: fixed;
  z-index: 2147483000;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cc-fg);
}

/* Тёмная тема: подставьте селектор, который реально использует сайт */
body.dark .cc-root,
html[data-theme="dark"] .cc-root,
.cc-root[data-theme="dark"] {
  --cc-bg: #171a21;
  --cc-fg: #eef1f6;
  --cc-muted: #9aa3b4;
  --cc-border: #2a2f3a;
  --cc-surface: #1f232c;
  --cc-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

.cc-root.is-visible { display: block; }

.cc-panel {
  max-width: 460px;
  margin-left: auto;
  margin-right: 0;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  overflow: hidden;
}

@media (max-width: 560px) {
  .cc-root { left: 10px; right: 10px; bottom: 10px; }
  .cc-panel { max-width: none; }
}

.cc-body { padding: 20px 20px 16px; }

.cc-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.cc-text {
  margin: 0;
  color: var(--cc-muted);
  font-size: 14px;
}

.cc-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-text a:hover { color: var(--cc-accent); }

/* --- Кнопки --- */

.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.cc-btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--cc-border);
  background: var(--cc-bg);
  color: var(--cc-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.cc-btn:hover { background: var(--cc-surface); }

/* Принять и отклонить выглядят одинаково по весу — это требование GDPR */
.cc-btn--primary {
  background: var(--cc-accent);
  border-color: var(--cc-accent);
  color: var(--cc-accent-fg);
}

.cc-btn--primary:hover { filter: brightness(1.08); background: var(--cc-accent); }

.cc-btn--link {
  flex: 1 1 100%;
  min-width: 0;
  border: none;
  background: none;
  padding: 4px 0 0;
  color: var(--cc-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-btn--link:hover { background: none; color: var(--cc-accent); }

.cc-btn:focus-visible,
.cc-switch input:focus-visible + .cc-switch-track {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

/* --- Настройки категорий --- */

.cc-settings {
  display: none;
  border-top: 1px solid var(--cc-border);
  background: var(--cc-surface);
  padding: 8px 20px 4px;
  max-height: 46vh;
  overflow-y: auto;
}

.cc-root.is-expanded .cc-settings { display: block; }

.cc-cat {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--cc-border);
}

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

.cc-cat-info { flex: 1; min-width: 0; }

.cc-cat-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.cc-cat-desc {
  margin: 0;
  font-size: 13px;
  color: var(--cc-muted);
}

.cc-cat-locked {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--cc-muted);
  padding-top: 3px;
  white-space: nowrap;
}

/* Переключатель */

.cc-switch {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  padding-top: 1px;
}

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

.cc-switch-track {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--cc-border);
  transition: background .18s ease;
  pointer-events: none;
}

.cc-switch-track::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .18s ease;
}

.cc-switch input:checked + .cc-switch-track { background: var(--cc-accent); }
.cc-switch input:checked + .cc-switch-track::after { transform: translateX(18px); }

/* --- Кнопка повторного открытия настроек --- */

.cc-reopen {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 2147482000;
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--cc-border, #e3e6ec);
  background: var(--cc-bg, #fff);
  color: var(--cc-muted, #5b6272);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 22, 38, .12);
}

.cc-reopen.is-visible { display: block; }
.cc-reopen:hover { color: var(--cc-accent, #2f6bff); }

/* --- Заглушка для заблокированных встраиваний (карта, видео) --- */

.cc-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 240px;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--cc-border, #e3e6ec);
  border-radius: 12px;
  color: var(--cc-muted, #5b6272);
  font-size: 14px;
}

/* --- Доступность --- */

@media (prefers-reduced-motion: reduce) {
  .cc-root *, .cc-reopen { transition: none !important; }
}
