/* Consentimento de cookies (LGPD, tarefa 17ttyene5gt): banner e painel de preferências do ConsentimentoCookies.js.
   A cor de destaque é a primária do site (config css_Color_Primary), passada pelo JS em --dg-consentimento-cor. Os
   seletores repetem a classe do bloco para ganhar das regras gerais dos temas (button, label, strong, a). */

.dg-consentimento-banner,
.dg-consentimento-painel {
    --dg-consentimento-cor: #03A9F4;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
}

.dg-consentimento-banner *,
.dg-consentimento-painel * {
    box-sizing: border-box;
}

/* ---------- Banner ---------- */

/* z-index no topo da escala: o cabeçalho fixo do MGL usa 2147483647. O painel usa o mesmo valor e, por entrar depois no
   DOM, fica por cima dele; o banner fica logo abaixo (acima dos menus do tema). */
.dg-consentimento-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483646;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background-color: rgba(0, 0, 0, .92);
    color: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .25);
}

.dg-consentimento-banner .dg-consentimento-banner__conteudo {
    max-width: 1260px;
    margin: 0 auto;
}

.dg-consentimento-banner .dg-consentimento-banner__texto {
    color: #fff;
    font-size: 14px;
}

.dg-consentimento-banner .dg-consentimento-banner__titulo {
    display: block;
    margin: 0 0 4px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.dg-consentimento-banner a,
.dg-consentimento-banner a:hover,
.dg-consentimento-banner a:focus {
    color: #fff !important;
    text-decoration: underline !important;
}

.dg-consentimento-banner .dg-consentimento-banner__botoes {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.dg-consentimento-banner .dg-consentimento-btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
}

@media (min-width: 992px) {
    .dg-consentimento-banner {
        padding: 24px 16px;
    }

    .dg-consentimento-banner .dg-consentimento-banner__conteudo {
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .dg-consentimento-banner .dg-consentimento-banner__texto {
        flex: 1;
    }

    .dg-consentimento-banner .dg-consentimento-banner__botoes {
        flex: 0 0 auto;
        margin-top: 0;
    }

    .dg-consentimento-banner .dg-consentimento-btn {
        flex: 0 0 auto;
        min-width: 130px;
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ---------- Botões ---------- */

.dg-consentimento-banner .dg-consentimento-btn,
.dg-consentimento-painel .dg-consentimento-btn {
    display: inline-block;
    float: none;
    width: auto;
    height: auto;
    margin: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    border: 1px solid var(--dg-consentimento-cor);
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

/* Hover só com mouse: no celular, o toque deixava o botão que aparece no mesmo lugar (painel) pintado. */
@media (hover: hover) {
    .dg-consentimento-banner .dg-consentimento-btn:hover {
        background-color: var(--dg-consentimento-cor);
        color: #000;
    }
}

.dg-consentimento-banner .dg-consentimento-btn:focus-visible {
    background-color: var(--dg-consentimento-cor);
    color: #000;
}

.dg-consentimento-banner .dg-consentimento-btn:focus-visible,
.dg-consentimento-painel .dg-consentimento-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ---------- Painel de preferências ---------- */

.dg-consentimento-painel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(0, 0, 0, .6);
    color: #333;
}

/* A caixa rola quando não cabe na tela; a barra de botões fica presa no fim dela. */
.dg-consentimento-painel .dg-consentimento-painel__caixa {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 100%;
    overflow-y: auto;
    padding: 24px 24px 0;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.dg-consentimento-painel .dg-consentimento-painel__titulo {
    display: block;
    margin: 0 40px 8px 0;
    color: #222;
    font-size: 20px;
    font-weight: bold;
}

.dg-consentimento-painel .dg-consentimento-painel__intro {
    margin-bottom: 16px;
    color: #444;
}

.dg-consentimento-painel a,
.dg-consentimento-painel a:hover,
.dg-consentimento-painel a:focus {
    color: inherit !important;
    text-decoration: underline !important;
}

.dg-consentimento-painel .dg-consentimento-painel__fechar {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #555;
    font-family: inherit;
    font-size: 28px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
}

.dg-consentimento-painel .dg-consentimento-categoria {
    padding: 14px 0;
    border-top: 1px solid #e3e3e3;
}

.dg-consentimento-painel .dg-consentimento-categoria__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dg-consentimento-painel .dg-consentimento-categoria__nome {
    display: inline;
    margin: 0;
    padding: 0;
    color: #222;
    font-size: 15px;
    font-weight: bold;
}

.dg-consentimento-painel label.dg-consentimento-categoria__nome {
    cursor: pointer;
}

.dg-consentimento-painel .dg-consentimento-categoria__sempre {
    color: #2e7d32;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

.dg-consentimento-painel .dg-consentimento-categoria__descricao {
    margin-top: 6px;
    color: #555;
    font-size: 13px;
}

.dg-consentimento-painel .dg-consentimento-categoria__ferramentas {
    margin-top: 4px;
    color: #777;
    font-size: 12px;
}

.dg-consentimento-painel .dg-consentimento-categoria__ferramentas:empty {
    display: none;
}

/* Interruptor: o checkbox fica invisível (o core.css esconde todos) e o trilho desenha o estado. */
.dg-consentimento-painel .dg-consentimento-switch {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.dg-consentimento-painel .dg-consentimento-switch__check {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0 !important;
}

.dg-consentimento-painel .dg-consentimento-switch__trilho {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 13px;
    background-color: #b5b5b5;
    transition: background-color .2s ease;
}

.dg-consentimento-painel .dg-consentimento-switch__trilho:before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s ease;
}

.dg-consentimento-painel .dg-consentimento-switch__check:checked + .dg-consentimento-switch__trilho {
    background-color: var(--dg-consentimento-cor);
}

.dg-consentimento-painel .dg-consentimento-switch__check:checked + .dg-consentimento-switch__trilho:before {
    transform: translateX(20px);
}

.dg-consentimento-painel .dg-consentimento-switch__check:focus-visible + .dg-consentimento-switch__trilho {
    outline: 2px solid #222;
    outline-offset: 2px;
}

.dg-consentimento-painel .dg-consentimento-painel__botoes {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 -24px;
    padding: 16px 24px 24px;
    border-top: 1px solid #e3e3e3;
    background-color: #fff;
}

.dg-consentimento-painel .dg-consentimento-btn {
    flex: 1 1 140px;
    padding-left: 12px;
    padding-right: 12px;
    border-color: #555;
    background-color: #fff;
    color: #222;
}

@media (hover: hover) {
    .dg-consentimento-painel .dg-consentimento-btn:hover {
        border-color: var(--dg-consentimento-cor);
        background-color: var(--dg-consentimento-cor);
        color: #000;
    }
}

.dg-consentimento-painel .dg-consentimento-btn:focus-visible {
    border-color: var(--dg-consentimento-cor);
    background-color: var(--dg-consentimento-cor);
    color: #000;
}

.dg-consentimento-painel .dg-consentimento-btn.dg-consentimento-btn--salvar {
    border-color: #222;
    background-color: #222;
    color: #fff;
}

.dg-consentimento-painel .dg-consentimento-btn.dg-consentimento-btn--salvar:hover,
.dg-consentimento-painel .dg-consentimento-btn.dg-consentimento-btn--salvar:focus-visible {
    border-color: #000;
    background-color: #000;
}

/* Celular: menos espaço em volta, para caber mais da lista sem rolar. */
@media (max-width: 575px) {
    .dg-consentimento-painel {
        padding: 8px;
    }

    .dg-consentimento-painel .dg-consentimento-painel__caixa {
        padding: 18px 16px 0;
    }

    .dg-consentimento-painel .dg-consentimento-painel__titulo {
        font-size: 18px;
    }

    .dg-consentimento-painel .dg-consentimento-categoria {
        padding: 10px 0;
    }

    .dg-consentimento-painel .dg-consentimento-painel__botoes {
        margin: 0 -16px;
        padding: 12px 16px 16px;
    }
}

@media print {
    .dg-consentimento-banner,
    .dg-consentimento-painel {
        display: none !important;
    }
}
