/* ===== Протокол24 — legal modal force center v2.0.10 ===== */

/*
  Жёсткий фикс именно реальных классов popup из v1.9.
  v2.0.7 случайно сжал сам overlay через max-width.
  Здесь возвращаем overlay на весь viewport.
*/

html.p24-legal-modal-lock-force-v210,
body.p24-legal-modal-lock-force-v210,
body.p24-legal-modal-lock-v19 {
  overflow: hidden !important;
}

/* Сам overlay — всегда весь экран, а не левая часть */
body .p24-legal-modal-v19,
html body .p24-legal-modal-v19,
body .p24-legal-modal-v19.is-open,
html body .p24-legal-modal-v19.is-open {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;

  width: 100vw !important;
  max-width: none !important;
  min-width: 100vw !important;

  height: 100vh !important;
  max-height: none !important;
  min-height: 100vh !important;

  margin: 0 !important;
  padding: 24px !important;

  display: none !important;
  align-items: center !important;
  justify-content: center !important;

  overflow: hidden !important;
  box-sizing: border-box !important;

  background: rgba(6, 18, 38, 0.64) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;

  z-index: 2147483000 !important;

  transform: none !important;
  translate: none !important;
}

body .p24-legal-modal-v19.is-open,
html body .p24-legal-modal-v19.is-open {
  display: flex !important;
}

/* Само белое окно строго по центру */
body .p24-legal-modal-v19 .p24-legal-modal-dialog-v19,
html body .p24-legal-modal-v19 .p24-legal-modal-dialog-v19,
body .p24-legal-modal-v19.is-open .p24-legal-modal-dialog-v19,
html body .p24-legal-modal-v19.is-open .p24-legal-modal-dialog-v19 {
  position: relative !important;

  width: min(1080px, calc(100vw - 48px)) !important;
  max-width: min(1080px, calc(100vw - 48px)) !important;
  min-width: 0 !important;

  height: min(86vh, 820px) !important;
  max-height: calc(100vh - 48px) !important;
  min-height: 0 !important;

  margin: 0 auto !important;
  padding: 0 !important;

  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;

  transform: none !important;
  translate: none !important;

  border-radius: 24px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Внутренности окна */
body .p24-legal-modal-v19 .p24-legal-modal-head-v19 {
  flex: 0 0 auto !important;
}

body .p24-legal-modal-v19 .p24-legal-modal-frame-v19 {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  height: 100% !important;
  min-height: 0 !important;

  border: 0 !important;
  box-sizing: border-box !important;
  overflow: auto !important;
}

/* Перебиваем ошибочные правила v2.0.7, где max-width навешивался на overlay */
body .p24-legal-modal-v19[data-p24-legal-modal],
body .p24-legal-modal-v19[data-p24-legal-popup],
body [data-p24-legal-modal].p24-legal-modal-v19,
body [data-p24-legal-popup].p24-legal-modal-v19 {
  width: 100vw !important;
  max-width: none !important;
  min-width: 100vw !important;
}

/* Мобильная версия */
@media (max-width: 767px) {
  body .p24-legal-modal-v19,
  html body .p24-legal-modal-v19,
  body .p24-legal-modal-v19.is-open,
  html body .p24-legal-modal-v19.is-open {
    padding: 10px !important;
  }

  body .p24-legal-modal-v19 .p24-legal-modal-dialog-v19,
  html body .p24-legal-modal-v19 .p24-legal-modal-dialog-v19,
  body .p24-legal-modal-v19.is-open .p24-legal-modal-dialog-v19,
  html body .p24-legal-modal-v19.is-open .p24-legal-modal-dialog-v19 {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    height: 92vh !important;
    max-height: calc(100vh - 20px) !important;
    border-radius: 20px !important;
  }
}