/* ===== BLOCK: cookie-banner =====
   Картка в лівому нижньому куті (праворуч — плаваючі кнопки чату / «Нагору»),
   на телефонах — на всю ширину знизу. Не блокує сторінку. */
.cookie-banner {
  position: fixed;
  left: clamp(12px, 1.6vw, 30px);
  bottom: clamp(12px, 1.6vw, 30px);
  z-index: 60; /* над плаваючими кнопками (40) */
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(20px, 1.6vw, 28px);
  border: 1px solid var(--c-gray-200);
  border-radius: var(--r-lg);
  background: var(--c-white);
  color: var(--c-ink);
  box-shadow: 0 24px 60px rgba(31,26,23,.18);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .35s ease, transform .45s var(--ease-out);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner.is-visible { opacity: 1; transform: none; }

.cookie-banner__title {
  font-family: var(--ff-head);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}
.cookie-banner__text {
  margin-top: 10px;
  color: var(--c-ink-2);
  font-size: .875rem;
  line-height: 1.6;
}
.cookie-banner__text a {
  color: var(--c-orange-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-banner__text a:hover { color: var(--c-ink); }

/* ---- Налаштування: категорії з перемикачами ---- */
.cookie-banner__settings {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.cookie-banner__settings[hidden] { display: none; }
.cookie-banner__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--c-gray-100);
}
.cookie-banner__option-title {
  display: block;
  font-family: var(--ff-head);
  font-size: .875rem;
  font-weight: 700;
}
.cookie-banner__option-text {
  margin-top: 2px;
  color: var(--c-ink-2);
  font-size: .8125rem;
  line-height: 1.45;
}

/* Перемикач: нативний checkbox поверх доріжки (клік і клавіатура — нативні) */
.cookie-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
}
.cookie-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.cookie-switch input:disabled { cursor: not-allowed; }
.cookie-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #B8B3AE;
  transition: background-color .2s ease;
}
.cookie-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-white);
  box-shadow: 0 1px 3px rgba(31,26,23,.3);
  transition: transform .25s var(--ease-out);
}
.cookie-switch input:checked + .cookie-switch__track { background: var(--c-orange); }
.cookie-switch input:checked + .cookie-switch__track::after { transform: translateX(18px); }
.cookie-switch input:disabled + .cookie-switch__track { opacity: .55; }
.cookie-switch input:focus-visible + .cookie-switch__track { outline: 2px solid var(--c-orange); outline-offset: 2px; }

/* ---- Кнопки ---- */
.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.cookie-banner__btn { flex: 1 1 150px; min-height: 46px; padding: .6em 1.2em; font-size: .9375rem; }
.cookie-banner__btn[hidden] { display: none; }
/* Коли налаштування відкриті — головна дія «Зберегти вибір» */
.cookie-banner.is-expanded [data-cookie-accept] { display: none; }
.cookie-banner__more {
  flex-basis: 100%;
  min-height: 36px;
  color: var(--c-ink-2);
  font-family: var(--ff-head);
  font-size: .8125rem;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-banner__more:hover { color: var(--c-ink); }
.cookie-banner.is-expanded .cookie-banner__more { order: 3; }

/* Кнопка «Налаштування cookies» у футері — виглядає як посилання */
.site-footer__cookie-btn {
  color: inherit;
  font: inherit;
  text-align: left;
  transition: color .2s ease;
}
.site-footer__cookie-btn:hover { color: var(--c-white); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 768px) {
  .site-footer__cookie-btn { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 576px) {
  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    border-radius: var(--r-md);
  }
  .cookie-banner__btn { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner, .cookie-switch__track, .cookie-switch__track::after { transition: none; }
  .cookie-banner { transform: none; }
}
/* ===== /BLOCK: cookie-banner ===== */
