/* ============================================================
   BANNER DE COOKIES — Portal Agro LGPD
   ============================================================ */

/* --- Banner principal (fixo na parte inferior) --- */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #1a2e20;
    border-top: 3px solid #c56939;
    box-shadow: 0 -4px 24px rgba(0,0,0,.25);
    padding: 20px 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', 'Open Sans', sans-serif;
}

/* Animação de entrada */
#cookie-banner.ativo {
    transform: translateY(0);
}

#cookie-banner .cookie-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Ícone */
#cookie-banner .cookie-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

/* Texto */
#cookie-banner .cookie-texto {
    flex: 1;
    min-width: 240px;
}

#cookie-banner .cookie-texto p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(255,255,255,.82);
}

#cookie-banner .cookie-texto p strong {
    color: #fff;
    font-weight: 600;
}

#cookie-banner .cookie-texto a {
    color: #c56939;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

#cookie-banner .cookie-texto a:hover {
    color: #d97a4a;
}

/* Botões */
#cookie-banner .cookie-acoes {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
}

#cookie-banner .btn-aceitar {
    background: #2f5e3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(47,94,60,.4);
}

#cookie-banner .btn-aceitar:hover {
    background: #3d7a50;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(47,94,60,.5);
}

#cookie-banner .btn-essenciais {
    background: transparent;
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

#cookie-banner .btn-essenciais:hover {
    border-color: rgba(255,255,255,.6);
    color: #fff;
    background: rgba(255,255,255,.06);
}

/* --- Modal de preferências --- */
#cookie-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#cookie-modal.aberto {
    display: flex;
}

#cookie-modal .cookie-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
}

#cookie-modal .cookie-modal-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    z-index: 1;
}

#cookie-modal .cookie-modal-header {
    background: #1a2e20;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#cookie-modal .cookie-modal-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    font-family: 'Inter', 'Open Sans', sans-serif;
}

#cookie-modal .cookie-modal-fechar {
    background: rgba(255,255,255,.1);
    border: none;
    color: rgba(255,255,255,.8);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

#cookie-modal .cookie-modal-fechar:hover {
    background: rgba(255,255,255,.2);
    color: #fff;
}

#cookie-modal .cookie-modal-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Categoria de cookie */
.cookie-categoria {
    border: 1px solid #e4e8e3;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.cookie-categoria-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f7f8f6;
    gap: 12px;
}

.cookie-categoria-info {
    flex: 1;
}

.cookie-categoria-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2e3830;
    margin-bottom: 2px;
    font-family: 'Inter', 'Open Sans', sans-serif;
}

.cookie-categoria-info span {
    font-size: 12.5px;
    color: #606b63;
    line-height: 1.4;
    font-family: 'Inter', 'Open Sans', sans-serif;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.25s;
}

.cookie-toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #2f5e3c;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background: #2f5e3c;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Badge "sempre ativo" */
.cookie-badge-fixo {
    font-size: 11px;
    font-weight: 600;
    color: #2f5e3c;
    background: #e8f2eb;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Inter', 'Open Sans', sans-serif;
}

#cookie-modal .cookie-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e4e8e3;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

#cookie-modal .btn-salvar-pref {
    background: #2f5e3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

#cookie-modal .btn-salvar-pref:hover {
    background: #3d7a50;
    transform: translateY(-1px);
}

#cookie-modal .btn-aceitar-todos {
    background: #c56939;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

#cookie-modal .btn-aceitar-todos:hover {
    background: #a8552b;
    transform: translateY(-1px);
}

/* --- Link discreto no rodapé --- */
.cookie-pref-link {
    font-size: 12.5px;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    font-family: 'Inter', 'Open Sans', sans-serif;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cookie-pref-link:hover {
    color: rgba(255,255,255,.85);
    text-decoration: none;
}

/* --- Responsivo --- */
@media (max-width: 768px) {
    #cookie-banner .cookie-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    #cookie-banner .cookie-acoes {
        width: 100%;
        justify-content: stretch;
    }

    #cookie-banner .btn-aceitar,
    #cookie-banner .btn-essenciais {
        flex: 1;
        text-align: center;
        padding: 12px 16px;
    }

    #cookie-modal .cookie-modal-footer {
        flex-direction: column;
    }

    #cookie-modal .btn-salvar-pref,
    #cookie-modal .btn-aceitar-todos {
        width: 100%;
        text-align: center;
    }
}
