/* =========================================
   RESPONSIVIDADE (MOBILE) - FOOTER INTEGRADO
   Arquivo: /assets/css/mobile/footer.css
   ========================================= */

@media (max-width: 1024px) {

    /* --- 0. RESET CRÍTICO PARA MOBILE --- */
    html, body {
        padding-left: 0 !important; /* Remove o espaço da sidebar do PC */
        width: 100%;
        overflow-x: hidden; /* Evita rolagem lateral acidental */
    }

    /* --- 1. ESTRUTURA DO FOOTER --- */
    .site-footer {
        background-color: var(--cor-background-fundo);
        color: var(--cor-branco);
        padding: 40px 0 90px; /* Espaço para o botão flutuante */
        text-align: center;
        font-family: var(--fonte-principal);
        position: relative;
    }

    .site-footer .container-width {
        padding: 0 20px;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* --- 2. CABEÇALHO (LOGO E ENDEREÇO) --- */
    .footer-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
        margin-bottom: 30px;
    }

    .footer-brand { width: 100%; }

    .brand-flex {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .footer-brand img {
        height: 50px;
        width: auto;
        display: block;
    }

    .brand-address {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.9);
        margin: 0;
        line-height: 1.5;
        border: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .brand-address i {
        margin-bottom: 5px;
        font-size: 16px;
        opacity: 0.8;
    }

    /* --- 3. GRID DE AÇÃO (BOTÕES) --- */
    .footer-action-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 12px;
    }
    
    /* Botão de catálogo ocupa largura total se for ímpar no final */
    .footer-action-grid a:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    .btn-footer-blue {
        background-color: var(--cor-branco) !important;
        color: var(--cor-background-fundo) !important;
        min-height: 55px;
        padding: 10px;
        display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 5px; 
        font-size: 11px; font-weight: 800;
        text-decoration: none; border-radius: 6px;
        text-transform: uppercase; border: none;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .btn-footer-blue i {
        font-size: 18px; display: block;
    }

    .btn-footer-blue:active {
        background-color: #f0f0f0 !important;
        transform: scale(0.98);
    }

    /* --- 4. REDES SOCIAIS (FULL WIDTH SEGURO) --- */
    .footer-social-bar {
        display: flex;
        /* Cálculo seguro para ocupar a largura total compensando o padding do pai */
        width: calc(100% + 40px); 
        margin-left: -20px; 
        
        margin-top: 30px;
        margin-bottom: 30px;
        background: rgba(0,0,0,0.1);
        border-top: 1px solid rgba(255,255,255,0.15);
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    
    .social-tab {
        flex: 1; height: 60px;
        display: flex; align-items: center; justify-content: center;
        color: var(--cor-branco); font-size: 22px;
        border-right: 1px solid rgba(255,255,255,0.1);
        text-decoration: none;
    }
    .social-tab:last-child { border-right: none; }

    /* --- 5. LINKS E COPY --- */
    .footer-bottom {
        display: flex; flex-direction: column;
        gap: 25px; align-items: center;
    }

    .footer-links-area {
        display: flex; flex-wrap: wrap; justify-content: center;
        gap: 15px 20px; width: 100%;
    }

    .footer-links-area a {
        font-size: 13px; color: rgba(255,255,255,0.8);
        text-decoration: none; font-weight: 600;
    }

    .footer-copy-area p {
        font-size: 11px; opacity: 0.6; margin: 0; line-height: 1.4;
    }


    /* =========================================
       MODAIS (MAPA E FORM) - ESTILO APP
       ========================================= */
    
    /* Animação de Entrada */
    @keyframes mobileSlideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .modal-container {
        padding: 0; /* Remove padding para colar nas bordas se necessário */
        z-index: 10000;
        background: rgba(0, 0, 0, 0.95);
        
        /* Centraliza ou alinha embaixo */
        display: none;
        align-items: end; /* Estilo Bottom Sheet */
        justify-content: center;
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    }
    
    .modal-container.active { display: flex; }
    
    /* Base do Modal */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0; /* Arredonda só em cima */
        background: var(--cor-branco);
        display: flex; flex-direction: column;
        position: relative;
        animation: mobileSlideUp 0.3s ease-out forwards;
        max-height: 90vh; /* Limite de altura */
    }

    /* Modal Mapa */
    .map-content {
        height: 75vh;
        background: #fff;
        border: none; padding: 0;
        overflow: hidden;
    }
    .map-content iframe { flex: 1; width: 100%; border: none; }

    /* Modal Formulário */
    .form-content {
        overflow-y: auto; /* Scroll interno se o teclado subir */
        padding: 30px 20px;
        border-top: 5px solid var(--cor-principal);
    }

    .form-header h3 { font-size: 22px; margin-bottom: 5px; color: var(--cor-texto-forte); }
    .form-header p { font-size: 13px; margin-bottom: 20px; color: var(--cor-texto-medio); }

    /* Inputs otimizados para toque */
    .cardan-form input, .cardan-form textarea {
        padding: 14px; margin-bottom: 15px;
        border: 1px solid #ddd; border-radius: 8px;
        font-size: 16px; /* Evita zoom no iPhone */
        width: 100%; box-sizing: border-box;
        background: #f9f9f9; color: var(--cor-texto-forte);
    }
    .cardan-form input:focus, .cardan-form textarea:focus {
        background: #fff; border-color: var(--cor-principal); outline: none;
    }

    .btn-enviar-form {
        width: 100%; padding: 16px;
        background: var(--cor-principal); color: var(--cor-branco);
        border: none; border-radius: 8px;
        font-weight: 800; font-size: 15px; text-transform: uppercase;
        margin-top: 5px;
        box-shadow: 0 4px 10px rgba(0, 159, 227, 0.2);
    }

    /* Botão Fechar Grande (Rodapé do Modal) */
    .btn-fechar-inferior {
        display: block !important;
        width: 100%; padding: 16px; 
        background-color: #f0f0f0; color: #666;
        border: none; font-weight: 700; font-size: 13px;
        text-transform: uppercase; text-align: center;
        margin-top: 0; /* Cola no iframe no caso do mapa */
    }
    
    .form-content .btn-fechar-inferior {
        margin-top: 15px; background: transparent; /* No form, fundo transparente fica melhor */
    }
    
    .fechar-modal-btn { display: none !important; }

}