/* #region OLD_POPUPS */

div.onxpop_header{
	color:var(--txt_nrm);
 	background-color:var(--clr_nrm);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
	margin-bottom: 0;
}

div.onxpop_header h2{
	color:var(--txt_nrm);
    font-size: 16px;
    font-weight: 600;
    margin: 0px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

div.onxpop_header a.icon{
	color:var(--txt_nrm);
}

/* #endregion OLD_POPUPS */

/* #region POPUPS */

div.pop_header{background-color:var(--clr_nrm);}
div.pop_header h2{color:var(--txt_nrm);}

/* popup gemini*/
div#onx_popup_overlay{
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px); /* Opcional: dá um leve efeito blur no fundo */
}

div#onx_popup_overlay.onx_popup_no_overlay {
    background: rgba(0, 0, 0, 0.3);
	backdrop-filter:unset; 
}

div#onx_popup{
    border-radius: 12px; 
    box-shadow: 0px 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 500px;
    overflow: auto;
    position: relative;
    box-sizing: border-box;
    animation: popupFadeIn 0.3s ease-out;
	background-color: #ffffff;
}

div#onx_popup div.wrapper.popup{
    padding: var(--card-pad);
    display: inline-block;
}

div#onx_popup ul.formulario{
	padding-right: 20px;
}

/* Animação simples de surgimento */
@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Classes de estilo para o controle do Zoom */
.img-zoom-fit {
    max-width: 90vw;
    max-height: 80vh;   /* alinhado ao valor que ja era aplicado via JS (agora removido do JS) */
    width: auto;
    height: auto;
    cursor: zoom-in;
}
.img-zoom-full {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    cursor: zoom-out; /* Cursor de lupa com sinal de - */
}

div#onx_popup div.onxpop_header{
	color:var(--txt_nrm);
 	background-color:var(--clr_nrm);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
	margin-bottom: 0;
}

div#onx_popup div.onxpop_header h2{
    font-size: 16px;
    font-weight: 600;
    margin: 0px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

div#onx_popup div.onxpop_header a.icon{
	color:var(--txt_nrm);
}

div#onx_popup div.painel{
    padding: 10px;
}

#onx_popup_bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(20, 20, 20, 0.85);
    color: #ffffff;
    border-radius: 8px 8px 0 0;
    box-sizing: border-box;
    user-select: none;
    backdrop-filter: blur(8px); /* Efeito translúcido moderno */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Botões de Ação na Barra (Zoom, Download, Navegação) */
#onx_popup_bar .onx-bar-btn,
#onx_popup_bar .fechaPopup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #d1d5db;
    text-decoration: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Efeito de Hover genérico */
#onx_popup_bar .onx-bar-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Efeito de clique (Active) */
#onx_popup_bar .onx-bar-btn:active,
#onx_popup_bar .fechaPopup:active {
    transform: scale(0.95);
}

/* Botão de Fechar com destaque vermelho no Hover */
#onx_popup_bar .fechaPopup {
    font-size: 20px;
    margin-left: 4px;
}

#onx_popup_bar .fechaPopup:hover {
    background: #ef4444; /* Vermelho destacado */
    color: #ffffff;
}

/* Container do Controle de Galeria (< 1/5 >) */
#onx_popup_bar .onx-bar-galeria {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 6px;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.15); /* Separador vertical */
}

/* Contador Numérico da Galeria */
#onx_popup_bar .onx-bar-galeria span {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    min-width: 32px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Ajustes para telas pequenas (Smartphones) */
@media (max-width: 600px) {
    #onx_popup_bar {
        padding: 6px 10px;
        gap: 6px;
    }

    #onx_popup_bar .onx-bar-btn,
    #onx_popup_bar .fechaPopup {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
}

/*popimagem*/
.popimagem{
    cursor:pointer !important;
}

/* #endregion POPUPS */

/* #region CONFIRMA */

/* Container do fundo escurecido (Overlay) */
.confirma-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4); /* Fundo escurecido suave */
    backdrop-filter: blur(4px); /* Efeito de desfoque moderno */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-out;
}

/* Caixa do Modal / Popup */
.confirma-modal {
    background: #ffffff;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px); /* nunca passa da altura disponível (40px = padding do overlay) */
    border-radius: 12px;
    padding: 12px 12px 16px 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    overflow: hidden; /* quem rola é o conteúdo, não o modal inteiro */
    transform: scale(0.95);
    animation: scaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Elementos que nunca devem encolher nem sumir da tela */
.confirma-icon-box,
.confirma-title,
.pergunta,
.confirma-buttons-container {
    flex-shrink: 0;
}

/* Títulos e Textos */
.confirma-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.confirma-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    width: 100%;
    min-height: 0;   /* essencial pra o overflow funcionar dentro de flex column */
    flex-shrink: 1;
    overflow-y: auto;
}

/* Área de Ícones Dinâmicos */
.confirma-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 28px;
}

/* Container de Botões */
.confirma-buttons-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
    flex-wrap: wrap-reverse; /* Em telas muito pequenas, joga o botão principal para cima */
}

/* Animações de Entrada */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleUp {
    to { transform: scale(1); }
}

/* #endregion CONFIRMA */