/* V1.27.60 — fluxo do checkout: aceite só na confirmação e Pix compacto/sem rolagem no mobile. */

/* Proteção de estado: o aceite do regulamento existe somente na primeira tela. */
body #checkoutModal:not([data-checkout-stage="confirm"]) #checkoutTermsConfirmation{
  display:none!important;
}

@media (max-width:700px){
  /* Processamento e pagamento ficam centralizados na área segura. */
  body #checkoutModal.modal.open[data-checkout-stage="processing"],
  body #checkoutModal.modal.open[data-checkout-stage="pix"],
  body #checkoutModal.modal.open[data-checkout-stage="result"],
  body #checkoutModal.modal.open[data-checkout-stage="error"]{
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }

  body #checkoutModal.modal.open[data-checkout-stage="processing"] > .modal-card,
  body #checkoutModal.modal.open[data-checkout-stage="pix"] > .modal-card,
  body #checkoutModal.modal.open[data-checkout-stage="result"] > .modal-card,
  body #checkoutModal.modal.open[data-checkout-stage="error"] > .modal-card{
    position:relative!important;
    inset:auto!important;
    margin:auto!important;
    padding:10px 12px 11px!important;
    overflow:hidden!important;
    transform:none!important;
  }

  body #checkoutModal.modal.open[data-checkout-stage="pix"] > .modal-card > .modal-head,
  body #checkoutModal.modal.open[data-checkout-stage="processing"] > .modal-card > .modal-head{
    min-height:32px!important;
    margin:0 0 4px!important;
    padding:0 38px 4px 0!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] > .modal-card > .modal-head h3,
  body #checkoutModal.modal.open[data-checkout-stage="processing"] > .modal-card > .modal-head h3{
    margin:0!important;
    font-size:1rem!important;
    line-height:1.1!important;
    white-space:nowrap!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] > .modal-card > .modal-head .icon-btn,
  body #checkoutModal.modal.open[data-checkout-stage="processing"] > .modal-card > .modal-head .icon-btn{
    width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;
  }

  body #checkoutModal.modal.open[data-checkout-stage="pix"] #checkoutDetails{
    width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-payment-box{
    display:grid!important;
    gap:6px!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-payment-head{
    display:grid!important;
    gap:2px!important;
    margin:0!important;
    padding:0!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-order-badge{
    margin:0!important;
    padding:3px 7px!important;
    font-size:.61rem!important;
    line-height:1!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-payment-head h3{
    margin:1px 0 0!important;
    font-size:1rem!important;
    line-height:1.05!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-payment-help{
    margin:0!important;
    font-size:.68rem!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-copy-section{
    gap:3px!important;
    margin:0!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-copy-section>label{
    font-size:.65rem!important;
    line-height:1!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-code{
    box-sizing:border-box!important;
    height:54px!important;
    min-height:54px!important;
    max-height:54px!important;
    margin:0!important;
    padding:6px 8px!important;
    overflow:hidden!important;
    resize:none!important;
    border-radius:9px!important;
    font-size:.57rem!important;
    line-height:1.15!important;
    white-space:pre-wrap!important;
    overflow-wrap:anywhere!important;
    word-break:break-all!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
    margin:0!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-actions .btn,
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-provider-link,
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-check-button{
    min-height:36px!important;
    height:36px!important;
    margin:0!important;
    padding:5px 7px!important;
    border-radius:9px!important;
    font-size:.68rem!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-qr-panel{
    gap:4px!important;
    margin:0!important;
    padding:5px!important;
    border-radius:9px!important;
    overflow:hidden!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-qr{
    width:min(150px,42vw,27vh)!important;
    margin:0!important;
    padding:4px!important;
    border-radius:8px!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-qr-caption{
    margin:0!important;
    font-size:.58rem!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    max-width:100%!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-status{
    min-height:32px!important;
    margin:0!important;
    padding:5px 7px!important;
    border-radius:9px!important;
    font-size:.63rem!important;
    line-height:1.05!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-expiration{
    min-height:0!important;
    margin:0!important;
    font-size:.59rem!important;
    line-height:1!important;
  }
}

/* Viewports muito baixos: prioriza o Copia e Cola e mantém o modal sem scrollbar. */
@media (max-width:700px) and (max-height:620px){
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-payment-help{display:none!important}
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-order-badge{display:none!important}
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-code{
    height:46px!important;min-height:46px!important;max-height:46px!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-actions .btn,
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-provider-link,
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-check-button{
    min-height:33px!important;height:33px!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-qr{
    width:min(120px,36vw,22vh)!important;
  }
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-qr-caption{display:none!important}
  body #checkoutModal.modal.open[data-checkout-stage="pix"] .pix-status{min-height:28px!important}
}
