/* ========================================
   CORREÇÃO DEFINITIVA DOS BOTÕES HERO
   Sistema inteligente de dimensionamento
======================================== */

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

.hero-button {
    flex: 1 1 auto !important;
    min-width: 180px !important;
    max-width: 300px !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.4rem !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow: visible !important;
    text-overflow: initial !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;
}

/* Botões com texto longo recebem ajustes específicos */
.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 - Participe Comigo */ {
    min-width: 220px !important;
    max-width: 350px !important;
    font-size: 0.8rem !important;
    padding: 1.1rem 1rem !important;
    line-height: 1.2 !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;
}

/* Botão especial "Este Mandato É Seu" - Layout flexível */
.hero-button:nth-child(10) {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    font-size: 0.85rem !important;
    padding: 1.2rem 1rem !important;
    margin-top: 0.5rem !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    min-height: 55px !important;
}

/* Botão PWA/Instalar App */
.pwa-install-btn-hero,
.hero-button:nth-child(7) {
    flex: 1 1 auto !important;
    max-width: 220px !important;
    order: 11 !important;
}

/* DESKTOP - Layout em grid inteligente */
@media (min-width: 992px) {
    .hero-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        grid-template-rows: auto auto auto auto !important;
        gap: 1.2rem !important;
        max-width: 780px !important;
        padding: 0 2rem !important;
    }
    
    .hero-button {
        min-width: 200px !important;
        max-width: none !important;
        flex: none !important;
        font-size: 0.9rem !important;
        padding: 1.1rem 1.5rem !important;
        height: auto !important;
        min-height: 52px !important;
    }
    
    /* Botões com texto longo - ajustes para desktop */
    .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.85rem !important;
        padding: 1.2rem 1.2rem !important;
        line-height: 1.25 !important;
    }
    
    /* Layout Grid Organizado */
    /* Primeira linha - 3 botões principais */
    .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; }
    
    /* Segunda linha - 3 botões */
    .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; }
    
    /* Terceira linha - 3 botões */
    .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;
        min-height: 55px !important;
        line-height: 1.25 !important;
    }
    
    /* Quarta linha - Botão PWA centralizado */
    .pwa-install-btn-hero,
    .hero-button:nth-child(7) {
        grid-row: 4 !important;
        grid-column: 1 / 4 !important;
        justify-self: center !important;
        max-width: 280px !important;
        order: unset !important;
    }
}

/* TABLET - Layout otimizado */
@media (min-width: 769px) and (max-width: 991px) {
    .hero-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        max-width: 650px !important;
        gap: 1rem !important;
    }
    
    .hero-button {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: 220px !important;
        max-width: 300px !important;
        font-size: 0.85rem !important;
        padding: 1rem 1.3rem !important;
        min-height: 50px !important;
    }
    
    /* Botões com texto longo - ajustes para tablet */
    .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;
        line-height: 1.25 !important;
        min-height: 52px !important;
    }
    
    .hero-button:nth-child(10) {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        margin-top: 0.5rem !important;
        font-size: 0.9rem !important;
        padding: 1.2rem 1.5rem !important;
    }
    
    .pwa-install-btn-hero,
    .hero-button:nth-child(7) {
        flex: 1 1 auto !important;
        max-width: 280px !important;
        order: 11 !important;
    }
}

/* MOBILE - Layout em coluna otimizado */
@media (max-width: 768px) {
    .hero-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.9rem !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;
        padding: 1rem 1rem !important;
        font-size: 0.85rem !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.35 !important;
        height: auto !important;
        min-height: 48px !important;
        word-wrap: break-word !important;
    }
    
    /* Botões com texto longo - ajustes para mobile */
    .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;
        padding: 1.1rem 0.8rem !important;
        line-height: 1.3 !important;
        min-height: 50px !important;
    }
    
    .hero-button:nth-child(10) {
        margin-top: 0 !important;
        order: 10 !important;
        font-size: 0.85rem !important;
        padding: 1.2rem 0.9rem !important;
        min-height: 52px !important;
    }
    
    .pwa-install-btn-hero,
    .hero-button:nth-child(7) {
        max-width: 100% !important;
        order: 9 !important;
    }
    
    .hero-button i {
        font-size: 1rem !important;
        margin-right: 0.4rem !important;
        flex-shrink: 0 !important;
    }
}

/* MOBILE PEQUENO - Ajustes extras */
@media (max-width: 480px) {
    .hero-actions {
        padding: 0 0.7rem !important;
        gap: 0.8rem !important;
    }
    
    .hero-button {
        padding: 0.9rem 0.8rem !important;
        font-size: 0.8rem !important;
        min-height: 46px !important;
        line-height: 1.3 !important;
    }
    
    /* Botões com texto longo - mobile pequeno */
    .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.75rem !important;
        padding: 1rem 0.6rem !important;
        line-height: 1.25 !important;
    }
    
    .hero-button:nth-child(10) {
        font-size: 0.8rem !important;
        padding: 1.1rem 0.7rem !important;
        min-height: 48px !important;
    }
    
    .hero-button i {
        font-size: 0.9rem !important;
        margin-right: 0.3rem !important;
    }
}

/* MOBILE EXTRA PEQUENO - Garantir que tudo funcione */
@media (max-width: 360px) {
    .hero-actions {
        padding: 0 0.5rem !important;
        gap: 0.7rem !important;
    }
    
    .hero-button {
        padding: 0.8rem 0.5rem !important;
        font-size: 0.75rem !important;
        gap: 0.25rem !important;
        min-height: 44px !important;
        line-height: 1.2 !important;
    }
    
    /* Botões com texto longo - mobile extra pequeno */
    .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.7rem !important;
        padding: 0.9rem 0.4rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-button:nth-child(10) {
        font-size: 0.75rem !important;
        padding: 1rem 0.5rem !important;
        min-height: 46px !important;
    }
    
    .hero-button i {
        font-size: 0.8rem !important;
        margin-right: 0.2rem !important;
    }
}

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

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

/* Garantir que os botões mantenham proporção adequada */
.hero-button {
    aspect-ratio: auto !important;
    max-height: none !important;
}

/* Melhor alinhamento vertical do conteúdo */
.hero-button {
    align-items: center !important;
    justify-content: center !important;
}