﻿/* ===== Namespaced Cookie Banner to avoid collisions ===== */
.clout-cookie {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    z-index: 9999;
}

.clout-cookie__card {
    width: min(920px, 96vw);
    height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(107, 33, 255, .16), rgba(42, 0, 114, .16)), #0e0a19;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.clout-cookie__title {
    font-weight: 800;
    color: #fff;
    margin: 0;
    white-space: nowrap;
}

.clout-cookie__desc {
    font-size: .95rem;
    line-height: 1.3;
    color: #cbd5e1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48vw;
}

.clout-cookie__desc a {
    color: #93c5fd;
    text-decoration: underline;
}

.clout-cookie__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.clout-cookie__btn {
    background: #f3f4f6;
    color: #111827;
    border: none;
    padding: .5rem .9rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    white-space: nowrap;
}

.clout-cookie__btn--ghost {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, .25);
}

.clout-cookie__prefs {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding-top: 10px;
}

.clout-cookie__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
}

.clout-cookie__muted {
    font-size: .85rem;
    color: #9ca3af;
}

@media (max-width: 576px) {
    .clout-cookie {
        position: fixed;
        left: 16px;
        right: 16px;
        transform: none;
        bottom: 12px;
        z-index: 9999;
    }

    .clout-cookie__card {
        width: calc(100% - 32px);
        max-width: none;
        height: auto;
        padding: 8px 10px;
        border-radius: 10px;
        box-sizing: border-box;
        gap: 8px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        max-height: calc(100vh - 32px);
        overflow: auto;
    }

    .clout-cookie__title {
        font-size: 0.95rem;
        font-weight: 800;
        white-space: normal;
    }

    .clout-cookie__desc {
        font-size: 0.9rem;
        line-height: 1.2;
        color: #cbd5e1;
        margin: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
        word-break: break-word;
    }

    /* flexible layout so long text wraps naturally and buttons stay visible */
    .clout-cookie__title { flex: 0 0 auto; margin-right: 6px; }
    .clout-cookie__desc  { flex: 1 1 auto; min-width: 0; }

    .clout-cookie__actions {
        gap: 6px;
        margin-left: 8px;
        flex: 0 0 auto;
    }

    .clout-cookie__btn {
        padding: .4rem .7rem;
        font-size: .85rem;
        border-radius: 8px;
    }

    .clout-cookie__btn--ghost {
        padding: .35rem .6rem;
        font-size: .85rem;
    }

    /* Preferências: empilhar e ajustar rows no mobile para evitar textos fugindo */
    .clout-cookie__card.has-prefs .clout-cookie__prefs {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        padding-top: 8px;
        margin-top: 8px;
        box-sizing: border-box;
    }

    .clout-cookie__card.has-prefs .clout-cookie__prefs .clout-cookie__row {
        flex: 0 0 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 6px 0;
    }

    .clout-cookie__card.has-prefs .clout-cookie__prefs .clout-cookie__row > label,
    .clout-cookie__card.has-prefs .clout-cookie__prefs .clout-cookie__row > div {
        flex: 1 1 auto;
        min-width: 0; /* allow text to wrap */
        margin-right: 8px;
        word-break: break-word;
    }

    .clout-cookie__card.has-prefs .clout-cookie__prefs .clout-cookie__row .cbx {
        flex: 0 0 auto;
        margin-left: 8px;
    }

    .clout-cookie__prefsActions {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
        flex-wrap: wrap;
        margin-top: 6px;
    }

    .clout-cookie__muted { font-size: .78rem; }
}

/* When preferences are open, wrap content and keep inside bar */
.clout-cookie__card.has-prefs {
    height: auto;
    flex-wrap: wrap;
    padding-bottom: 10px;
}

.clout-cookie__prefs {
    display: none;
    width: 100%;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.clout-cookie__card.has-prefs .clout-cookie__prefs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clout-cookie__row {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.clout-cookie__row input {
    margin-left: 8px;
}

/* Cookie banner checkbox style (as provided), scoped */
.clout-cookie .cbx {
    -webkit-perspective: 20;
    perspective: 20;
    position: relative;
    margin: 0;
    border: 2px solid #e8e8eb;
    background: transparent; /* borda estática, sem fundo cinza virando */
    border-radius: 4px;
    overflow: hidden; /* clipa o conteúdo que vira dentro da borda */
    transform: translate3d(0, 0, 0);
    cursor: pointer;
    transition: all .3s ease;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.clout-cookie .cbx:hover {
    border-color: #e8e8eb;
}

/* Acessibilidade: destaque no foco via teclado */
.clout-cookie .cbx:focus-within {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    border-color: #93c5fd;
}

.clout-cookie .cbx .flip {
    display: block;
    transition: transform .4s ease;
    transform-style: preserve-3d;
    position: absolute;
    inset: 2px; /* ocupa apenas o miolo: borda de 2px fica fixa */
    border-radius: 2px;
    will-change: transform;
}

.clout-cookie .cbx input {
    display: none;
}

.clout-cookie .cbx .front,
.clout-cookie .cbx .back {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: inherit; /* igual ao miolo para não sobrepor a borda */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Frente (estado desmarcado): branca e virada para o usuário */
.clout-cookie .cbx .front {
    background: #fff; /* preenchimento branco quando desmarcado */
    color: #111827;
    transform: rotateY(0deg);
    z-index: 1;
}

/* Verso (estado marcado): azul com ícone de check, inicialmente virado para trás */
.clout-cookie .cbx .back {
    background: #0b76ef;
    color: #fff;
    transform: rotateY(180deg);
}

.clout-cookie .cbx .back svg {
    margin-top: 0; /* centralizado verticalmente */
    display: block; /* evita baseline que desequilibra o centro */
    fill: none;
}

.clout-cookie .cbx .back svg path {
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.clout-cookie .cbx input:checked+.flip {
    transform: rotateY(180deg);
}