.ca-consent[hidden],
.ca-consent [hidden] { display: none !important; }
#ca-consent-root #ca-consent-banner.ca-consent__banner[hidden],
#ca-consent-root #ca-consent-preferences[hidden] { display: none !important; }

.ca-consent,
.ca-consent * { box-sizing: border-box; }

/* Banner inicial: card compacto e vertical. */
#ca-consent-root #ca-consent-banner.ca-consent__banner {
    position: fixed;
    z-index: 999999;
    left: auto;
    right: 12px;
    bottom: 12px;
    width: 280px;
    max-width: calc(100vw - 24px);
    display: block;
    margin: 0;
    padding: 12px;
    background: #fff;
    color: #1f2933;
    border: 1px solid rgba(0,0,0,.11);
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(0,0,0,.14);
    font: inherit;
}

#ca-consent-root #ca-consent-banner .ca-consent__content {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.ca-consent__title {
    margin: 0 0 5px;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
}

.ca-consent__message {
    margin: 0 0 7px;
    font-size: 11px;
    line-height: 1.4;
    color: #52606d;
}

.ca-consent__policy {
    display: inline-block;
    margin: 0 0 8px;
    font-size: 10.5px;
    line-height: 1.2;
    text-decoration: underline;
    color: #243b53;
}

.ca-consent__actions,
.ca-consent__modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#ca-consent-root #ca-consent-banner .ca-consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.ca-consent__button,
.ca-consent__close {
    appearance: none;
    cursor: pointer;
    font: inherit;
}

.ca-consent__button {
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #334e68;
    border-radius: 8px;
    background: #fff;
    color: #243b53;
    font-size: 14px;
    font-weight: 600;
}

#ca-consent-root #ca-consent-banner .ca-consent__button {
    width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 10.5px;
    line-height: 1.1;
}

#ca-consent-root #ca-consent-banner .ca-consent__button--link {
    grid-column: 1 / -1;
    width: auto;
    min-height: 18px;
    justify-self: center;
    padding: 2px 5px;
    border-color: transparent;
    background: transparent;
}

.ca-consent__button:hover,
.ca-consent__button:focus-visible { background: #f0f4f8; outline: 2px solid transparent; }
.ca-consent__button--primary { background: #243b53; color: #fff; }
.ca-consent__button--primary:hover,
.ca-consent__button--primary:focus-visible { background: #102a43; }
.ca-consent__button--link { border-color: transparent; text-decoration: underline; }

/* Modal de preferências permanece inalterado e confortável. */
.ca-consent__preferences {
    position: fixed;
    z-index: 1000000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
}

.ca-consent__modal {
    width: min(680px, 100%);
    max-height: min(720px, calc(100vh - 40px));
    overflow: auto;
    background: #fff;
    color: #1f2933;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
    padding: 22px;
}

.ca-consent__modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}
.ca-consent__modal-header h2 { margin: 0; font-size: 22px; }
.ca-consent__close { border: 0; background: transparent; font-size: 30px; line-height: 1; }

.ca-consent__category {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid #d9e2ec;
}
.ca-consent__category p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #52606d; }
.ca-consent__category input { width: 22px; height: 22px; flex: 0 0 auto; }
.ca-consent__always { font-size: 12px; font-weight: 700; white-space: nowrap; color: #486581; }
.ca-consent__modal-actions { margin-top: 8px; }

/* Link real de preferências, renderizado diretamente dentro do footer. */
.ca-consent-footer-link-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 2px 0 0;
    padding: 0 10px 2px;
    line-height: 1;
}

.ca-consent-footer-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    margin: 0;
    padding: 2px 3px;
    font: inherit;
    font-size: 9px;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    opacity: .28;
    cursor: pointer;
}

.ca-consent-footer-link:hover,
.ca-consent-footer-link:focus-visible {
    background: transparent;
    color: inherit;
    opacity: .85;
    text-decoration: underline;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .ca-consent-footer-link-wrap {
        padding-right: 7px;
    }
    .ca-consent-footer-link {
        font-size: 8.5px;
        opacity: .25;
    }
}

.ca-consent-modal-open { overflow: hidden; }

@media (max-width: 480px) {
    #ca-consent-root #ca-consent-banner.ca-consent__banner {
        left: auto;
        right: 8px;
        bottom: 8px;
        width: min(280px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
        padding: 11px;
    }
}


/* Sentinel técnico para compatibilidade com JS antigo em cache. Nunca exibir. */
#ca-consent-reopen.ca-consent__legacy-sentinel,
.ca-consent__legacy-sentinel {
    display: none !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Link real que será colocado no template do footer. */
footer.wp-block-template-part .ca-consent-footer-preferences,
.ca-consent-footer-preferences {
    width: 100%;
    margin: 4px 0 0 !important;
    text-align: right !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    opacity: .45;
}
footer.wp-block-template-part .ca-consent-footer-preferences a,
.ca-consent-footer-preferences a {
    color: inherit !important;
    background: transparent !important;
    font-weight: 400 !important;
    text-decoration: none !important;
}
footer.wp-block-template-part .ca-consent-footer-preferences a:hover,
footer.wp-block-template-part .ca-consent-footer-preferences a:focus-visible,
.ca-consent-footer-preferences a:hover,
.ca-consent-footer-preferences a:focus-visible {
    opacity: 1;
    text-decoration: underline !important;
}
