/* ============================================================
   Popup de Avisos — site
   Exibe somente o primeiro popup ativo cadastrado no painel.
   ============================================================ */

:root {
  --sp-surface: #fbf6f0;
  --sp-ink: #2e2218;
  --sp-scrim: rgba(26, 16, 8, .68);
}

.site-popup {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: clamp(20px, 4vw, 44px);
  position: fixed;
  visibility: hidden;
  z-index: 1080;
  transition: opacity .24s ease, visibility .24s ease;
}

.site-popup.is-open {
  opacity: 1;
  visibility: visible;
}

.site-popup__scrim {
  -webkit-backdrop-filter: blur(7px) saturate(.92);
  backdrop-filter: blur(7px) saturate(.92);
  background: var(--sp-scrim);
  inset: 0;
  position: absolute;
}

.site-popup__panel {
  max-width: 100%;
  opacity: 0;
  position: relative;
  transform: translateY(14px) scale(.985);
  transition: opacity .3s ease, transform .44s cubic-bezier(.16, 1, .3, 1);
  width: min(100%, 560px);
}

.site-popup.is-open .site-popup__panel {
  opacity: 1;
  transform: none;
}

.site-popup__frame {
  background: var(--sp-surface);
  border-radius: 22px;
  box-shadow:
    0 34px 90px -26px rgba(18, 9, 0, .72),
    0 12px 32px -18px rgba(18, 9, 0, .5);
  overflow: hidden;
  position: relative;
}

.site-popup__frame::after {
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.site-popup__image {
  background: var(--sp-surface);
  display: block;
  height: auto;
  max-height: min(78vh, 78dvh, 640px);
  object-fit: contain;
  width: 100%;
}

.site-popup__close {
  align-items: center;
  background: rgba(255, 252, 247, .94);
  border: 0;
  border-radius: 999px;
  box-shadow:
    0 8px 22px rgba(20, 10, 0, .28),
    0 0 0 1px rgba(60, 40, 20, .06);
  color: var(--sp-ink);
  cursor: pointer;
  display: flex;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: -14px;
  top: -14px;
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
  width: 42px;
  z-index: 2;
}

.site-popup__close:hover {
  background: #fff;
  box-shadow:
    0 10px 26px rgba(20, 10, 0, .32),
    0 0 0 1px rgba(60, 40, 20, .08);
  transform: scale(1.06);
}

.site-popup__close:active {
  transform: scale(.96);
}

.site-popup__close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .9);
  outline-offset: 3px;
}

.site-popup__close svg {
  height: 17px;
  width: 17px;
}

html.site-popup-open,
body.site-popup-open {
  overflow: hidden;
}

@media (max-width: 576px) {
  .site-popup {
    padding: 16px;
  }

  .site-popup__frame {
    border-radius: 18px;
  }

  .site-popup__image {
    max-height: min(80vh, 80dvh);
  }

  .site-popup__close {
    height: 38px;
    right: 8px;
    top: 8px;
    width: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-popup,
  .site-popup__panel,
  .site-popup__close {
    transition: none;
  }

  .site-popup__panel {
    transform: none;
  }
}
