/* garante estabilidade do grid durante captura */
body.vp-pdf-mode .pdf-grid-slice,
body.vp-pdf-mode .pdf-grid-slice *{
  animation: none !important;
  transition: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/* se tiver hover/transform em cards */
body.vp-pdf-mode .pdf-grid-slice *{
  transform: none !important;
}




/* Botão principal */
#viewport-pdf-button,
.vp-pdf-button {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #FFF;
    background-color: #E82A34;
    border: none;
    border-radius: 10px;
    padding: 15px 15px;
    cursor: pointer;

    display: inline-block; /* permite inline no desktop e 100% no mobile */
    text-transform: uppercase;
    transition: background-color 0.3s ease;

    width: auto; /* deixa o Elementor controlar a largura */
}

/* Mobile – permitir 100% apenas se o Elementor definir */
@media (max-width: 767px) {
    #viewport-pdf-button,
    .vp-pdf-button {
        width: 100%; /* botão se adapta ao container mobile */
        display: block;
    }
}

#viewport-pdf-button:hover,
.vp-pdf-button:hover {
    background-color: #E82A34;
}

/* Tela de carregamento */
#loading-screen,
.vp-pdf-loading-screen {
    display: none; /* controlado via JS */
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #FFF;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #393534;
}

/* Spinner */
.spinner {
    border: 8px solid #CCC;
    border-radius: 50%;
    border-top: 8px solid #E82A34;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

/* Texto do loading */
#loading-text {
    margin-top: 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 35px;
    font-weight: 700;
    color: #393534;
}

/* Animação do spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Elementos exclusivos do PDF: ficam invisíveis no site */
.pdf-only {
    display: none !important;
}










/* =========================================================
   GRID PARA PDF (Listing Grid ou bloco em duas colunas)
   Use no wrapper: class="pdf-grid"
   ========================================================= */

.pdf-grid{
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.pdf-grid > *{
  flex: 1 1 0;
  min-width: 0;
}

/* Se você quiser FORÇAR 2 colunas sempre no PDF */
body.vp-pdf-mode .pdf-grid{
  display: flex !important;
  flex-direction: row !important;
}

/* Caso no mobile do SITE você queira empilhar, mas no PDF manter 2 colunas */
@media (max-width: 767px){
  .pdf-grid{
    flex-direction: column;
  }
  body.vp-pdf-mode .pdf-grid{
    flex-direction: row !important;
  }
}







/* =========================
   MODO PDF: reduz custo de render do html2canvas
   (remove filtros, sombras, animações e transições durante geração)
   ========================= */
body.vp-pdf-mode #main-content,
body.vp-pdf-mode #main-content * {
    animation: none !important;
    transition: none !important;
}

body.vp-pdf-mode #main-content * {
    filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* evita “movimento” e efeitos que podem atrasar o capture */
body.vp-pdf-mode #main-content video,
body.vp-pdf-mode #main-content iframe {
    display: none !important;
}

/* =========================================================
   IMAGEM COM CONTAIN COMPATÍVEL COM HTML2CANVAS
   Classe do widget: vp-pdf-image-contain
   ========================================================= */

/*
 * O html2canvas não suporta object-fit.
 * Por isso, a altura precisa ficar no container,
 * e não diretamente na tag <img>.
 */
body.vp-pdf-mode
.vp-pdf-image-contain
.jet-listing-dynamic-image {
    width: 100% !important;
    height: 1500px !important;
    min-height: 1500px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
}

/* Caso a imagem dinâmica possua um link */
body.vp-pdf-mode
.vp-pdf-image-contain
.jet-listing-dynamic-image__link {
    width: 100% !important;
    height: 100% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
}

/* Caso o JetEngine utilize a tag picture */
body.vp-pdf-mode
.vp-pdf-image-contain
picture {
    width: 100% !important;
    height: 100% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/*
 * A imagem usa suas proporções naturais.
 * max-width + max-height simulam o comportamento de contain.
 */
body.vp-pdf-mode
.vp-pdf-image-contain
.jet-listing-dynamic-image img {
    display: block !important;

    width: auto !important;
    height: auto !important;

    max-width: 100% !important;
    max-height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;

    margin: auto !important;

    object-fit: initial !important;
    object-position: initial !important;

    flex: 0 0 auto !important;
}
