/*
    BANNER DE COOKIES UNIVERSAL - AG5 AGENCIA
    Design Premium, Responsivo e LGPD Compliant
    -------------------------------------------
    Versão: 1.2
    Paleta: Magrão Auto Center (Black, Red, Gold)
*/

:root {
    /* Cores do Banner - Integradas com a Identidade Magrão */
    --cb-bg: #1a1a1a;
    --cb-text: #ffffff;
    --cb-text-muted: #a0a0a0;
    --cb-primary: #e31e24; /* Vermelho Magrão */
    --cb-primary-hover: #c4191f;
    --cb-accent: #ffcc00; /* Destaque */
    --cb-border: rgba(255, 255, 255, 0.1);
    --cb-card-bg: #242424;
    --cb-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --cb-radius-sm: 8px;
    --cb-radius-md: 12px;
    --cb-radius-lg: 20px;

    /* ── Cores principais (Sutis e Integradas) ── */
    --ck-bg: #1a1a1a;
    /* Fundo neutro e discreto */
    --ck-accent: #C41230;
    /* Vermelho Magrão Auto Center */
    --ck-accent-dark: #9a0e25;
    /* Tom mais fechado para hover */
    --ck-accent-rgb: 196, 18, 48;
    /* RGB correspondente ao #D9B76A */

    /* ── Texto ── */
    --ck-text-primary: rgba(255, 255, 255, 0.95);
    --ck-text-muted: rgba(255, 255, 255, 0.8);
    /* Contraste aumentado para melhor legibilidade */
    --ck-text-link: var(--ck-accent);

    /* ── Modal (fundo claro) ── */
    --ck-modal-bg: #ffffff;
    --ck-modal-footer-bg: #f8f9fa;
    --ck-modal-border: rgba(0, 0, 0, 0.1);
    --ck-modal-text: #1a1a1a;
    --ck-modal-text-muted: #4a4a4a;
    /* Escurecido para melhor leitura */
    --ck-modal-category-name: #111111;

    /* ── Toggle ── */
    --ck-toggle-off: #d0d5db;
    --ck-toggle-on: var(--ck-accent);

    /* ── Layout ── */
    --ck-radius: 12px;
    --ck-radius-sm: 5px;
    --ck-max-width: 1280px;
    --ck-modal-max-width: 520px;

    /* ── Animação ── */
    --ck-transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);
    --ck-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* ── Z-index ── */
    --ck-z-banner: 9000;
    --ck-z-overlay: 9050;
    --ck-z-modal: 9100;
    --ck-z-float: 8999;
}

/* Container Principal */
#cookie-banner-root {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    z-index: 999999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: none; /* Controlado via JS */
    pointer-events: none;
}

#cookie-banner-root.active {
    display: block;
}

.cb-container {
    max-width: 450px;
    background: var(--cb-bg);
    color: var(--cb-text);
    border-radius: var(--cb-radius-md);
    border: 1px solid var(--cb-border);
    box-shadow: var(--cb-shadow);
    padding: 24px;
    pointer-events: all;
    animation: cb-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Efeito de Vidro Sutil */
@supports (backdrop-filter: blur(10px)) {
    .cb-container {
        background: rgba(26, 26, 26, 0.95);
        backdrop-filter: blur(10px);
    }
}

@keyframes cb-slide-up {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Cabeçalho */
.cb-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.cb-icon-box {
    width: 40px;
    height: 40px;
    background: rgba(227, 30, 36, 0.15);
    border-radius: var(--cb-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cb-primary);
}

.cb-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Conteúdo */
.cb-content p {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--cb-text-muted);
}

.cb-link {
    color: var(--cb-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.cb-link:hover {
    border-bottom-color: var(--cb-primary);
}

/* Botões */
.cb-actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 12px;
}

.cb-btn {
    padding: 12px 16px;
    border-radius: var(--cb-radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-btn-secondary {
    background: transparent;
    color: var(--cb-text);
    border: 1px solid var(--cb-border);
}

.cb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.cb-btn-primary {
    background: var(--cb-primary);
    color: #fff;
}

.cb-btn-primary:hover {
    background: var(--cb-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.3);
}

/* Modal de Preferências */
.cb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.cb-modal-overlay.active {
    display: flex;
}

.cb-modal {
    width: 100%;
    max-width: 600px;
    background: var(--cb-bg);
    border-radius: var(--cb-radius-lg);
    border: 1px solid var(--cb-border);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: cb-modal-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cb-modal-in {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.cb-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--cb-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cb-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--cb-text);
}

.cb-modal-close {
    background: transparent;
    border: none;
    color: var(--cb-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.cb-modal-close:hover {
    color: var(--cb-text);
}

.cb-modal-body {
    padding: 32px;
    overflow-y: auto;
}

/* Opções de Cookies */
.cb-option {
    background: var(--cb-card-bg);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-md);
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.cb-option:hover {
    border-color: rgba(227, 30, 36, 0.3);
}

.cb-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cb-option-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
}

.cb-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-transform: uppercase;
    color: var(--cb-text-muted);
}

.cb-badge-required {
    background: rgba(227, 30, 36, 0.15);
    color: var(--cb-primary);
}

.cb-option-desc {
    font-size: 0.85rem;
    color: var(--cb-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Switch UI */
.cb-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.cb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cb-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 24px;
}

.cb-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .cb-slider {
    background-color: var(--cb-primary);
}

input:checked + .cb-slider:before {
    transform: translateX(20px);
}

input:disabled + .cb-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cb-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--cb-border);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

/* Responsividade */
@media (max-width: 600px) {
    #cookie-banner-root {
        bottom: 0;
        left: 0;
        right: 0;
    }

    .cb-container {
        max-width: 100%;
        border-radius: var(--cb-radius-lg) var(--cb-radius-lg) 0 0;
        padding: 24px 20px 32px;
    }

    .cb-actions {
        grid-template-columns: 1fr;
    }

    .cb-btn-primary {
        order: -1;
    }

    .cb-modal {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .cb-modal-header, .cb-modal-body, .cb-modal-footer {
        padding: 20px;
    }

}

/* Custom Scrollbar para o Modal */
.cb-modal-body::-webkit-scrollbar {
    width: 6px;
}

.cb-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.cb-modal-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.cb-modal-body::-webkit-scrollbar-thumb:hover {
    background: #444;
}


