/* IT.Done(); — уведомление о cookie: снекбар + окно настроек.
   Отдельный файл, чтобы модуль можно было снять целиком.
   Переменные берутся из style.css (--pink, --mint, --font). */

/* ---------- Снекбар ---------- */

.cc-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: #101015;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
  transform: translateY(100%);
  transition: transform 0.35s ease;
}
.cc-bar.is-visible { transform: none; }

.cc-bar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.cc-bar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.cc-bar-text { color: rgba(255, 255, 255, 0.72); font-size: 0.88rem; line-height: 1.5; }
.cc-bar-text a { color: var(--mint); }
.cc-bar-text a:hover { color: var(--pink); }

.cc-bar-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.cc-btn { padding: 11px 22px; font-size: 0.85rem; }

/* Крестик снекбара = согласие со всем набором */
.cc-bar-close {
  flex: none;
  align-self: flex-start;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.cc-bar-close:hover { color: var(--pink); }

.cc-link-btn {
  background: none;
  border: none;
  padding: 6px 2px;
  font-family: var(--font);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
}
.cc-link-btn:hover { color: var(--mint); border-bottom-color: var(--mint); }

/* ---------- Окно настроек ---------- */

/* display НЕ задавать без :not([hidden]) — авторский display перебивает
   браузерный display:none у атрибута hidden, и оверлей перекрывает сайт. */
.cc-modal { position: fixed; inset: 0; z-index: 950; padding: 24px; }
.cc-modal:not([hidden]) { display: flex; align-items: center; justify-content: center; }
.cc-modal[hidden] { display: none; }
.cc-modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }

.cc-modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: #121218;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 28px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cc-modal.is-visible .cc-modal-card { opacity: 1; transform: none; }

.cc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cc-modal-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: #fff; }

.cc-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.cc-close:hover { color: var(--pink); }

.cc-modal-lead { color: rgba(255, 255, 255, 0.68); font-size: 0.88rem; line-height: 1.55; margin: 12px 0 22px; }

.cc-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }

.cc-item {
  background: #1a1a21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 18px;
}
.cc-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-item-title { font-weight: 700; color: #fff; font-size: 0.95rem; }
.cc-item-desc { color: rgba(255, 255, 255, 0.62); font-size: 0.82rem; line-height: 1.5; margin-top: 8px; }

.cc-tag {
  flex: none;
  font-size: 0.7rem;
  color: var(--mint);
  border: 1px solid rgba(0, 255, 200, 0.35);
  padding: 3px 8px;
}

/* Тумблер */
.cc-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.cc-switch-track {
  flex: none;
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 22px;
  background: #2c2c34;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.2s ease;
}
.cc-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease, background 0.2s ease;
}
.cc-switch input:checked + .cc-switch-track { background: rgba(0, 255, 200, 0.28); border-color: var(--mint); }
.cc-switch input:checked + .cc-switch-track::after { transform: translateX(20px); background: var(--mint); }
.cc-switch input:focus-visible + .cc-switch-track { outline: 2px solid var(--pink); outline-offset: 2px; }

/* Обязательные сервисы: тумблер виден, но выключить нельзя — гасим цвет,
   чтобы отличался от включённого по выбору. */
.cc-switch input:disabled ~ * { cursor: not-allowed; }
.cc-switch:has(input:disabled) { cursor: not-allowed; }
.cc-switch input:disabled + .cc-switch-track,
.cc-switch input:disabled:checked + .cc-switch-track {
  opacity: 0.4;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}
.cc-switch input:disabled:checked + .cc-switch-track::after { background: rgba(255, 255, 255, 0.5); }
.cc-switch input:disabled ~ .cc-item-title { color: rgba(255, 255, 255, 0.5); }

/* Ссылки на документы стороннего сервиса */
.cc-item-links { margin-top: 8px; font-size: 0.78rem; line-height: 1.5; }
.cc-links-head { color: rgba(255, 255, 255, 0.5); margin-right: 6px; }
.cc-item-links a { color: var(--mint); }
.cc-item-links a:not(:last-child)::after { content: ' ·'; color: rgba(255, 255, 255, 0.3); }
.cc-item-links a:hover { color: var(--pink); }

/* Список cookie внутри сервиса */
.cc-cookies { margin-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 12px; }
.cc-cookies-head { color: rgba(255, 255, 255, 0.5); font-size: 0.75rem; margin-bottom: 6px; }
.cc-cookies ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.cc-cookies li { color: rgba(255, 255, 255, 0.6); font-size: 0.78rem; line-height: 1.45; }
.cc-cookies code { color: var(--mint); font-family: var(--font); }
.cc-ttl { color: rgba(255, 255, 255, 0.38); }

.cc-modal-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

body.cc-locked { overflow: hidden; }

/* ---------- Адаптив ---------- */

@media (max-width: 860px) {
  .cc-bar-inner { flex-direction: column; align-items: stretch; gap: 14px; padding-top: 14px; padding-bottom: 14px; }
  .cc-bar-actions { flex-wrap: wrap; }
  .cc-btn { flex: 1 1 auto; }
  .cc-bar-text { font-size: 0.82rem; }
  /* В колонке крестик ушёл бы под кнопки — прижимаем его к верхнему углу. */
  .cc-bar-close { position: absolute; top: 10px; right: 14px; }
  .cc-bar-copy { padding-right: 26px; }
}

@media (max-width: 520px) {
  .cc-modal { padding: 0; }
  .cc-modal-card { max-height: 100vh; height: 100%; width: 100%; border: none; padding: 22px 18px 28px; }
  .cc-item-head { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-bar, .cc-modal-card { transition: none; }
  .cc-switch-track, .cc-switch-track::after { transition: none; }
}
