/* ========================================
   CORREÇÃO LIMPA E DEFINITIVA DOS BOTÕES
   Layout responsivo e organizado
======================================== */

/* Reset completo dos botões */
.hero-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 2rem auto 0 auto !important;
    padding: 0 1rem !important;
    box-sizing: border-box !important;
}

.hero-button {
    flex: 1 1 calc(33.333% - 0.67rem) !important;
    min-width: 200px !important;
    max-width: 280px !important;
    padding: 1rem 1.2rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: 50px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    line-height: 1.3 !important;
    min-height: 50px !important;
    height: auto !important;
    text-decoration: none !important;
    order: 0 !important;
}

.hero-button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

.hero-button i {
    font-size: 1rem !important;
    flex-shrink: 0 !important;
    margin-right: 0.3rem !important;
}

/* Ajustes específicos para botões com texto longo */
.hero-button:nth-child(4), /* Empreendedorismo Local */
.hero-button:nth-child(6), /* Esporte e Bem-estar Local */
.hero-button:nth-child(10) { /* Este Mandato É Seu */
    font-size: 0.8rem !important;
    min-width: 220px !important;
    padding: 1.1rem 1rem !important;
    line-height: 1.2 !important;
}

/* Botão PWA - Hidden por padrão */
.pwa-install-btn-hero,
.hero-button:nth-child(7) {
    display: none !important;
}

/* ===== LAYOUT DESKTOP ===== */
@media (min-width: 992px) {
    .hero-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        grid-template-rows: repeat(4, auto) !important;
        gap: 1.2rem !important;
        max-width: 800px !important;
        padding: 0 2rem !important;
    }
    
    .hero-button {
        flex: none !important;
        min-width: 200px !important;
        max-width: none !important;
        font-size: 0.9rem !important;
        padding: 1.1rem 1.5rem !important;
        min-height: 52px !important;
    }
    
    /* POSICIONAMENTO EXATO NO GRID */
    /* Linha 1: Fale Comigo | Ver Projetos | Parcerias Educacionais */
    .hero-button:nth-child(1) { grid-row: 1; grid-column: 1; }
    .hero-button:nth-child(2) { grid-row: 1; grid-column: 2; }
    .hero-button:nth-child(3) { grid-row: 1; grid-column: 3; }
    
    /* Linha 2: Empreendedorismo | Saúde Cidadã | Esporte */
    .hero-button:nth-child(4) { grid-row: 2; grid-column: 1; }
    .hero-button:nth-child(5) { grid-row: 2; grid-column: 2; }
    .hero-button:nth-child(6) { grid-row: 2; grid-column: 3; }
    
    /* Linha 3: Transparência | Assistente Digital | Este Mandato */
    .hero-button:nth-child(8) { grid-row: 3; grid-column: 1; }
    .hero-button:nth-child(9) { grid-row: 3; grid-column: 2; }
    .hero-button:nth-child(10) { 
        grid-row: 3; 
        grid-column: 3;
        font-size: 0.85rem !important;
        padding: 1.2rem 1rem !important;
        line-height: 1.25 !important;
    }
    
    /* Linha 4: PWA centralizado (quando visível) */
    .pwa-install-btn-hero,
    .hero-button:nth-child(7) {
        grid-row: 4 !important;
        grid-column: 1 / 4 !important;
        justify-self: center !important;
        max-width: 300px !important;
        display: block !important;
    }
    
    /* Ajustes para textos longos no desktop */
    .hero-button:nth-child(4), /* Empreendedorismo */
    .hero-button:nth-child(6), /* Esporte */
    .hero-button:nth-child(10) { /* Este Mandato */
        font-size: 0.85rem !important;
        padding: 1.2rem 1.2rem !important;
        line-height: 1.25 !important;
    }
}

/* ===== LAYOUT TABLET ===== */
@media (min-width: 769px) and (max-width: 991px) {
    .hero-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        max-width: 700px !important;
        gap: 1rem !important;
    }
    
    .hero-button {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: 200px !important;
        max-width: 320px !important;
        font-size: 0.85rem !important;
        padding: 1rem 1.2rem !important;
        min-height: 50px !important;
    }
    
    /* Botão "Este Mandato É Seu" ocupa linha inteira */
    .hero-button:nth-child(10) {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        font-size: 0.9rem !important;
        padding: 1.2rem 1.5rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* PWA quando visível */
    .pwa-install-btn-hero,
    .hero-button:nth-child(7) {
        flex: 1 1 auto !important;
        max-width: 280px !important;
        display: block !important;
        order: 100 !important;
    }
    
    /* Ajustes para textos longos no tablet */
    .hero-button:nth-child(4), /* Empreendedorismo */
    .hero-button:nth-child(6) { /* Esporte */
        font-size: 0.8rem !important;
        line-height: 1.25 !important;
    }
}

/* ===== LAYOUT MOBILE ===== */
@media (max-width: 768px) {
    .hero-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.8rem !important;
        max-width: 100% !important;
        padding: 0 1rem !important;
    }
    
    .hero-button {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        flex: none !important;
        font-size: 0.85rem !important;
        padding: 1rem 1rem !important;
        min-height: 48px !important;
        line-height: 1.3 !important;
    }
    
    /* Ajustes para textos longos no mobile */
    .hero-button:nth-child(4), /* Empreendedorismo */
    .hero-button:nth-child(6), /* Esporte */
    .hero-button:nth-child(10) { /* Este Mandato */
        font-size: 0.8rem !important;
        padding: 1.1rem 0.8rem !important;
        line-height: 1.25 !important;
        min-height: 50px !important;
    }
    
    /* PWA quando visível */
    .pwa-install-btn-hero,
    .hero-button:nth-child(7) {
        display: block !important;
        order: 100 !important;
    }
}

/* ===== MOBILE PEQUENO ===== */
@media (max-width: 480px) {
    .hero-actions {
        gap: 0.7rem !important;
        padding: 0 0.8rem !important;
    }
    
    .hero-button {
        font-size: 0.8rem !important;
        padding: 0.9rem 0.8rem !important;
        min-height: 46px !important;
    }
    
    /* Ajustes para textos longos no mobile pequeno */
    .hero-button:nth-child(4), /* Empreendedorismo */
    .hero-button:nth-child(6), /* Esporte */
    .hero-button:nth-child(10) { /* Este Mandato */
        font-size: 0.75rem !important;
        padding: 1rem 0.6rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-button i {
        font-size: 0.9rem !important;
        margin-right: 0.25rem !important;
    }
}

/* ===== MOBILE EXTRA PEQUENO ===== */
@media (max-width: 360px) {
    .hero-actions {
        gap: 0.6rem !important;
        padding: 0 0.5rem !important;
    }
    
    .hero-button {
        font-size: 0.75rem !important;
        padding: 0.8rem 0.6rem !important;
        min-height: 44px !important;
        gap: 0.3rem !important;
    }
    
    /* Ajustes para textos longos no mobile extra pequeno */
    .hero-button:nth-child(4), /* Empreendedorismo */
    .hero-button:nth-child(6), /* Esporte */
    .hero-button:nth-child(10) { /* Este Mandato */
        font-size: 0.7rem !important;
        padding: 0.9rem 0.4rem !important;
        line-height: 1.15 !important;
    }
    
    .hero-button i {
        font-size: 0.8rem !important;
        margin-right: 0.2rem !important;
    }
}

/* ===== MELHORIAS VISUAIS ===== */
.hero-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: 2px !important;
}

/* Animação suave para todas as transições */
.hero-button, .hero-actions {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Garantir que nenhum botão seja cortado */
.hero-button {
    overflow: visible !important;
    text-overflow: initial !important;
    white-space: normal !important;
}

/* Remove qualquer positioning absoluto que possa causar sobreposição */
.hero-button {
    position: relative !important;
}

/* Evitar conflitos com outros estilos */
.hero-actions * {
    box-sizing: border-box !important;
}

/* Garantir que o container pai não cause problemas */
.hero-text {
    overflow: visible !important;
}

.hero-content {
    overflow: visible !important;
}