/**
 * WENTZ IMOVEIS V3 - ESTILOS DO BANNER DE COOKIES
 * Design moderno e responsivo para LGPD
 */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.98) 0%, rgba(26, 26, 46, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    padding: 0.875rem 1rem;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: transform;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text h3 {
    color: #00d4ff;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-banner-text h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2rem;
    background: linear-gradient(135deg, #00d4ff 0%, #D4AF37 100%);
    border-radius: 2px;
}

.cookie-banner-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.cookie-banner-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}

.cookie-btn:active {
    transform: scale(0.98);
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #00d4ff 0%, #00a8cc 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.5);
}

.cookie-btn-decline {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.cookie-btn-decline:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Animacao de pulso sutil no botao aceitar */
@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 2px 15px rgba(0, 212, 255, 0.5);
    }
}

.cookie-btn-accept {
    animation: subtle-pulse 2s ease-in-out infinite;
}

.cookie-btn-accept:hover {
    animation: none;
}

/* Tablet */
@media (max-width: 1024px) {
    .cookie-banner {
        padding: 1.25rem;
    }

    .cookie-banner-content {
        gap: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 0.5rem 0.75rem;
    }

    .cookie-banner-content {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .cookie-banner-text {
        text-align: left;
        min-width: auto;
        flex: 1;
    }

    .cookie-banner-text h3 {
        font-size: 0.95rem;
        margin-bottom: 0.15rem;
    }

    .cookie-banner-text p {
        font-size: 0.875rem; /* 14 px (F-020; era 12,8 px) */
        line-height: 1.25;
    }

    .cookie-banner-actions {
        flex-direction: row;
        width: auto;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .cookie-btn {
        width: auto;
        min-height: 44px; /* alvo de toque (F-020; era 29-31 px) */
        justify-content: center;
        padding: 0.5rem 0.45rem;
        font-size: 0.85rem;
        gap: 0.3rem;
    }

    .cookie-btn i {
        font-size: 0.8rem;
    }
}

/* Mobile pequeno: empilha (texto em cima, botoes lado a lado embaixo) em vez de espremer o texto em ~130 px (F-020).
   R-P2-03: espacamentos enxutos para o banner nunca ficar mais alto que na release (ver p2_cookies_altura.py). */
@media (max-width: 480px) {
    .cookie-banner {
        padding: 0.375rem 0.75rem;
        padding-bottom: max(0.375rem, env(safe-area-inset-bottom));
    }

    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }

    .cookie-banner-text h3 {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .cookie-banner-text h3::before {
        height: 1rem;
    }

    .cookie-banner-text p {
        font-size: 0.875rem; /* 14 px */
        line-height: 1.25;
    }

    .cookie-banner-actions {
        width: 100%;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .cookie-btn {
        flex: 1 1 0;
        min-height: 44px;
        justify-content: center;
        font-size: 0.875rem;
        padding: 0.45rem 0.5rem;
        gap: 0.3rem;
    }
    
    .cookie-btn i {
        font-size: 0.8rem;
    }
}

/* Telas muito estreitas (<= 359 px): 12 px (igual a release) para o texto nao ganhar uma linha a mais */
@media (max-width: 359px) {
    .cookie-banner {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .cookie-banner-text p {
        font-size: 0.75rem;
    }
}

/* Acessibilidade - Modo de alto contraste */
@media (prefers-contrast: high) {
    .cookie-banner {
        background: rgba(0, 0, 0, 0.95);
        border-top: 2px solid #00d4ff;
    }

    .cookie-btn-accept {
        background: #00d4ff;
        color: #000;
    }

    .cookie-btn-decline {
        background: transparent;
        border: 2px solid #fff;
        color: #fff;
    }
}

/* Animacao de entrada suave para o banner */
@keyframes slideUpFade {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner.show {
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Garantir que o banner fique acima de tudo */
.cookie-banner {
    isolation: isolate;
}


/* Link "Preferencias de cookies" no rodape (reabre o banner; revogar consentimento) */
.footer-cookie-prefs {
    background: none;
    border: 0;
    padding: 0.75rem 0.5rem;
    min-height: 44px;
    color: rgba(255, 255, 255, 0.7);
    font: inherit;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}

.footer-cookie-prefs:hover,
.footer-cookie-prefs:focus-visible {
    color: #00d4ff;
}


/* ==================== ONDA H1a (item 150): banner mais compacto no celular, so estilo ====================
   Mesmo texto, mesma ordem Aceitar/Recusar, mesmo comportamento. O titulo passa a correr na mesma linha do texto
   (economiza uma linha), a letra fica em 12 px (o minimo) e os botoes seguem lado a lado com 44 px de altura. */
@media (max-width: 480px) {
    .cookie-banner {
        padding-top: 0.3rem;
    }

    .cookie-banner-content {
        gap: 0.25rem;
    }

    .cookie-banner-text {
        font-size: 0.75rem; /* a linha base herda esse tamanho: sem isso a entrelinha sai de 16 px */
        line-height: 1.3;
    }

    .cookie-banner-text h3 {
        display: inline;
        font-size: 0.75rem;
        line-height: 1.3;
        margin: 0 0.3rem 0 0;
    }

    .cookie-banner-text h3::before {
        width: 3px;
        height: 0.85em;
        margin-right: 0.35rem;
        vertical-align: -0.05em;
    }

    .cookie-banner-text p {
        display: inline;
        font-size: 0.75rem;
        line-height: 1.3;
    }

    .cookie-btn {
        min-height: 44px;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }
}

/* Toque: botoes com 44 px em qualquer largura e link da politica com area de toque de 44 px. A area extra do link e um
   ::after transparente que cresce so para cima (sobre o texto), para nao invadir os botoes; o layout do banner nao muda
   e o link continua quebrando linha como texto normal. */
@media (pointer: coarse) {
    .cookie-btn {
        min-height: 44px;
    }

    .cookie-banner-text a {
        position: relative;
        white-space: nowrap; /* um so pedaco de linha: a area extra cobre o link inteiro */
    }

    .cookie-banner-text a::after {
        content: '';
        position: absolute;
        top: -1.9rem;
        bottom: 0;
        left: -0.25rem;
        right: -0.25rem;
    }
}
