﻿/* Janelas de mensagem (Scripts/Dialogo.js). Classes "dlg-" para não esbarrar no Bootstrap 3/4 nem no tema. */

.dlg-fundo {
    position: fixed;
    inset: 0;
    z-index: 2147483100;   /* acima do cabeçalho fixo (9999999) e do relatório (2147483000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(16, 24, 32, .45);
    opacity: 0;
    transition: opacity .15s ease-out;
}

    .dlg-fundo.dlg-aberto {
        opacity: 1;
    }

.dlg,
.dlg * {
    box-sizing: border-box;
}

.dlg {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 26px 24px 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(16, 24, 32, .25);
    color: #1f2429;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    transform: translateY(8px) scale(.98);
    transition: transform .15s ease-out;
}

    .dlg:focus {
        outline: none;
    }

.dlg-aberto .dlg {
    transform: none;
}

.dlg-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 50%;
}


.dlg-aviso .dlg-icone { background: #fdf3e1; color: #a15c00; }
.dlg-erro .dlg-icone { background: #fdecec; color: #c62828; }
.dlg-sucesso .dlg-icone { background: #e3f4f2; color: #00796b; }
.dlg-info .dlg-icone { background: #e6f1fb; color: #185fa5; }
.dlg-pergunta .dlg-icone { background: #fdecec; color: #c62828; }

.dlg-titulo {
    margin: 0 0 6px;
    color: #1f2429;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.dlg-texto {
    margin: 0;
    color: #4a5158;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.dlg-acoes {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.dlg-btn {
    flex: 1;
    min-height: 44px;
    margin: 0;
    padding: 10px 16px;
    border: 1px solid #cfd4d9;
    border-radius: 8px;
    background: #fff;
    color: #1f2429;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

    .dlg-btn:hover {
        background: #f1f3f5;
    }

    .dlg-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 156, 143, .3);
    }

.dlg-btn-principal {
    border-color: #009c8f;
    background: #009c8f;
    color: #fff;
}

    .dlg-btn-principal:hover {
        border-color: #007f74;
        background: #007f74;
    }

.dlg-btn-perigo {
    border-color: #c62828;
    background: #c62828;
    color: #fff;
}

    .dlg-btn-perigo:hover {
        border-color: #a32020;
        background: #a32020;
    }

    .dlg-btn-perigo:focus-visible {
        box-shadow: 0 0 0 3px rgba(198, 40, 40, .3);
    }

/* Imagem do produto */
.dlg.dlg-imagem {
    max-width: 520px;
    padding: 44px 20px 16px;
}

    .dlg-imagem img {
        display: block;
        width: 100%;
        max-width: 440px;
        height: auto;
        max-height: calc(100vh - 160px);
        margin: 0 auto;
        object-fit: contain;
    }

.dlg-legenda {
    margin: 12px 0 0;
    color: #4a5158;
    font-size: 14px;
    font-weight: 600;
}

.dlg-sem-imagem {
    margin: 24px 0;
    color: #6b7178;
}

.dlg-x {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7178;
    cursor: pointer;
}

    .dlg-x:hover,
    .dlg-x:focus-visible {
        outline: none;
        background: #f1f3f5;
        color: #1f2429;
    }

    .dlg-x svg {
        width: 20px;
        height: 20px;
    }

/* Avisos no topo que somem sozinhos (sucesso) */
.dlg-toasts {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 2147483200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 32px);
    transform: translateX(-50%);
    pointer-events: none;
}

.dlg-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 10px 14px;
    background: #fff;
    border: 1px solid #e3e6e9;
    border-left: 4px solid #009c8f;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(16, 24, 32, .15);
    color: #1f2429;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s ease-out, transform .2s ease-out;
    pointer-events: auto;
}

    .dlg-toast.dlg-aberto {
        opacity: 1;
        transform: none;
    }

.dlg-toast-sucesso { border-left-color: #009c8f; }
.dlg-toast-sucesso .dlg-toast-icone { color: #00796b; }
.dlg-toast-erro { border-left-color: #c62828; }
.dlg-toast-erro .dlg-toast-icone { color: #c62828; }
.dlg-toast-aviso { border-left-color: #e0a100; }
.dlg-toast-aviso .dlg-toast-icone { color: #a15c00; }
.dlg-toast-info { border-left-color: #185fa5; }
.dlg-toast-info .dlg-toast-icone { color: #185fa5; }

.dlg-toast-icone {
    display: flex;
    flex: none;
}

.dlg-toast-texto {
    font-weight: 600;
}

.dlg-toast-x {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9aa1a8;
    cursor: pointer;
}

    .dlg-toast-x:hover {
        background: #f1f3f5;
        color: #1f2429;
    }

    .dlg-toast-x svg {
        width: 16px;
        height: 16px;
    }

@media (max-width: 480px) {
    .dlg {
        padding: 22px 18px 16px;
    }

    .dlg-acoes {
        flex-direction: column-reverse;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dlg-fundo,
    .dlg,
    .dlg-toast {
        transition: none;
    }
}
