/* mod_setro_popup — базовое оформление.
   Размеры, отступы, фон, затемнение и мобильный режим генерируются инлайн-стилем по #setro-popup-ID. */

html.setro-popup-lock { overflow: hidden; }

.setro-popup {
  box-sizing: border-box;
  max-width: none;               /* снимаем ограничение браузера для <dialog> */
  border: 0;
  color: inherit;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  overflow: auto;
  overscroll-behavior: contain;
}
.setro-popup *, .setro-popup *::before, .setro-popup *::after { box-sizing: border-box; }
.setro-popup img, .setro-popup iframe, .setro-popup video { max-width: 100%; }
.setro-popup img { height: auto; }

/* ---------- Анимации ---------- */
.setro-popup[open]::backdrop     { animation: sp-fade .25s ease-out; }
.setro-popup.is-closing::backdrop { animation: sp-fade-out .2s ease-in forwards; }

.sp-anim-slide[open]      { animation: sp-slide .25s ease-out; }
.sp-anim-slide.is-closing { animation: sp-slide-out .2s ease-in forwards; }
.sp-anim-zoom[open]       { animation: sp-zoom .25s ease-out; }
.sp-anim-zoom.is-closing  { animation: sp-zoom-out .2s ease-in forwards; }
.sp-anim-fade[open]       { animation: sp-fade .25s ease-out; }
.sp-anim-fade.is-closing  { animation: sp-fade-out .2s ease-in forwards; }
.sp-anim-none, .sp-anim-none::backdrop { animation: none !important; }

@keyframes sp-fade      { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-fade-out  { to { opacity: 0; } }
@keyframes sp-slide     { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes sp-slide-out { to { opacity: 0; transform: translateY(24px); } }
@keyframes sp-zoom      { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes sp-zoom-out  { to { opacity: 0; transform: scale(.9); } }

@media (prefers-reduced-motion: reduce) {
  .setro-popup, .setro-popup::backdrop { animation: none !important; }
}

/* ---------- Крестик ---------- */
.setro-popup__close {
  position: sticky;              /* остаётся на месте при прокрутке длинного содержимого */
  top: 8px;
  float: right;
  margin: 8px 8px -44px 0;
  z-index: 5;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: #333;
  font-size: 26px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
}
.setro-popup__close:hover { background: #fff; }
.setro-popup__close[hidden] { display: none; }

/* ---------- Конструктор ---------- */
.setro-popup__image img { display: block; width: 100%; }
.setro-popup__body  { padding: 24px 28px 28px; }
.setro-popup__title { margin: 0 0 12px; font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.setro-popup__text > :last-child { margin-bottom: 0; }
.setro-popup__btn   { margin-top: 20px; }

@media (max-width: 575px) {
  .setro-popup__body  { padding: 20px 18px 22px; }
  .setro-popup__title { font-size: 1.25rem; }
}
