/* ============================================================
   Cookie-баннер с уровнями согласия. Заявка CH-03.

   Правила вида взяты из дизайн-системы страницы: токены из
   styles.css (:root), Montserrat, квадратные углы, без теней.
   Своих цветов нет.

   Главное правило вёрстки здесь — три кнопки одного веса.
   «Лише необхідні» не серее и не меньше, чем «Прийняти все»:
   спрятанный отказ — основание для жалобы.
   ============================================================ */

.cc {
  position: fixed;
  z-index: 950;
  right: 0;
  bottom: 0;
  left: 0;
  color: var(--ink);
  background: var(--white);
  border-top: 2px solid var(--black);
}

.cc[hidden] { display: none; }

.cc__inner {
  display: grid;
  gap: 18px;
  width: min(100%, var(--max));
  max-height: 86svh;   /* режим настройки на узком экране не должен занимать всё */
  overflow-y: auto;
  margin-inline: auto;
  padding: 22px var(--x) 24px;
}

.cc__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.cc__body {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.cc__body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc__body a:hover { color: var(--black); background: var(--green); }

/* ---------- Уровни (режим «Налаштувати») ---------- */

.cc__levels {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.cc__levels[hidden] { display: none; }

.cc__level {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.cc__level:has(input:disabled) { cursor: default; }

.cc__level input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Переключатель — квадратный, как всё остальное на странице. */
.cc__switch {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border: 2px solid var(--black);
  background: var(--white);
  transition: background 180ms ease;
}

.cc__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--black);
  transition: transform 180ms ease;
}

.cc__level input:checked + .cc__switch { background: var(--green); }
.cc__level input:checked + .cc__switch::after { transform: translateX(20px); }

.cc__level input:disabled + .cc__switch { border-color: var(--muted); background: var(--green); }
.cc__level input:disabled + .cc__switch::after { background: var(--muted); transform: translateX(20px); }

.cc__level input:focus-visible + .cc__switch { outline: 3px solid var(--green); outline-offset: 4px; }

.cc__level strong { display: block; font-size: 14px; }
.cc__level span:last-child { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }

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

.cc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Один класс на все кнопки — вес одинаковый по определению. */
.cc__btn {
  min-height: 48px;
  padding: 12px 22px;
  border: 2px solid var(--black);
  color: var(--black);
  background: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease;
}

.cc__btn:hover { background: var(--green); }
.cc__btn[hidden] { display: none; }

@media (max-width: 860px) {
  .cc__inner { padding: 18px var(--x) 20px; }
  .cc__actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cc__btn { width: 100%; }
}
