.pis-popup[hidden]{display:none!important}
.pis-popup{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}
.pis-popup__overlay{position:absolute;inset:0;background:rgba(0,0,0,var(--pis-overlay-opacity,.75))}
.pis-popup__content{position:relative;z-index:1;width:min(var(--pis-image-width,760px),calc(100vw - 48px));max-height:calc(100dvh - 48px);display:flex;flex-direction:column;justify-content:center;align-items:stretch;overflow:visible}
.pis-popup__content a{display:block;max-width:100%;min-height:0;flex-shrink:1}
.pis-popup__content img{display:block;width:auto;height:auto;max-width:100%;max-height:calc(100dvh - 48px);object-fit:contain;border-radius:4px;box-shadow:0 16px 50px rgba(0,0,0,.3)}
.pis-popup__close{position:absolute;z-index:2;top:-17px;right:-17px;background:#fff;color:#222;border:0;border-radius:50%;width:36px;height:36px;box-shadow:0 2px 12px rgba(0,0,0,.3);font-size:26px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.pis-popup__close:hover,.pis-popup__close:focus{background:#f3f3f3;color:#000;outline:2px solid #222;outline-offset:2px}
body.pis-popup-open{overflow:hidden!important}
@media(max-width:600px){.pis-popup{padding:18px}.pis-popup__content{width:min(var(--pis-image-width,760px),calc(100vw - 36px));max-height:calc(100dvh - 36px)}.pis-popup__content img{max-height:calc(100dvh - 36px)}.pis-popup__close{top:-12px;right:-10px}}

/* Texto sem fundo e sem caixa, com formatação escolhida no painel. */
.pis-popup__caption{box-sizing:border-box;width:100%;max-height:35dvh;overflow-y:auto;flex:0 0 auto;background:transparent!important;background-color:transparent!important;box-shadow:none!important;border:0!important;border-radius:0!important;margin:12px 0 0!important;padding:0 6px 4px!important;overflow-wrap:anywhere;text-shadow:0 1px 5px rgba(0,0,0,.5)}
.pis-popup__content:has(.pis-popup__caption) img{max-height:calc(65dvh - 48px)}
.pis-popup__content:has(.pis-popup__caption){max-height:calc(100dvh - 48px)}
@media(max-width:600px){.pis-popup__caption{margin-top:10px!important;padding:0 2px 4px!important}.pis-popup__content:has(.pis-popup__caption) img{max-height:calc(65dvh - 36px)}}

/* Botão WhatsApp sem painel de fundo; herdado apenas o próprio fundo do botão. */
.pis-popup__content a.pis-popup__whatsapp{align-self:center;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;max-width:100%;min-height:44px;margin:18px 0 0;padding:12px 32px;border:0;border-radius:3px;box-sizing:border-box;text-align:center;text-decoration:none!important;font-family:"Josefin Sans",sans-serif;font-size:16px;line-height:22px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;cursor:pointer;box-shadow:0 4px 18px rgba(0,0,0,.18);transition:filter .2s ease,transform .2s ease}
.pis-popup__content a.pis-popup__whatsapp:hover{filter:brightness(1.1);transform:translateY(-1px)}
.pis-popup__content a.pis-popup__whatsapp:focus-visible{outline:2px solid #fff;outline-offset:3px}
.pis-popup__content:has(.pis-popup__whatsapp) img{max-height:calc(55dvh - 48px)}
.pis-popup__content:has(.pis-popup__whatsapp) .pis-popup__caption{max-height:26dvh}
@media(max-width:600px){.pis-popup__content a.pis-popup__whatsapp{margin-top:12px;padding:11px 24px}.pis-popup__content:has(.pis-popup__whatsapp) img{max-height:calc(50dvh - 36px)}}

/* v1.4: a largura selecionada controla efetivamente a imagem, não apenas o contentor.
   A altura deixa de limitar a escala: quando necessário, o conteúdo tem scroll. */
.pis-popup .pis-popup__content{
  box-sizing:border-box;
  width:min(var(--pis-image-width,760px),calc(100vw - 48px));
  max-width:calc(100vw - 48px);
  max-height:calc(100dvh - 48px);
  overflow-x:hidden;
  overflow-y:auto;
  justify-content:flex-start;
  flex-shrink:0;
}
.pis-popup .pis-popup__content > a:not(.pis-popup__whatsapp){
  display:block;
  width:100%;
  flex:0 0 auto;
}
.pis-popup .pis-popup__content > img,
.pis-popup .pis-popup__content > a:not(.pis-popup__whatsapp) > img{
  display:block;
  box-sizing:border-box;
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  object-fit:contain;
  flex:0 0 auto;
}
.pis-popup .pis-popup__content .pis-popup__caption{
  flex-shrink:0;
}
@media(max-width:600px){
  .pis-popup .pis-popup__content{
    width:min(var(--pis-image-width,760px),calc(100vw - 36px));
    max-width:calc(100vw - 36px);
    max-height:calc(100dvh - 36px);
  }
}

/* v1.5: manter o botão de fechar inteiramente dentro da área visível.
   A versão anterior posicionava metade do círculo para fora do contentor,
   onde o overflow de scroll cortava a parte exterior. */
.pis-popup .pis-popup__content > .pis-popup__close{
  position:absolute;
  top:12px;
  right:12px;
  left:auto;
  z-index:20;
  width:40px;
  height:40px;
  min-width:40px;
  min-height:40px;
  line-height:1;
  border-radius:50%;
  box-sizing:border-box;
  transform:none;
}
@media(max-width:600px){
  .pis-popup .pis-popup__content > .pis-popup__close{
    top:8px;
    right:8px;
  }
}

/* v1.6: botão exterior à imagem numa faixa própria, acima dela.
   O botão é irmão da zona com scroll, para nunca ser cortado. */
.pis-popup .pis-popup__frame{
  position:relative;z-index:1;box-sizing:border-box;
  display:flex;flex-direction:column;
  width:min(var(--pis-image-width,760px),calc(100vw - 48px));
  max-width:calc(100vw - 48px);
  max-height:calc(100dvh - 32px);
  min-height:0;
}
.pis-popup .pis-popup__close-row{
  display:flex;justify-content:flex-end;align-items:center;
  height:48px;min-height:48px;flex:0 0 48px;
  padding:0 2px 8px;box-sizing:border-box;
}
.pis-popup .pis-popup__close-row > .pis-popup__close{
  position:static!important;inset:auto!important;
  transform:none!important;z-index:2;
  flex:0 0 38px;width:38px;height:38px;
  min-width:38px;min-height:38px;
  display:flex;align-items:center;justify-content:center;
  background:#fff;color:#222;border-radius:50%;
  border:0;box-shadow:0 2px 12px rgba(0,0,0,.3);
  font-size:26px;line-height:1;cursor:pointer;
}
.pis-popup .pis-popup__frame > .pis-popup__content{
  position:relative;box-sizing:border-box;
  width:100%;max-width:100%;
  max-height:calc(100dvh - 80px);
  min-height:0;overflow-x:hidden;overflow-y:auto;
}
@media(max-width:600px){
  .pis-popup .pis-popup__frame{
    width:min(var(--pis-image-width,760px),calc(100vw - 36px));
    max-width:calc(100vw - 36px);
    max-height:calc(100dvh - 20px);
  }
  .pis-popup .pis-popup__frame > .pis-popup__content{max-height:calc(100dvh - 68px)}
}
