/* ============================================================
   PWA Fixed Bottom Navigation - Alugue Ferramentas
   Aparece APENAS em mobile e tablet (max-width: 1024px)
   ============================================================ */

/* Barra inferior fixa - oculta por padrão no desktop */
.bottom-nav {
    display: none;
}

/* Exibe apenas em mobile e tablet */
@media (max-width: 1024px) {

    /* Container principal da barra inferior */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        height: 64px;
        align-items: stretch;

        /* Safe area para iPhone com notch/home indicator */
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Cada item da barra */
    .bottom-nav-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: #9ca3af;
        font-size: 0.65rem;
        font-weight: 600;
        transition: color 0.2s ease, background 0.2s ease;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        padding: 6px 4px;
    }

    /* Hover */
    .bottom-nav-link:hover {
        color: #1e3a5f;
        background: #f8fafc;
    }

    /* Estado ativo */
    .bottom-nav-link.active {
        color: #1e3a5f;
    }

    /* Indicador superior no item ativo */
    .bottom-nav-link.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 3px;
        background: #1e3a5f;
        border-radius: 0 0 4px 4px;
    }

    /* Ícone */
    .bottom-nav-link .nav-icon {
        font-size: 1.35rem;
        line-height: 1;
        display: block;
    }

    /* Texto */
    .bottom-nav-link .nav-text {
        font-size: 0.6rem;
        line-height: 1;
        white-space: nowrap;
    }

    /* Compensar o conteúdo da página pela altura da barra inferior */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    /* Garantir que o footer não fique embaixo da barra */
    .footer {
        margin-bottom: 0;
    }
}

/* Telas muito pequenas: ajuste fino */
@media (max-width: 360px) {
    .bottom-nav {
        height: 58px;
    }

    .bottom-nav-link .nav-icon {
        font-size: 1.15rem;
    }

    .bottom-nav-link .nav-text {
        font-size: 0.55rem;
    }

    body {
        padding-bottom: calc(58px + env(safe-area-inset-bottom));
    }
}
