﻿/* =====================================================================
   Cookie-баннер — официальный сайт Находкинского городского округа
   Все селекторы в namespace .cc-*, правила не лезут на вёрстку сайта.
   ===================================================================== */

.cc-banner {
  position: fixed;
  z-index: 2147483646;
  left: 24px;
  bottom: 24px;
  width: auto;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding: 22px 24px 20px;
  background: #fff;
  color: #1b2733;
  border: 1px solid #d7e0ea;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(12, 30, 60, .28);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  visibility: hidden;
  opacity: 0;
  -webkit-transform: translateY(18px);
          transform: translateY(18px);
  /* visibility переключаем без анимации: при открытии — сразу (доступен для фокуса
     и скринридера), при закрытии — с задержкой, чтобы успел проиграться fade-out */
  -webkit-transition: opacity .25s ease, -webkit-transform .25s ease, visibility 0s linear .25s;
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}

/* класс cc-open навешивается на <html>, когда баннер показан */
html.cc-open .cc-banner {
  visibility: visible;
  opacity: 1;
  -webkit-transform: none;
          transform: none;
  -webkit-transition: opacity .25s ease, -webkit-transform .25s ease, visibility 0s linear 0s;
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear 0s;
}

/* «плавающие» кнопки сайта не должны накладываться на баннер */
html.cc-open body > .scroll-up,
html.cc-open body > .to-top,
html.cc-open body > .toTop,
html.cc-open body > .up-btn,
html.cc-open body > .fixed-chat { display: none !important; }

.cc-banner__title { margin: 0 0 10px; font-size: 18px; line-height: 1.35; font-weight: 700; color: #0e3a5f; }

.cc-banner__text { margin: 0 0 10px; }
.cc-banner__text:last-of-type { margin-bottom: 0; }

.cc-banner__link,
.cc-banner__link:visited { color: #0b60a8; text-decoration: underline; text-underline-offset: 2px; }
.cc-banner__link:hover,
.cc-banner__link:focus { color: #08477c; text-decoration: none; }

/* ---------- панель «Настроить» ---------- */
.cc-banner__settings {
  display: none;
  margin: 16px 0 0;
  padding: 14px 16px 12px;
  background: #f4f7fa;
  border: 1px solid #dde5ee;
  border-radius: 10px;
}
.cc-banner.cc-open-settings .cc-banner__settings { display: block; }
.cc-banner__settings[hidden] { display: none !important; }   /* страховка */

.cc-banner__settings-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: #0e3a5f; }
.cc-banner__note { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: #5b6b7c; }
.cc-banner__status { margin: 0; height: 0; overflow: hidden; }

/* ---------- переключатели категорий ---------- */
.cc-opt { position: relative; padding-left: 30px; margin-bottom: 10px; }
.cc-opt:last-of-type { margin-bottom: 0; }

.cc-opt input[type=checkbox] {
  position: absolute; left: 0; top: 2px;
  width: 18px; height: 18px; margin: 0;
  accent-color: #0b60a8; cursor: pointer;
}
.cc-opt input[type=checkbox]:disabled { cursor: default; }

.cc-opt__label { display: block; font-weight: 600; cursor: pointer; }
.cc-opt input[type=checkbox]:disabled + .cc-opt__label { color: #5b6b7c; }
.cc-opt__desc { display: block; font-size: 13px; font-weight: 400; line-height: 1.45; color: #5b6b7c; }

/* ---------- кнопки ---------- */
.cc-banner__btns {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -ms-flex-wrap: wrap; flex-wrap: wrap;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 10px; margin-top: 18px;
}

.cc-btn {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  box-sizing: border-box;
  display: inline-block;
  min-height: 44px;                 /* зона нажатия по рекомендациям доступности */
  margin: 0; padding: 11px 18px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  text-align: center; text-decoration: none; cursor: pointer;
  -webkit-transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.cc-btn::-moz-focus-inner { padding: 0; border: 0; }
.cc-btn:focus { outline: none; }
.cc-btn:focus-visible { outline: 3px solid #ffb64d; outline-offset: 2px; }

.cc-btn_primary { background: #0e5fa3; color: #fff; }
.cc-btn_primary:hover { background: #0b4c84; color: #fff; }
.cc-btn_primary:active { background: #093f6e; color: #fff; }

.cc-btn_secondary { border-color: #b9c6d4; background: #fff; color: #0e3a5f; }
.cc-btn_secondary:hover { border-color: #91a4b8; background: #eaf0f6; color: #0b3960; }
.cc-btn_secondary:active { background: #dde7f1; }

/* ---------- планшет ---------- */
@media (max-width: 900px) {
  .cc-banner { left: 16px; right: 16px; bottom: 16px; width: auto; max-width: none; padding: 20px; }
}

/* ---------- мобильные: баннер на всю ширину, кнопки в столбик ---------- */
@media (max-width: 560px) {
  .cc-banner {
    left: 0; right: 0; bottom: 0;
    padding: 18px 16px calc(16px + constant(safe-area-inset-bottom));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    max-height: 82vh; font-size: 14px;
  }
  .cc-banner__title { font-size: 17px; }
  .cc-banner__btns {
    -webkit-box-orient: vertical; -webkit-box-direction: reverse;
        -ms-flex-direction: column-reverse; flex-direction: column-reverse;
    -webkit-box-align: stretch; -ms-flex-align: stretch; align-items: stretch;
    gap: 8px;
  }
  .cc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-btn { -webkit-transition: none; transition: none; }
  .cc-banner { -webkit-transform: none; transform: none; }
}

@media print { .cc-banner { display: none !important; } }
