/* Всплывающие элементы без наложений. Yakobson Digital, 11.11.2026, модуль popups (tools/yd/popups.py).
   Жалоба клиента: «всплывающие уведомления наслаиваются поверх друг друга» (F8, crawl-17).

   Слои снизу вверх (z-index):
     шапка 99, плавающие кнопки звонка/MAX/Telegram 9
     cookie-плашка CookieYes 9999999 (как в плагине)
     мобильное меню 10000000            (было 9999, плашка закрывала его низ), кнопка меню над ним 10000001
     окна форм и «Отправлено» 10000001  (было 9999998, ниже плашки: она закрывала «Отправить» и «Отправлено»;
                                         своё окно «Спасибо» модуля forms .mmm-thanks тоже 10000001)
     короткие уведомления (тосты) 10000002 (было 9000, их закрывали плашка и окна)
     окно настроек cookie CookieYes 999999999 (как в плагине, его открывают кнопкой «Настроить»)
   Пока cookie-плашка открыта, плавающие кнопки стоят над ней, а не под ней: высоту плашки даёт mmm-popups.js
   (переменная --mmm-cky-h), без него берётся запас по высоте. Сам CookieYes, его тексты и цвета не меняем. */

/* ── порядок слоёв ── */
html body .mobile-menu.active { z-index: 10000000; }
html body .burger-open { z-index: 10000001; }  /* кнопка меню (крестик) остаётся над открытым меню */
html body .header-fixed:has(.mobile-menu.active) { z-index: 10000000; }  /* меню из закреплённой шапки */
html body .popup { z-index: 10000001 !important; }
html body .jq-toast-wrap { z-index: 10000002 !important; }

/* ── плавающие кнопки над открытой cookie-плашкой ──
   Два правила отдельно: браузер без :has() отбросил бы общее правило целиком. */
html.mmm-cky-open body .fixed-social { bottom: calc(var(--mmm-cky-h, 240px) + 16px) !important; }
html body:has(> .cky-consent-container:not(.cky-hide)) .fixed-social { bottom: calc(var(--mmm-cky-h, 240px) + 16px) !important; }
html body .fixed-social { transition: none !important; }  /* у темы transition: all .2s: столбик полз бы под плашкой */

/* ── компактная cookie-плашка на телефоне и планшете (была до 49% экрана: 393–417 px из 844) ── */
@media (max-width: 768px) {
  html body .cky-consent-container .cky-consent-bar { padding: 10px 0 12px; }
  html body .cky-consent-container .cky-notice .cky-title {
    font-size: 14px; line-height: 18px; margin: 0 0 4px; padding: 0 16px;
  }
  html body .cky-consent-container .cky-notice-des {
    padding: 0 16px; font-size: 12px; line-height: 16px; max-height: 80px; overflow-y: auto;
  }
  html body .cky-consent-container .cky-notice-des * { font-size: 12px; line-height: 16px; }
  html body .cky-consent-container .cky-notice-btn-wrapper {
    display: flex; flex-direction: row; flex-wrap: wrap; justify-content: stretch; gap: 6px;
    padding: 0 16px; margin: 8px 0 0;
  }
  html body .cky-consent-container .cky-notice-btn-wrapper .cky-btn {
    flex: 1 1 auto; width: auto; min-width: 0; max-width: none; margin: 0;
    padding: 8px 6px; font-size: 13px; line-height: 16px; white-space: nowrap;
  }
  /* столбик кнопок справа на всех страницах, как в последней версии сайта (снимки июля 2026: главная,
     /zayment-warranty/, /product/chic/); на страницах из снимков апреля–июня он был слева, на тексте */
  html body .fixed-social { right: 2rem !important; left: auto !important; }
  html.mmm-cky-open body .fixed-social { bottom: calc(var(--mmm-cky-h, 200px) + 12px) !important; }
  html body:has(> .cky-consent-container:not(.cky-hide)) .fixed-social { bottom: calc(var(--mmm-cky-h, 200px) + 12px) !important; }
}

/* ── короткие уведомления (тосты): сверху, не под плашкой, не на плавающих кнопках, не мешают нажатиям ── */
html body .jq-toast-wrap,
html body .jq-toast-wrap.bottom-left, html body .jq-toast-wrap.bottom-right,
html body .jq-toast-wrap.top-left, html body .jq-toast-wrap.top-right,
html body .jq-toast-wrap.bottom-center, html body .jq-toast-wrap.top-center, html body .jq-toast-wrap.mid-center {
  top: 96px !important; right: 24px !important; bottom: auto !important; left: auto !important;
  width: 300px !important; min-width: 0 !important; max-width: calc(100vw - 48px) !important;
}
html body .jq-toast-wrap .jq-toast-single { pointer-events: none !important; }
html body .jq-toast-wrap .close-jq-toast-single { pointer-events: auto !important; }
@media (max-width: 768px) {
  html body .jq-toast-wrap,
  html body .jq-toast-wrap.bottom-left, html body .jq-toast-wrap.bottom-right,
  html body .jq-toast-wrap.top-left, html body .jq-toast-wrap.top-right,
  html body .jq-toast-wrap.bottom-center, html body .jq-toast-wrap.top-center, html body .jq-toast-wrap.mid-center {
    top: calc(6rem + 8px) !important; left: 12px !important;  /* ниже крестика окна формы (2rem + 4rem) */ right: 12px !important; width: auto !important; max-width: none !important;
  }
}

/* ── одно уведомление после заявки: пока открыто «Отправлено», тосты не показываем ── */
html body:has(.popup-thanks[style*="flex"]) .jq-toast-wrap { display: none !important; }
html body:has(> .mmm-thanks) .jq-toast-wrap { display: none !important; }
