/*
 * #COOKIE-CONSENT-01 — Rebbify Cookie Consent
 * Contrato global: popup independente do layout, responsivo e sem sobrepor
 * a estrutura do cabeçalho. Rejeitar = preto; Aceitar/Salvar = roxo Rebbify.
 */
:root {
    --rebbify-cookie-purple: #7c4dff;
    --rebbify-cookie-purple-hover: #6c3df0;
    --rebbify-cookie-black: #111111;
    --rebbify-cookie-text: #242429;
    --rebbify-cookie-muted: #606069;
    --rebbify-cookie-border: #e8e8ed;
    --rebbify-cookie-surface: #ffffff;
    --rebbify-cookie-soft: #f6f6f8;
}

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

.rebbify-cookie-consent {
    position: fixed;
    right: 20px;
    left: auto;
    bottom: 20px;
    z-index: 2100;
    width: min(540px, calc(100vw - 40px));
    padding: 22px;
    background: var(--rebbify-cookie-surface);
    color: var(--rebbify-cookie-text);
    border: 1px solid var(--rebbify-cookie-border);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(17, 17, 17, .16), 0 3px 12px rgba(17, 17, 17, .07);
    font-family: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease;
}

.rebbify-cookie-consent.is-leaving {
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
}

.rebbify-cookie-consent.is-busy {
    pointer-events: none;
    opacity: .78;
}

.rebbify-cookie-consent__view[hidden] {
    display: none !important;
}

.rebbify-cookie-consent__title {
    margin: 0 0 14px;
    color: var(--rebbify-cookie-black);
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.45px;
}

.rebbify-cookie-consent__text {
    margin: 0;
    color: var(--rebbify-cookie-muted);
    font-size: 13px;
    line-height: 1.55;
    font-weight: 400;
}

.rebbify-cookie-consent__text--settings {
    margin-bottom: 16px;
}

.rebbify-cookie-consent__link {
    color: var(--rebbify-cookie-black);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rebbify-cookie-consent__link:hover {
    color: var(--rebbify-cookie-purple);
}

.rebbify-cookie-consent__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.rebbify-cookie-consent__footer--settings {
    margin-top: 16px;
}

.rebbify-cookie-consent__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rebbify-cookie-consent__button {
    min-height: 40px;
    padding: 10px 15px;
    border-radius: 9px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}

.rebbify-cookie-consent__button:active {
    transform: scale(.98);
}

.rebbify-cookie-consent__button:focus-visible,
.rebbify-cookie-consent__link:focus-visible,
.rebbify-cookie-switch input:focus-visible + .rebbify-cookie-switch__track {
    outline: 3px solid rgba(124, 77, 255, .26);
    outline-offset: 2px;
}

.rebbify-cookie-consent__button--settings {
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    color: var(--rebbify-cookie-black);
}

.rebbify-cookie-consent__button--settings:hover {
    color: var(--rebbify-cookie-purple);
}

.rebbify-cookie-consent__button--reject {
    background: var(--rebbify-cookie-black);
    border-color: var(--rebbify-cookie-black);
    color: #ffffff;
}

.rebbify-cookie-consent__button--reject:hover {
    background: #27272a;
    border-color: #27272a;
}

.rebbify-cookie-consent__button--accept {
    background: var(--rebbify-cookie-purple);
    border-color: var(--rebbify-cookie-purple);
    color: #ffffff;
}

.rebbify-cookie-consent__button--accept:hover {
    background: var(--rebbify-cookie-purple-hover);
    border-color: var(--rebbify-cookie-purple-hover);
}

.rebbify-cookie-preference {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 13px 14px;
    margin-top: 10px;
    background: var(--rebbify-cookie-soft);
    border-radius: 10px;
}

.rebbify-cookie-preference strong,
.rebbify-cookie-preference span {
    display: block;
}

.rebbify-cookie-preference strong {
    margin-bottom: 3px;
    color: var(--rebbify-cookie-black);
    font-size: 13px;
    font-weight: 700;
}

.rebbify-cookie-preference div > span {
    color: var(--rebbify-cookie-muted);
    font-size: 11px;
    line-height: 1.4;
}

.rebbify-cookie-preference__status {
    flex: 0 0 auto;
    color: var(--rebbify-cookie-purple);
    font-size: 11px;
    font-weight: 700;
}

.rebbify-cookie-preference--toggle {
    cursor: pointer;
}

.rebbify-cookie-switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
}

.rebbify-cookie-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.rebbify-cookie-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #d7d7dc;
    transition: background-color .16s ease;
}

.rebbify-cookie-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    transition: transform .16s ease;
}

.rebbify-cookie-switch input:checked + .rebbify-cookie-switch__track {
    background: var(--rebbify-cookie-purple);
}

.rebbify-cookie-switch input:checked + .rebbify-cookie-switch__track::after {
    transform: translateX(18px);
}

[data-theme="dark"] .rebbify-cookie-consent,
html[data-theme="dark"] .rebbify-cookie-consent,
body.dark .rebbify-cookie-consent {
    --rebbify-cookie-black: #ffffff;
    --rebbify-cookie-text: #f5f5f7;
    --rebbify-cookie-muted: #c4c4cc;
    --rebbify-cookie-border: #33333b;
    --rebbify-cookie-surface: #1b1b20;
    --rebbify-cookie-soft: #25252c;
}

@media (max-width: 640px) {
    .rebbify-cookie-consent {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-height: min(82dvh, 680px);
        overflow-y: auto;
        padding: 18px;
        border-radius: 14px;
    }

    .rebbify-cookie-consent__title {
        margin-bottom: 11px;
        font-size: 20px;
    }

    .rebbify-cookie-consent__text {
        font-size: 12.5px;
        line-height: 1.5;
    }

    .rebbify-cookie-consent__footer,
    .rebbify-cookie-consent__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .rebbify-cookie-consent__button {
        width: 100%;
        min-height: 44px;
        padding: 11px 14px;
        text-align: center;
    }

    .rebbify-cookie-consent__button--settings {
        padding-left: 14px;
        padding-right: 14px;
    }

    .rebbify-cookie-preference {
        gap: 12px;
        padding: 12px;
    }
}

@media (max-width: 390px) {
    .rebbify-cookie-consent {
        padding: 16px;
    }

    .rebbify-cookie-consent__title {
        font-size: 19px;
    }

    .rebbify-cookie-consent__text {
        font-size: 12px;
    }
}
