/* Usa a Carbona já carregada pelo tema da loja. */
#df-cookie-panel,
#df-cookie-panel *,
#df-cookie-reopen {
    box-sizing: border-box;
}

#df-cookie-panel[hidden],
#df-cookie-panel [hidden],
#df-cookie-reopen[hidden] {
    display: none !important;
}

/* Painel */
#df-cookie-panel {
    position: fixed;
    inset: auto 20px 20px auto;
    z-index: 2147483000;

    width: 460px;
    max-width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow: auto;

    margin: 0;
    padding: 12px;

    background: #fffaf3;
    color: #302a26;
    border: 1px solid #d7cbbd;
    border-radius: 4px;
    box-shadow: 0 4px 18px rgb(48 42 38 / 8%);

    font-family: "Carbona", sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    letter-spacing: 0;
}

/* Oculta o título visualmente, mantendo o nome acessível. */
#df-cookie-panel #df-cookie-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Texto e link no mesmo parágrafo */
#df-cookie-panel p {
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
}

#df-cookie-panel a {
    display: inline;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Ações: sempre no fluxo, sem sobrepor o texto */
#df-cookie-panel #df-cookie-actions {
    position: static;
    inset: auto;
    transform: none;
    float: none;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;

    width: 100%;
    margin: 8px 0 0;
    padding: 0;
}

/* Botões compactos */
#df-cookie-panel button {
    position: static;
    inset: auto;
    transform: none;

    width: auto;
    height: auto;
    min-width: 0;
    min-height: 28px;
    margin: 0;
    padding: 6px 8px;

    appearance: none;
    background: transparent;
    color: #302a26;
    border: 1px solid #a77b61;
    border-radius: 3px;
    box-shadow: none;

    font-family: "Carbona", sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
}

#df-cookie-reject,
#df-cookie-accept {
    flex: 1 1 120px;
}

/* Personalizar e Fechar: aparência de link */
#df-cookie-panel #df-cookie-customize,
#df-cookie-panel #df-cookie-close {
    flex: 0 0 auto;
    padding: 6px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#df-cookie-panel button:hover {
    background-color: #efe6db;
}

#df-cookie-panel :is(button, a, input):focus-visible,
#df-cookie-reopen:focus-visible {
    outline: 2px solid #302a26;
    outline-offset: 2px;
}

/* Preferências expandidas */
#df-cookie-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #d7cbbd;
}

#df-cookie-details label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin: 4px 0;
    font: inherit;
    cursor: pointer;
}

#df-cookie-details input[type="checkbox"] {
    appearance: auto;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #79543c;
}

#df-cookie-panel #df-cookie-save {
    margin-top: 6px;
}

#df-cookie-panel #df-cookie-status:empty {
    display: none;
}

#df-cookie-panel #df-cookie-status:not(:empty) {
    display: block;
    margin-top: 8px;
}

/* Acesso para revisar ou revogar a escolha */
#df-cookie-reopen {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 2147482999;

    min-height: 28px;
    padding: 6px 8px;
    border: 1px solid #d7cbbd;
    border-radius: 3px;
    background: #fffaf3;
    color: #302a26;

    font: 400 11px/1.35 "Carbona", sans-serif;
    cursor: pointer;
}

/* Mobile */
@media (max-width: 600px) {
    #df-cookie-panel {
        inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px;
        width: auto;
        max-width: none;
        padding: 12px;
        max-height: calc(100dvh - 40px - env(safe-area-inset-bottom));
    }

    #df-cookie-panel #df-cookie-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 6px;
        margin-top: 8px;
    }

    #df-cookie-reject,
    #df-cookie-accept {
        width: 100%;
    }

    #df-cookie-panel #df-cookie-customize,
    #df-cookie-panel #df-cookie-close {
        grid-column: 1 / -1;
        justify-self: center;
        width: auto;
        padding: 4px 8px;
        min-height: 24px;
    }
}